Poplar and PopLibs
popsparse::CSCMatrix< T > Struct Template Reference

Sparse matrix stored in compressed sparse columns (CSC) format for a matrix of size [M x N]. More...

#include <SparseStorageFormats.hpp>

Inherits popsparse::Block.

Public Member Functions

 CSCMatrix (std::size_t numNZValues, std::size_t numColumns, const std::array< std::size_t, 2 > &blockDimensions_={1, 1})
 Constructor to allocate memory.
 

Public Attributes

std::vector< T > nzValues
 The non-zero values of the sparse matrix. More...
 
std::vector< std::size_t > columnIndices
 Indices where non-zero values for each column block starts. More...
 
std::vector< std::size_t > rowIndices
 The row index of each block in nzValues. More...
 

Detailed Description

template<typename T>
struct popsparse::CSCMatrix< T >

Sparse matrix stored in compressed sparse columns (CSC) format for a matrix of size [M x N].

There is no explicit encoding of M in the storage. The number of column indices is equal to (N/number of columns in block) + 1. The case of element sparsity is treated as a special case with block size equal to {number of rows in block, number of columns in block} = {1, 1}.

Member Data Documentation

◆ columnIndices

template<typename T >
std::vector<std::size_t> popsparse::CSCMatrix< T >::columnIndices

Indices where non-zero values for each column block starts.

There are a total of N/block size + 1 entries with the last entry equal to nzValues.

◆ nzValues

template<typename T >
std::vector<T> popsparse::CSCMatrix< T >::nzValues

The non-zero values of the sparse matrix.

The number of values is always an integer multiple of the block size.

◆ rowIndices

template<typename T >
std::vector<std::size_t> popsparse::CSCMatrix< T >::rowIndices

The row index of each block in nzValues.

There are as many entries as the number of blocks in nzValues.


The documentation for this struct was generated from the following file: