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

Constructors

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

Getters

coeff (uint32_t index)
 
void * begin ()
 
void * end ()
 
size_t byteSize ()
 
uint32_t innerSize ()
 
uint32_t outerSize ()
 
uint32_t nonZeros ()
 
uint32_t getLength ()
 

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 = uint64_t, uint8_t compressionLevel = 3, bool columnMajor = true>
class IVSparse::SparseMatrix< T, indexT, compressionLevel, columnMajor >::Vector

Template Parameters
TType of the values in the matrix
indexTType of the indices in the matrix
compressionLevelCompression level of the matrix
columnMajorStorage order of the matrix

IVCSC Vector Class

The IVCSC Vector class is a vector class that is used to work with IVCSC 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/4]

Vector ( )
inline

Default Vector Constructor

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

◆ Vector() [2/4]

Vector ( uint32_t  length)

Length Vector Constructor

Creates a vector of the given length with everything set to null/zero.

◆ Vector() [3/4]

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

IVSparse Matrix to Vector Constructor

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

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

◆ Vector() [4/4]

Vector ( IVSparse::SparseMatrix< T, indexT, compressionLevel, 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.

◆ begin()

void * begin
Returns
A pointer to the beginning of the vector.

◆ end()

void * end
Returns
A pointer to the end of the vector.

◆ 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.

◆ 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.