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;
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);
Base interface for FEM (finite element) meshes.
Definition gmElementMesh.h:42
A class for creating a CSR/CSC matrix layout by using an intermediary hash table to consolidate the (...
Definition gmSparseMatrixLayoutBuilder.h:71
QSet< QPair< int, int > > _nodeNodeMap
The hash table used to collect used matrix entry coordinates.
Definition gmSparseMatrixLayoutBuilder.h:83
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
GmCSxSparseMatrixLayout< IndexType, T > * _layout
The layout object being filled.
Definition gmSparseMatrixLayoutBuilder.h:82
int _expectedNnz
The initial guess for the number of non zeros (stored for statistic only)
Definition gmSparseMatrixLayoutBuilder.h:84
virtual bool end()
Finishes the building process completing the creation of the associate layout structure....
Definition gmSparseMatrixLayoutBuilder.cpp:165
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
An interface for building the layout structure of a sparse matrix.
Definition gmSparseMatrixLayoutBuilder.h:40
virtual ~GmSparseMatrixLayoutBuilder()
Virtual destructor.
Definition gmSparseMatrixLayoutBuilder.h:43
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 numb...
virtual bool end()=0
Finishes the building process completing the creation of the associate layout structure....
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 functio...
A class for creating a CSR/CSC matrix layout by using an intermediary vector based structure to conso...
Definition gmSparseMatrixLayoutBuilder.h:91
int _nnz
The pre-allocated initial guess for the number of non zeros per row/column.
Definition gmSparseMatrixLayoutBuilder.h:116
GmCSxSparseMatrixLayout< IndexType, T > * _layout
The layout object being filled.
Definition gmSparseMatrixLayoutBuilder.h:115
int _n
The number of matrix rows (CSR) / columns (CSC)
Definition gmSparseMatrixLayoutBuilder.h:117
const int _extDataSize
The number of _dataVec entries needed to hold an ExtData structure.
Definition gmSparseMatrixLayoutBuilder.h:119
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
int * _dataVec
The prealocated memory for colum(CSR)/row(CSC) data. Size equal to (_n*_nnz). Row/column indices are ...
Definition gmSparseMatrixLayoutBuilder.h:126
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
virtual ~GmVectorCSxSparseMatrixLayoutBuilder()
Destructor.
Definition gmSparseMatrixLayoutBuilder.cpp:248
virtual bool end()
Finishes the building process completing the creation of the associate layout structure....
Definition gmSparseMatrixLayoutBuilder.cpp:399
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:589
void clear()
Clears the internal _dataVec structure.
Definition gmSparseMatrixLayoutBuilder.cpp:256
bool _hasExtData
Did we needed any ExtData vector?
Definition gmSparseMatrixLayoutBuilder.h:118
Declaration of useful configuration definitions for the Core library.
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Declaration of the GmSparseMatrixLayout structure and its derived types.
A structure for storing a matrix layout in either CSR or CSC format. The template type defines the ty...
Definition gmSparseMatrixLayout.h:124
Definition gmSparseMatrixLayoutBuilder.h:108
int _nalloc
The number of allocated entries in the extension vector WITH negative sign. Always less than -1.
Definition gmSparseMatrixLayoutBuilder.h:109
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:628