Template Class CSRMatrix

Class Documentation

template<class Precision, class index_type>
class CSRMatrix

Manage memory of Compressed Sparse Row (CSR) sparse matrix. CSR format represents a matrix M by three (one-dimensional) arrays, that respectively contain nonzero values, row offsets, and column indices.

Template Parameters
  • Precision – Floating-point precision type.

  • index_type – Integer type.

Public Functions

inline CSRMatrix(size_t num_rows, size_t nnz)
inline CSRMatrix(size_t num_rows, size_t nnz, index_type *column_ptr, index_type *csrOffsets_ptr, std::complex<Precision> *value_ptr)
CSRMatrix() = default
inline auto getColumns() -> std::vector<index_type>&

Get the CSR format index vector of the matrix.

inline auto getCsrOffsets() -> std::vector<index_type>&

Get CSR format offset vector of the matrix.

inline auto getValues() -> std::vector<std::complex<Precision>>&

Get CSR format data vector of the matrix.