OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
SparseMatrix< T, id_t, EIGEN_BASE > Class Template Reference

Detailed Description

template<typename T, typename id_t>
class SparseMatrix< T, id_t, EIGEN_BASE >

Definition at line 77 of file SparseMatrix_Eigen.hpp.

Public Types

typedef boost::mpl::int_
< EIGEN_BASE > 
triplet_impl
 Triplet implementation id.
 
typedef triplet< T, EIGEN_BASE > triplet_type
 Triplet type.
 

Public Member Functions

 SparseMatrix (size_t N1, size_t N2)
 Create an empty Matrix. More...
 
 SparseMatrix ()
 Create an empty Matrix. More...
 
openfpm::vector< triplet_type > & getMatrixTriplets ()
 Get the Matrix triplets bugger. More...
 
const Eigen::SparseMatrix< T,
0, id_t > & 
getMat () const
 Get the Eigen Matrix object. More...
 
Eigen::SparseMatrix< T, 0, id_t > & getMat ()
 Get the Eigen Matrix object. More...
 
void resize (size_t row, size_t col, size_t l_row, size_t l_col)
 Resize the Sparse Matrix. More...
 
operator() (id_t i, id_t j)
 Get the row i and the colum j of the Matrix. More...
 
bool save (const std::string &file) const
 Save this object into file. More...
 
bool load (const std::string &file)
 Load this object from file. More...
 
getValue (size_t r, size_t c)
 Get the value from triplet. More...
 

Private Member Functions

void assemble ()
 Assemble the matrix. More...
 
void collect ()
 Here we collect the full matrix on master. More...
 

Private Attributes

Eigen::SparseMatrix< T, 0, id_t > mat
 
openfpm::vector< triplet_typetrpl
 
openfpm::vector< triplet_typetrpl_recv
 

Constructor & Destructor Documentation

template<typename T , typename id_t >
SparseMatrix< T, id_t, EIGEN_BASE >::SparseMatrix ( size_t  N1,
size_t  N2 
)
inline

Create an empty Matrix.

Parameters
N1number of row
N2number of colums

Definition at line 137 of file SparseMatrix_Eigen.hpp.

template<typename T , typename id_t >
SparseMatrix< T, id_t, EIGEN_BASE >::SparseMatrix ( )
inline

Create an empty Matrix.

Definition at line 146 of file SparseMatrix_Eigen.hpp.

Member Function Documentation

template<typename T , typename id_t >
void SparseMatrix< T, id_t, EIGEN_BASE >::assemble ( )
inlineprivate

Assemble the matrix.

Definition at line 97 of file SparseMatrix_Eigen.hpp.

template<typename T , typename id_t >
void SparseMatrix< T, id_t, EIGEN_BASE >::collect ( )
inlineprivate

Here we collect the full matrix on master.

Definition at line 117 of file SparseMatrix_Eigen.hpp.

template<typename T , typename id_t >
const Eigen::SparseMatrix<T,0,id_t>& SparseMatrix< T, id_t, EIGEN_BASE >::getMat ( ) const
inline

Get the Eigen Matrix object.

Returns
the Eigen Matrix

Definition at line 165 of file SparseMatrix_Eigen.hpp.

template<typename T , typename id_t >
Eigen::SparseMatrix<T,0,id_t>& SparseMatrix< T, id_t, EIGEN_BASE >::getMat ( )
inline

Get the Eigen Matrix object.

Returns
the Eigen Matrix

Definition at line 178 of file SparseMatrix_Eigen.hpp.

template<typename T , typename id_t >
openfpm::vector<triplet_type>& SparseMatrix< T, id_t, EIGEN_BASE >::getMatrixTriplets ( )
inline

Get the Matrix triplets bugger.

It return a buffer that can be filled with triplets

Returns
triplet buffer

Definition at line 155 of file SparseMatrix_Eigen.hpp.

template<typename T , typename id_t >
T SparseMatrix< T, id_t, EIGEN_BASE >::getValue ( size_t  r,
size_t  c 
)
inline

Get the value from triplet.

Warning
It is extremly slow because it do a full search across the triplets elements
Parameters
rrow
ccolum

Definition at line 287 of file SparseMatrix_Eigen.hpp.

template<typename T , typename id_t >
bool SparseMatrix< T, id_t, EIGEN_BASE >::load ( const std::string &  file)
inline

Load this object from file.

Parameters
filefilename
Returns
true if succed

Definition at line 245 of file SparseMatrix_Eigen.hpp.

template<typename T , typename id_t >
T SparseMatrix< T, id_t, EIGEN_BASE >::operator() ( id_t  i,
id_t  j 
)
inline

Get the row i and the colum j of the Matrix.

Returns
the value of the matrix at row i colum j

Definition at line 201 of file SparseMatrix_Eigen.hpp.

template<typename T , typename id_t >
void SparseMatrix< T, id_t, EIGEN_BASE >::resize ( size_t  row,
size_t  col,
size_t  l_row,
size_t  l_col 
)
inline

Resize the Sparse Matrix.

Parameters
rownumber for row
colnumber of colums

Definition at line 191 of file SparseMatrix_Eigen.hpp.

template<typename T , typename id_t >
bool SparseMatrix< T, id_t, EIGEN_BASE >::save ( const std::string &  file) const
inline

Save this object into file.

Parameters
filefilename
Returns
true if succed

Definition at line 213 of file SparseMatrix_Eigen.hpp.


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