ViennaCL - The Vienna Computing Library  1.5.2
Public Types | Public Member Functions
amg_sparsematrix< ScalarType > Class Template Reference

A class for the sparse matrix type. Uses vector of maps as data structure for higher performance and lower memory usage. Uses similar interface as ublas::compressed_matrix. Can deal with transposed of matrix internally: Creation, Storage, Iterators, etc. More...

#include <amg_base.hpp>

Public Types

typedef ScalarType value_type
 
typedef AdapterType::iterator1 iterator1
 
typedef AdapterType::iterator2 iterator2
 
typedef
ConstAdapterType::const_iterator1 
const_iterator1
 
typedef
ConstAdapterType::const_iterator2 
const_iterator2
 

Public Member Functions

 amg_sparsematrix ()
 Standard constructor. More...
 
 amg_sparsematrix (unsigned int i, unsigned int j)
 Constructor. Builds matrix of size (i,j). More...
 
 amg_sparsematrix (std::vector< std::map< unsigned int, ScalarType > > const &mat)
 Constructor. Builds matrix via std::vector<std::map> by copying memory (Only necessary feature of this other matrix type is to have const iterators) More...
 
template<typename MatrixType >
 amg_sparsematrix (MatrixType const &mat)
 Constructor. Builds matrix via another matrix type. (Only necessary feature of this other matrix type is to have const iterators) More...
 
void do_trans ()
 
void set_trans (bool mode)
 
bool get_trans () const
 
bool isnonzero (unsigned int i, unsigned int j) const
 
void add (unsigned int i, unsigned int j, ScalarType s)
 
template<typename IteratorType >
void addscalar (IteratorType &iter, unsigned int i, unsigned int j, ScalarType s)
 
template<typename IteratorType >
void removescalar (IteratorType &iter, unsigned int i)
 
NonzeroScalarType operator() (unsigned int i, unsigned int j)
 
ScalarType operator() (unsigned int i, unsigned int j) const
 
void resize (unsigned int i, unsigned int j, bool preserve=true)
 
void clear ()
 
vcl_size_t size1 ()
 
vcl_size_t size1 () const
 
vcl_size_t size2 ()
 
vcl_size_t size2 () const
 
iterator1 begin1 (bool trans=false)
 
iterator1 end1 (bool trans=false)
 
iterator2 begin2 (bool trans=false)
 
iterator2 end2 (bool trans=false)
 
const_iterator1 begin1 () const
 
const_iterator1 end1 (bool trans=false) const
 
const_iterator2 begin2 (bool trans=false) const
 
const_iterator2 end2 (bool trans=false) const
 
std::vector< std::map
< unsigned int, ScalarType > > * 
get_internal_pointer ()
 
 operator boost::numeric::ublas::compressed_matrix< ScalarType > (void)
 
 operator boost::numeric::ublas::matrix< ScalarType > (void)
 

Detailed Description

template<typename ScalarType>
class viennacl::linalg::detail::amg::amg_sparsematrix< ScalarType >

A class for the sparse matrix type. Uses vector of maps as data structure for higher performance and lower memory usage. Uses similar interface as ublas::compressed_matrix. Can deal with transposed of matrix internally: Creation, Storage, Iterators, etc.

Member Typedef Documentation

typedef ScalarType value_type

Constructor & Destructor Documentation

amg_sparsematrix ( )
inline

Standard constructor.

amg_sparsematrix ( unsigned int  i,
unsigned int  j 
)
inline

Constructor. Builds matrix of size (i,j).

Parameters
iSize of first dimension
jSize of second dimension
amg_sparsematrix ( std::vector< std::map< unsigned int, ScalarType > > const &  mat)
inline

Constructor. Builds matrix via std::vector<std::map> by copying memory (Only necessary feature of this other matrix type is to have const iterators)

Parameters
matVector of maps
amg_sparsematrix ( MatrixType const &  mat)
inline

Constructor. Builds matrix via another matrix type. (Only necessary feature of this other matrix type is to have const iterators)

Parameters
matMatrix

Member Function Documentation

void add ( unsigned int  i,
unsigned int  j,
ScalarType  s 
)
inline
void addscalar ( IteratorType &  iter,
unsigned int  i,
unsigned int  j,
ScalarType  s 
)
inline
iterator1 begin1 ( bool  trans = false)
inline
const_iterator1 begin1 ( ) const
inline
iterator2 begin2 ( bool  trans = false)
inline
const_iterator2 begin2 ( bool  trans = false) const
inline
void clear ( )
inline
void do_trans ( )
inline
iterator1 end1 ( bool  trans = false)
inline
const_iterator1 end1 ( bool  trans = false) const
inline
iterator2 end2 ( bool  trans = false)
inline
const_iterator2 end2 ( bool  trans = false) const
inline
std::vector<std::map<unsigned int, ScalarType> >* get_internal_pointer ( )
inline
bool get_trans ( ) const
inline
bool isnonzero ( unsigned int  i,
unsigned int  j 
) const
inline
operator boost::numeric::ublas::compressed_matrix< ScalarType > ( void  )
inline
operator boost::numeric::ublas::matrix< ScalarType > ( void  )
inline
NonzeroScalarType operator() ( unsigned int  i,
unsigned int  j 
)
inline
ScalarType operator() ( unsigned int  i,
unsigned int  j 
) const
inline
void removescalar ( IteratorType &  iter,
unsigned int  i 
)
inline
void resize ( unsigned int  i,
unsigned int  j,
bool  preserve = true 
)
inline
void set_trans ( bool  mode)
inline
vcl_size_t size1 ( )
inline
vcl_size_t size1 ( ) const
inline
vcl_size_t size2 ( )
inline
vcl_size_t size2 ( ) const
inline

The documentation for this class was generated from the following file: