![]() |
GemaCoreLib
The GeMA Core library
|
An especialization of GmAppendBufffer for triplet data with an extra method for returning the buffer already sorted. More...
#include <gmSparseMatrixTripletData.h>
Public Member Functions | |
virtual GmSparseMatrixTripletData< T > * | sortedData (int nlin, GmSparseMatrixTripletBufferSortStrategy st)=0 |
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... | |
![]() | |
virtual | ~GmAppendBuffer () |
Virtual destructor. | |
virtual void | clear ()=0 |
Releases the memory used by the buffer, returning it to a recently constructed state. Must be followed by a call to reserve() before the object is able to do any further appends. Must be called from the main thread only. | |
virtual void | reserve (size_t size)=0 |
Informs the buffer of the expected number of entries that will be filled by (concurrent) calls to append. Can only be called from the main thread. More... | |
virtual void | append (const GmSparseMatrixTripletData< T > &val)=0 |
Appends val to the buffer in a thread safe way. Can grow the buffer if needed. | |
virtual void | appendFromThread (int tid, const GmSparseMatrixTripletData< T > &val)=0 |
Appends val to the buffer in a thread safe way, using the given tid to access TLS storage. Can grow the buffer if needed. | |
virtual size_t | size () const=0 |
Returns the number of entries in the buffer. Must be called from the main thread only. | |
virtual GmSparseMatrixTripletData< T > * | data ()=0 |
Returns a vector filled with the buffer data. After this call, NO calls to append() can be made without a prior call to clear(). More... | |
virtual size_t | usedMemory () const=0 |
Returns an estimative of the total memory used by the buffer in bytes. | |
Static Public Member Functions | |
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. | |
An especialization of GmAppendBufffer for triplet data with an extra method for returning the buffer already sorted.
|
pure 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.
Implemented in GmSparseMatrixPerThreadTripletBuffer< T >, and GmSparseMatrixSingleTripletBuffer< T >.