![]() |
GemaCoreLib
The GeMA Core library
|
Especialization of the GmSingleAppendBuffer class using the GmSparseMatrixTripletBuffer interface. More...
#include <gmSparseMatrixTripletData.h>
Public Member Functions | |
GmSparseMatrixSingleTripletBuffer (size_t initSize, double resizeFactor=2.0, int numThreads=-1) | |
Buffer constructor. See the description for the GmSingleAppendBuffer constructor. | |
virtual GmSparseMatrixTripletData< T > * | sortedData (int nlin, GmSparseMatrixTripletBufferSortStrategy st) |
Similar to data() but returning a sorted vector, obtained by using the given strategy. The nlin parameter should inform the number of lines of the matrix and is used as the maximum value stored for a line or column in the triplet data. More... | |
![]() | |
GmSingleAppendBuffer (size_t initSize, double resizeFactor=2.0, int numThreads=-1) | |
Buffer constructor. Can optionally pre allocate the buffer with initSize entries. If initSize is zero, a call to reserve() MUST be made before any append. The given resizeFactor controlls how the buffer grows in case of a resize. See the class comments for additional info. More... | |
~GmSingleAppendBuffer () | |
Destructor. Releases the allocated memory. | |
virtual void | clear () |
virtual void | reserve (size_t bsize) |
See comments on the base class. Should not be called if the size was given in the constructor. | |
virtual void | append (const GmSparseMatrixTripletData< T > &val) |
virtual void | appendFromThread (int tid, const GmSparseMatrixTripletData< T > &val) |
virtual size_t | size () const |
virtual GmSparseMatrixTripletData< T > * | data () |
virtual size_t | usedMemory () const |
![]() | |
virtual | ~GmAppendBuffer () |
Virtual destructor. | |
Additional Inherited Members | |
![]() | |
static int | strToSortStrategy (const QString &str) |
Returns the sort strategy associated with the given string. Returns -1 if no match was found. | |
static const char * | sortStrategyToStr (GmSparseMatrixTripletBufferSortStrategy st) |
Returns the string used to define the given sort strategy. | |
![]() | |
void | clearList () |
![]() | |
ControllData * | _head |
Pointer to the first allocated buffer. | |
double | _resizeFactor |
The resize factor. | |
QAtomicInteger< size_t > | _nextIndex |
The next free index in the global vector. | |
QAtomicPointer< ControllData > | _controll |
The controll block pointing to the current buffer. | |
GmSpinLock | _controllLock |
The lock controlling changes to _controll. | |
GmSparseMatrixTripletData< T > * | _dataBuffer |
The single buffer after a call to data() | |
int | _nt |
Number of threads considered for parallel memcopy. | |
Especialization of the GmSingleAppendBuffer class using the GmSparseMatrixTripletBuffer interface.
|
virtual |
Similar to data() but returning a sorted vector, obtained by using the given strategy. The nlin parameter should inform the number of lines of the matrix and is used as the maximum value stored for a line or column in the triplet data.
IMPORTANT: You should not mix calls to data() and sortedData() without a call to clear() in between.
Implements GmSparseMatrixTripletBuffer< T >.