File view_matrix_csr.hpp¶
-
template<typename T>
class CsrView : public SparseMatrix<T>¶ - #include <view_matrix_csr.hpp>
A two-dimensional view that provides row-wise access to values stored in a matrix in the compressed sparse row (CSR) format.
- Template Parameters:
T – The type of the values, the view provides access to
Public Functions
-
inline CsrView(T *values, uint32 *indices, uint32 *indptr, uint32 numRows, uint32 numCols, T sparseValue = 0)¶
- Parameters:
values – A pointer to an array of template type
Tthat stores the values of all dense elements explicitly stored in the viewindices – A pointer to an array of type
uint32, shape(numDenseElements), that stores the column indices, the values invaluescorrespond toindptr – A pointer to an array of type
uint32, shape(numRows + 1), that stores the indices of the first element invaluesandindicesthat corresponds to a certain row. The index at the last position must be equal tonumDenseElementsnumRows – The number of rows in the view
numCols – The number of columns in the view
sparseValue – The value that should be used for sparse elements in the matrix
-
inline CsrView(const CsrView<T> &other)¶
- Parameters:
other – A const reference to an object of type
CsrViewthat should be copied
-
inline CsrView(CsrView<T> &&other)¶
- Parameters:
other – A reference to an object of type
CsrViewthat should be moved
-
inline virtual ~CsrView() override¶
-
inline SparseMatrix<T>::value_const_iterator values_cbegin(uint32 row) const¶
Returns a
value_const_iteratorto the beginning of the values in a specific row of the matrix.- Parameters:
row – The index of the row
- Returns:
A
value_const_iteratorto the beginning of the values
-
inline SparseMatrix<T>::value_const_iterator values_cend(uint32 row) const¶
Returns a
value_const_iteratorto the end of the values in a specific row of the matrix.- Parameters:
row – The index of the row
- Returns:
A
value_const_iteratorto the end of the values
-
inline SparseMatrix<T>::index_const_iterator indices_cbegin(uint32 row) const¶
Returns an
index_const_iteratorto the beginning of the indices in a specific row of the matrix.- Parameters:
row – The index of the row
- Returns:
An
index_const_iteratorto the beginning of the indices
-
inline SparseMatrix<T>::index_const_iterator indices_cend(uint32 row) const¶
Returns an
index_const_iteratorto the end of the indices in a specific row of the matrix.- Parameters:
row – The index of the row
- Returns:
An
index_const_iteratorto the end of the indices
-
inline SparseMatrix<T>::value_iterator values_begin(uint32 row)¶
Returns a
value_iteratorto the beginning of the values in a specific row of the matrix.- Parameters:
row – The index of the row
- Returns:
A
value_iteratorto the beginning of the values
-
inline SparseMatrix<T>::value_iterator values_end(uint32 row)¶
Returns a
value_iteratorto the end of the values in a specific row of the matrix.- Parameters:
row – The index of the row
- Returns:
A
value_iteratorto the end of the values
-
inline SparseMatrix<T>::index_iterator indices_begin(uint32 row)¶
Returns an
index_iteratorto the beginning of the indices in a specific row of the matrix.- Parameters:
row – The index of the row
- Returns:
An
index_iteratorto the beginning of the indices
-
inline SparseMatrix<T>::index_iterator indices_end(uint32 row)¶
Returns an
index_iteratorto the end of the indices in a specific row of the matrix.- Parameters:
row – The index of the row
- Returns:
An
index_iteratorto the end of the indices