![]() |
GemaCoreLib
The GeMA Core library
|
An interface for building the layout structure of a sparse matrix. More...
#include <gmSparseMatrixLayoutBuilder.h>
Public Member Functions | |
virtual | ~GmSparseMatrixLayoutBuilder () |
Virtual destructor. | |
virtual bool | begin (int n, int expectedNnz)=0 |
Informs the builder that the process of calling addEntry() is about to begin. Paremeter n is the number of rows(CSR) / columns(CSC) of the matrix, while expectedNnz gives an estimative of the number of non zero entries per matrix row (CSR) / column (CSC). If zero, no estimative will be used to minimize memory allocations. Returns false on errors (out of memory, for example). | |
virtual bool | addEntry (int row, int col)=0 |
Informs the builder that the entry in the given row/column is not 0.0. Keep in mind that this function will probably be called multiple times for the same line, column pair. Returns false on errors (out of memory, for example). | |
virtual bool | end ()=0 |
Finishes the building process completing the creation of the associate layout structure. Returns false on errors (out of memory, for example). | |
Static Public Member Functions | |
static int | nnzEstimative (const GmElementMesh *mesh, int maxDofsPerNode) |
Quick estimative of the number of nonzeros in a sparse matrix for a mesh given the number of dofs per node. Will return 0 if unknown. | |
An interface for building the layout structure of a sparse matrix.