Sparse Matrix implementation, that map over Eigen. More...
Sparse Matrix implementation, that map over Eigen.
T | Type of the sparse Matrix store on each row,colums |
id_t | type of id |
impl | implementation |
Definition at line 98 of file SparseMatrix_petsc.hpp.
#include <SparseMatrix_petsc.hpp>
Public Types | |
typedef boost::mpl::int_< PETSC_BASE > | triplet_impl |
Triplet implementation id. | |
typedef triplet< T, PETSC_BASE > | triplet_type |
Triplet type. | |
Public Member Functions | |
SparseMatrix (size_t N1, size_t N2, size_t n_row_local) | |
Create an empty Matrix. | |
SparseMatrix () | |
Create an empty Matrix. | |
openfpm::vector< triplet_type > & | getMatrixTriplets () |
Get the Matrix triplets buffer. | |
const Mat & | getMat () const |
Get the Patsc Matrix object. | |
Mat & | getMat () |
Get the Petsc Matrix object. | |
void | resize (size_t row, size_t col, size_t l_row, size_t l_col) |
Resize the Sparse Matrix. | |
T | operator() (id_t i, id_t j) |
Get the row i and the colum j of the Matrix. | |
T | getValue (size_t r, size_t c) |
Get the value from triplet. | |
bool | isMatrixFilled () |
Return the state of matrix. | |
bool | write (std::string out, size_t opt=VTK_WRITER) |
Private Member Functions | |
void | fill_petsc () |
Fill the petsc Matrix. | |
SparseMatrix (const SparseMatrix< T, id_t, PETSC_BASE > &spm) | |
Disable copy constructor. | |
Private Attributes | |
size_t | g_row |
Number of matrix row (global) | |
size_t | g_col |
Number of matrix colums (global) | |
size_t | l_row |
Number of matrix row (local) | |
size_t | l_col |
Number of matrix colums (local) | |
size_t | start_row |
starting row for this processor | |
bool | m_created = false |
indicate if the matrix has been created | |
Mat | mat |
PETSC Matrix. | |
openfpm::vector< triplet_type > | trpl |
Triplets of the matrix. | |
openfpm::vector< PetscScalar > | vals |
temporary list of values | |
openfpm::vector< PetscInt > | cols |
temporary list of colums | |
openfpm::vector< PetscInt > | d_nnz |
PETSC d_nnz. | |
openfpm::vector< PetscInt > | o_nnz |
PETSC o_nnz. | |
typedef boost::mpl::int_<PETSC_BASE> SparseMatrix< T, id_t, PETSC_BASE >::triplet_impl |
Triplet implementation id.
Definition at line 103 of file SparseMatrix_petsc.hpp.
typedef triplet<T,PETSC_BASE> SparseMatrix< T, id_t, PETSC_BASE >::triplet_type |
Triplet type.
Definition at line 106 of file SparseMatrix_petsc.hpp.
|
inlineprivate |
Disable copy constructor.
Definition at line 209 of file SparseMatrix_petsc.hpp.
|
inline |
Create an empty Matrix.
N1 | number of row |
N2 | number of colums |
N1_loc | number of local row |
Definition at line 221 of file SparseMatrix_petsc.hpp.
|
inline |
Create an empty Matrix.
Definition at line 245 of file SparseMatrix_petsc.hpp.
|
inline |
Definition at line 254 of file SparseMatrix_petsc.hpp.
|
inlineprivate |
Fill the petsc Matrix.
Definition at line 146 of file SparseMatrix_petsc.hpp.
|
inline |
Get the Petsc Matrix object.
Definition at line 293 of file SparseMatrix_petsc.hpp.
|
inline |
Get the Patsc Matrix object.
Definition at line 280 of file SparseMatrix_petsc.hpp.
|
inline |
Get the Matrix triplets buffer.
It return a buffer that can be filled with triplets
Definition at line 268 of file SparseMatrix_petsc.hpp.
|
inline |
Get the value from triplet.
r | row |
c | colum |
Definition at line 364 of file SparseMatrix_petsc.hpp.
|
inline |
Return the state of matrix.
Returns a bool flag that indicated whether the matrix has already been filled via MatSetValues
Definition at line 381 of file SparseMatrix_petsc.hpp.
|
inline |
Get the row i and the colum j of the Matrix.
Definition at line 347 of file SparseMatrix_petsc.hpp.
|
inline |
Resize the Sparse Matrix.
row | number for row |
col | number of colums |
local | number of row |
local | number of colums |
Definition at line 309 of file SparseMatrix_petsc.hpp.
|
inline |
Definition at line 391 of file SparseMatrix_petsc.hpp.
|
mutableprivate |
temporary list of colums
Definition at line 136 of file SparseMatrix_petsc.hpp.
|
mutableprivate |
PETSC d_nnz.
Definition at line 138 of file SparseMatrix_petsc.hpp.
|
private |
Number of matrix colums (global)
Definition at line 113 of file SparseMatrix_petsc.hpp.
|
private |
Number of matrix row (global)
Definition at line 111 of file SparseMatrix_petsc.hpp.
|
private |
Number of matrix colums (local)
Definition at line 118 of file SparseMatrix_petsc.hpp.
|
private |
Number of matrix row (local)
Definition at line 116 of file SparseMatrix_petsc.hpp.
|
private |
indicate if the matrix has been created
Definition at line 124 of file SparseMatrix_petsc.hpp.
|
private |
PETSC Matrix.
Definition at line 127 of file SparseMatrix_petsc.hpp.
|
mutableprivate |
PETSC o_nnz.
Definition at line 140 of file SparseMatrix_petsc.hpp.
|
private |
starting row for this processor
Definition at line 121 of file SparseMatrix_petsc.hpp.
|
private |
Triplets of the matrix.
Definition at line 130 of file SparseMatrix_petsc.hpp.
|
mutableprivate |
temporary list of values
Definition at line 134 of file SparseMatrix_petsc.hpp.