IVSparse  v1.0
A sparse matrix compression library.
SparseMatrix< T, indexT, compressionLevel, columnMajor >::InnerIterator< T, indexT, compressionLevel, columnMajor >

Constructors

 InnerIterator ()
 
 InnerIterator (SparseMatrix< T, indexT, compressionLevel, columnMajor > &mat, uint32_t col)
 
 InnerIterator (SparseMatrix< T, indexT, compressionLevel, columnMajor >::Vector &vec)
 

Getters

indexT getIndex ()
 
indexT outerDim ()
 
indexT row ()
 
indexT col ()
 
value ()
 
void coeff (T newValue)
 
bool isNewRun ()
 

Detailed Description

template<typename T, typename indexT = uint64_t, uint8_t compressionLevel = 3, bool columnMajor = true>
template<typename T, typename indexT, uint8_t compressionLevel, bool columnMajor>
class IVSparse::SparseMatrix< T, indexT, compressionLevel, columnMajor >::InnerIterator< T, indexT, compressionLevel, columnMajor >

Template Parameters
TThe type of the values in the matrix
indexTThe type of the indices in the matrix
compressionLevelThe level of compression used in the matrix
columnMajorWhether the matrix is column major or not

IVCSC Inner Iterator Class

The IVCSC Inner Iterator is a forward traversal iterator like the others in the IVSparse library. The IVCSC Iterator is slower than the others due to needing to decode compressed data.

VCSC Inner Iterator Class

The VCSC Inner Iterator is a forward traversal iterator like the others in the IVSparse library. It's very low overhead and is used to traverse over the nonzeros of a single vector of a matrix or a vector on its own. The VCSC Inner Iterator differs from the CSC Iterator in that it travereses a counts vector in the VCSC Matrix instead of a outer pointers vector.

Constructor & Destructor Documentation

◆ InnerIterator() [1/3]

InnerIterator ( )
inline

Default Iterator Constructor

Creates an empty iterator that can't be used on its own.

◆ InnerIterator() [2/3]

InnerIterator ( IVSparse::SparseMatrix< T, indexT, compressionLevel, columnMajor > &  matrix,
uint32_t  col 
)
inline

IVCSC Matrix InnerIterator Constructor

The main constructor for the Inner Iterator. Given a matrix the iterator will forward traverse over the given vector of the matrix. The traversal is sorted by value in ascending order.

◆ InnerIterator() [3/3]

InnerIterator ( SparseMatrix< T, indexT, compressionLevel, columnMajor >::Vector vec)

IVCSC Vector InnerIterator Constructor

Same as the previous constructor but for a single standalone vector. Can be used in the same way as the previous constructor.

Member Function Documentation

◆ getIndex()

indexT getIndex ( )
Returns
The current index of the iterator.

◆ outerDim()

indexT outerDim ( )
Returns
The current outer dimension of the iterator.

◆ row()

indexT row ( )
Returns
The current row of the iterator.

◆ col()

indexT col ( )
Returns
The current column of the iterator.

◆ value()

T value ( )
Returns
The current value of the iterator.

◆ coeff()

void coeff ( newValue)
inline

Changes the value where the iterator is pointing.

Note
This is the only way to update elements in the IVSparse format.

◆ isNewRun()

bool isNewRun ( )
inline
Returns
If the iterator is at the beginning of a new run.