GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
GmSparseMatrixTripletBuffer< T > Class Template Referenceabstract

An especialization of GmAppendBufffer for triplet data with an extra method for returning the buffer already sorted. More...

#include <gmSparseMatrixTripletData.h>

Inheritance diagram for GmSparseMatrixTripletBuffer< T >:
Collaboration diagram for GmSparseMatrixTripletBuffer< T >:

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.
 
- Public Member Functions inherited from GmAppendBuffer< GmSparseMatrixTripletData< T > >
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.
 
virtual void append (const 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 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 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().
 
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.
 

Detailed Description

template<GmSparseMatrixLayoutTypes T>
class GmSparseMatrixTripletBuffer< T >

An especialization of GmAppendBufffer for triplet data with an extra method for returning the buffer already sorted.

Member Function Documentation

◆ sortedData()

virtual GmSparseMatrixTripletData< T > * GmSparseMatrixTripletBuffer< T >::sortedData ( int nlin,
GmSparseMatrixTripletBufferSortStrategy st )
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 >.


The documentation for this class was generated from the following files: