25 #ifndef _GEMA_SPARSE_MATRIX_LAYOUT_BUILDER_H_ 26 #define _GEMA_SPARSE_MATRIX_LAYOUT_BUILDER_H_ 51 virtual bool begin(
int n,
int expectedNnz) = 0;
57 virtual bool addEntry(
int row,
int col) = 0;
62 virtual bool end() = 0;
64 static int nnzEstimative(
const GmElementMesh* mesh,
int maxDofsPerNode);
75 virtual bool begin(
int n,
int expectedNnz);
76 virtual bool addEntry(
int row,
int col);
97 virtual bool begin(
int n,
int expectedNnz);
98 virtual bool addEntry(
int row,
int col);
105 bool insertIfNew(
int* p,
int size,
int value,
int ptrIndex);
112 bool allocData(
int size,
int* initData,
int initSize);
128 #ifdef ENABLE_SPARSE_MEMORY_DEBUG 129 void entryAdded(
int addedSize);
virtual bool addEntry(int row, int col)
Informs the builder that the entry in the given row/column is not 0.0. Keep in mind that this functio...
Definition: gmSparseMatrixLayoutBuilder.cpp:134
virtual bool begin(int n, int expectedNnz)
Informs the builder that the process of calling addEntry() is about to begin. Paremeter n is the numb...
Definition: gmSparseMatrixLayoutBuilder.cpp:281
int * _dataVec
The prealocated memory for colum(CSR)/row(CSC) data. Size equal to (_n*_nnz). Row/column indices are ...
Definition: gmSparseMatrixLayoutBuilder.h:126
Declaration of usefull configuration definitions for the Core library.
int _expectedNnz
The initial guess for the number of non zeros (stored for statistic only)
Definition: gmSparseMatrixLayoutBuilder.h:84
An interface for building the layout structure of a sparse matrix.
Definition: gmSparseMatrixLayoutBuilder.h:39
GmCSxSparseMatrixLayout< IndexType, T > * _layout
The layout object being filled.
Definition: gmSparseMatrixLayoutBuilder.h:82
const int _extDataSize
The number of _dataVec entries needed to hold an ExtData structure.
Definition: gmSparseMatrixLayoutBuilder.h:119
virtual bool end()
Finishes the building process completing the creation of the associate layout structure....
Definition: gmSparseMatrixLayoutBuilder.cpp:399
GmCSxSparseMatrixLayout< IndexType, T > * _layout
The layout object being filled.
Definition: gmSparseMatrixLayoutBuilder.h:115
int * _data
A pointer to the extra buffer.
Definition: gmSparseMatrixLayoutBuilder.h:110
bool allocData(int size, int *initData, int initSize)
An auxiliar function that just allocates a vector of the given size, initializes its first entries wi...
Definition: gmSparseMatrixLayoutBuilder.cpp:631
A class for creating a CSR/CSC matrix layout by using an intermediary vector based structure to conso...
Definition: gmSparseMatrixLayoutBuilder.h:90
int _nnz
The pre-allocated initial guess for the number of non zeros per row/column.
Definition: gmSparseMatrixLayoutBuilder.h:116
virtual bool end()
Finishes the building process completing the creation of the associate layout structure....
Definition: gmSparseMatrixLayoutBuilder.cpp:165
void clear()
Clears the internal _dataVec structure.
Definition: gmSparseMatrixLayoutBuilder.cpp:256
virtual ~GmSparseMatrixLayoutBuilder()
Virtual destructor.
Definition: gmSparseMatrixLayoutBuilder.h:43
int _n
The number of matrix rows (CSR) / columns (CSC)
Definition: gmSparseMatrixLayoutBuilder.h:117
virtual bool begin(int n, int expectedNnz)
Informs the builder that the process of calling addEntry() is about to begin. Paremeter n is the numb...
Definition: gmSparseMatrixLayoutBuilder.cpp:94
bool _hasExtData
Did we needed any ExtData vector?
Definition: gmSparseMatrixLayoutBuilder.h:118
virtual bool addEntry(int row, int col)
Informs the builder that the entry in the given row/column is not 0.0. Keep in mind that this functio...
Definition: gmSparseMatrixLayoutBuilder.cpp:327
A structure for storing a matrix layout in either CSR or CSC format. The template type defines the ty...
Definition: gmSparseMatrixLayout.h:123
#define GMC_API_EXPORT
Macro for controling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_LI...
Definition: gmCoreConfig.h:35
QSet< QPair< int, int > > _nodeNodeMap
The hash table used to collect used matrix entry coordinates.
Definition: gmSparseMatrixLayoutBuilder.h:83
bool insertIfNew(int *p, int size, int value, int ptrIndex)
Searches for value in the array pointed by p, with the given size. If the value is not found in p,...
Definition: gmSparseMatrixLayoutBuilder.cpp:592
Definition: gmSparseMatrixLayoutBuilder.h:107
virtual ~GmVectorCSxSparseMatrixLayoutBuilder()
Destructor.
Definition: gmSparseMatrixLayoutBuilder.cpp:248
Base interface for FEM (finite element) meshes.
Definition: gmElementMesh.h:40
Declaration of the GmSparseMatrixLayout structure and its derived types.
A class for creating a CSR/CSC matrix layout by using an intermediary hash table to consolidate the (...
Definition: gmSparseMatrixLayoutBuilder.h:70
int _nalloc
The number of allocated entries in the extension vector WITH negative sign. Always less than -1.
Definition: gmSparseMatrixLayoutBuilder.h:109