GemaCoreLib
The GeMA Core library
Public Member Functions | List of all members
GmSparseMatrixSingleTripletBuffer< T > Class Template Reference

Especialization of the GmSingleAppendBuffer class using the GmSparseMatrixTripletBuffer interface. More...

#include <gmSparseMatrixTripletData.h>

Inheritance diagram for GmSparseMatrixSingleTripletBuffer< T >:
Inheritance graph
[legend]
Collaboration diagram for GmSparseMatrixSingleTripletBuffer< T >:
Collaboration graph
[legend]

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...
 
- Public Member Functions inherited from GmSingleAppendBuffer< GmSparseMatrixTripletData< T >, GmSparseMatrixTripletBuffer< T > >
 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
 
- Public Member Functions inherited from GmAppendBuffer< GmSparseMatrixTripletData< T > >
virtual ~GmAppendBuffer ()
 Virtual destructor.
 

Additional Inherited Members

- Static Public Member Functions inherited from GmSparseMatrixTripletBuffer< T >
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.
 
- Protected Member Functions inherited from GmSingleAppendBuffer< GmSparseMatrixTripletData< T >, GmSparseMatrixTripletBuffer< T > >
void clearList ()
 
- Protected Attributes inherited from GmSingleAppendBuffer< GmSparseMatrixTripletData< T >, GmSparseMatrixTripletBuffer< T > >
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.
 

Detailed Description

template<GmSparseMatrixLayoutTypes T>
class GmSparseMatrixSingleTripletBuffer< T >

Especialization of the GmSingleAppendBuffer class using the GmSparseMatrixTripletBuffer interface.

Member Function Documentation

◆ sortedData()

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


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