Flow123d
JS_before_hm-2137-g84767e588
|
Temporary storage for a sparse matrix. More...
#include <matrix_coo.hpp>
Classes | |
struct | TripleDiagEntry_ |
returns true if the entry is on diagonal, i.e. row == column More... | |
struct | TripleLessThan_ |
returns true if the index pair of the first entry is smaller than of the second entry More... | |
struct | TripleRowIndexLessThan_ |
returns true if the row of an entry is smaller than a prescribed index More... | |
struct | TripleRowLessThan_ |
returns true if the first entry has smaller ROW index than the second one More... | |
Public Types | |
typedef INDT | IndexType |
typedef VALT | ValueType |
Public Member Functions | |
MatrixCoo (unsigned nRows=0, unsigned nCols=0) | |
~MatrixCoo () | |
IndexType | nnz () const |
Return number of non-zeros. More... | |
void | prepareAssembly (const IndexType length) |
void | insert (const IndexType i, const IndexType j, const ValueType value) |
Insert a value to unassembled vector. More... | |
void | finishAssembly () |
Finalize matrix assembly - build the assembled input and truncate matrix. More... | |
void | getIntervalCounts (IndexType low, IndexType high, std::vector< IndexType > &nnzRowsIn, std::vector< IndexType > &nnzRowsOut) |
Determine number of nonzeros within a block [low,high) - used for PETSc preallocation. More... | |
void | getEntry (IndexType index, IndexType &row, IndexType &col, ValueType &val) |
Get specific entry. More... | |
void | zeroRow (const IndexType row, const ValueType factor) |
Zero a row and set diagonal to scalar. More... | |
void | setCompressedRowArrays (std::vector< IndexType > &colIndices, std::vector< IndexType > &rowPtrs, std::vector< ValueType > &values) |
void | extractArrays (std::vector< IndexType > &rowIndices, std::vector< IndexType > &colIndices, std::vector< ValueType > &values, bool onlyUpperTriangle=false) |
Fill independent arrays with column indices, row pointers and values. More... | |
void | clear () |
destroy all contents More... | |
void | erase () |
erase all contents More... | |
std::ostream & | write (std::ostream &out) |
debug-output More... | |
double | infNorm () |
Compute maximal row sum (infinity-norm) of a matrix in coordinate format. More... | |
ValueType | frobeniusNorm () |
Return Frobenius norm of matrix . More... | |
double | getDiagScalar () |
Private Types | |
typedef std::pair< IndexType, IndexType > | IndexPair_ |
pair of indices More... | |
typedef std::pair< IndexPair_, ValueType > | Triple_ |
triple More... | |
typedef std::vector< Triple_ > | MatrixCooVec_ |
vector of triples More... | |
Private Member Functions | |
IndexType | deduceNumRows_ () |
Triple_ | combineTriples_ (typename MatrixCooVec_::const_iterator itb, typename MatrixCooVec_::const_iterator ite) |
merge range of triples by addition More... | |
Private Attributes | |
MatrixCooVec_ | matrixCooVec_ |
matrix in coordinate format <i,j, values> More... | |
IndexType | nRows_ |
number of rows of matrix More... | |
IndexType | nCols_ |
number of columns of matrix More... | |
unsigned | sortedSize_ |
number of sorted entries More... | |
bool | sorted_ |
state variable - is matrix sorted? More... | |
Temporary storage for a sparse matrix.
This object stores and handles matrix in coordinate format, i.e., <row_index,col_index,value>-combinations for each matrix entry of a sparse matrix. Functionalities are:
Definition at line 34 of file matrix_coo.hpp.
|
private |
pair of indices
Definition at line 458 of file matrix_coo.hpp.
typedef INDT la::MatrixCoo< INDT, VALT >::IndexType |
Definition at line 60 of file matrix_coo.hpp.
|
private |
vector of triples
Definition at line 460 of file matrix_coo.hpp.
|
private |
triple
Definition at line 459 of file matrix_coo.hpp.
typedef VALT la::MatrixCoo< INDT, VALT >::ValueType |
Definition at line 61 of file matrix_coo.hpp.
|
inline |
Definition at line 64 of file matrix_coo.hpp.
|
inline |
Definition at line 72 of file matrix_coo.hpp.
|
inline |
destroy all contents
Definition at line 325 of file matrix_coo.hpp.
|
inlineprivate |
merge range of triples by addition
Definition at line 540 of file matrix_coo.hpp.
|
inlineprivate |
deduce number of rows - if it was given by user, use it, otherwise, deduce it from the index of the last entry
Definition at line 475 of file matrix_coo.hpp.
|
inline |
erase all contents
Definition at line 334 of file matrix_coo.hpp.
|
inline |
Fill independent arrays with column indices, row pointers and values.
Definition at line 290 of file matrix_coo.hpp.
|
inline |
Finalize matrix assembly - build the assembled input and truncate matrix.
Definition at line 111 of file matrix_coo.hpp.
|
inline |
Return Frobenius norm of matrix .
Definition at line 391 of file matrix_coo.hpp.
|
inline |
Get scalar suitable to be put on diagonal while fixing BC This is the mean value of extremal entries on diagonal - the aim of this guess is to be within the spectra of the original matrix - this value immediately corresponds to an eigenvalue
Definition at line 416 of file matrix_coo.hpp.
|
inline |
Get specific entry.
Definition at line 194 of file matrix_coo.hpp.
|
inline |
Determine number of nonzeros within a block [low,high) - used for PETSc preallocation.
Definition at line 158 of file matrix_coo.hpp.
|
inline |
Compute maximal row sum (infinity-norm) of a matrix in coordinate format.
Definition at line 371 of file matrix_coo.hpp.
|
inline |
Insert a value to unassembled vector.
Definition at line 90 of file matrix_coo.hpp.
|
inline |
Return number of non-zeros.
Definition at line 77 of file matrix_coo.hpp.
|
inline |
Prepare matrix for assembly - allocate buffer for UNASSEMBLED entries serial copies of element matrices to memory length = numElements * size( elementMatrix )
Definition at line 82 of file matrix_coo.hpp.
|
inline |
Fill arrays with column indices, row pointers and values for row-compressed data storage
Definition at line 247 of file matrix_coo.hpp.
|
inline |
debug-output
Definition at line 349 of file matrix_coo.hpp.
|
inline |
Zero a row and set diagonal to scalar.
Definition at line 202 of file matrix_coo.hpp.
|
private |
matrix in coordinate format <i,j, values>
Definition at line 461 of file matrix_coo.hpp.
|
private |
number of columns of matrix
Definition at line 464 of file matrix_coo.hpp.
|
private |
number of rows of matrix
Definition at line 463 of file matrix_coo.hpp.
|
private |
state variable - is matrix sorted?
Definition at line 468 of file matrix_coo.hpp.
|
private |
number of sorted entries
Definition at line 466 of file matrix_coo.hpp.