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

Public Member Functions

Constructors
 Vector ()
 
 Vector (IVSparse::SparseMatrix< T, indexT, 2, columnMajor > &mat, uint32_t vec)
 
 Vector (IVSparse::SparseMatrix< T, indexT, 2, columnMajor >::Vector &vec)
 
 ~Vector ()
 
Getters
coeff (uint32_t index)
 
size_t byteSize ()
 
uint32_t innerSize ()
 
uint32_t outerSize ()
 
uint32_t nonZeros ()
 
uint32_t getLength ()
 
T * getValues ()
 
indexT * getCounts ()
 
indexT * getIndices ()
 
indexT uniqueVals ()
 
Utility Methods
void print ()
 
Calculation Methods
double norm ()
 
sum ()
 
double dot (Eigen::Vector< T, -1 > &other)
 
double dot (Eigen::SparseVector< T, -1 > &other)
 

Detailed Description

template<typename T, typename indexT, bool columnMajor>
class IVSparse::SparseMatrix< T, indexT, 2, columnMajor >::Vector

VCSC Vector Class

The VCSC Vector class is a vector class that is used to work with VCSC matrices. It works with the same logic as the corresponding matrix compression level and is useful when working with these matrices.

Constructor & Destructor Documentation

◆ Vector() [1/3]

Vector ( )
inline

Default Vector Constructor

Creates an empty vector with everything set to null/zero.

◆ Vector() [2/3]

Vector ( IVSparse::SparseMatrix< T, indexT, 2, columnMajor > &  mat,
uint32_t  vec 
)

IVSparse Matrix to Vector Constructor

Creates a vector from a VCSC Matrix at the given vector index.

Note
Can only get a vector from a matrix in the storage order of the matrix.

◆ Vector() [3/3]

Vector ( IVSparse::SparseMatrix< T, indexT, 2, columnMajor >::Vector &  vec)

Deep Copy Vector Constructor

Creates a deep copy of the given vector.

◆ ~Vector()

Destroys the vector.

Member Function Documentation

◆ coeff()

T coeff ( uint32_t  index)
Returns
The coefficient at the given index.

◆ byteSize()

size_t byteSize
Returns
The size of the vector in bytes.

◆ innerSize()

uint32_t innerSize
Returns
The inner size of the vector.

◆ outerSize()

uint32_t outerSize
Returns
The outer size of the vector.

◆ nonZeros()

uint32_t nonZeros
Returns
The number of non-zero elements in the vector.

◆ getLength()

uint32_t getLength
Returns
The length of the vector.

◆ getValues()

T * getValues
Returns
A pointer to the values of the vector.

◆ getCounts()

indexT * getCounts
Returns
A pointer to the counts of the vector.

◆ getIndices()

indexT * getIndices
Returns
A pointer to the indices of the vector.

◆ uniqueVals()

indexT uniqueVals
Returns
The number of unique values in the vector.

◆ print()

void print

Prints the vector dense to the console.

◆ norm()

double norm
inline
Returns
The norm of the vector.

◆ sum()

T sum
inline
Returns
The sum of the vector.

◆ dot() [1/2]

double dot ( Eigen::Vector< T, -1 > &  other)
Returns
The dot product of the vector and an Eigen Dense Vector.

◆ dot() [2/2]

double dot ( Eigen::SparseVector< T, -1 > &  other)
Returns
The dot product of the vector and an Eigen Sparse Vector.