File view_matrix_sparse_binary.hpp

class BinarySparseMatrix : public CompressedView, public Matrix
#include <view_matrix_sparse_binary.hpp>

A two-dimensional view that provides row- or column wise access to binary values stored in a sparse matrix.

Subclassed by BinaryCscView, BinaryCsrView, SparseMatrix< T >

Public Types

using index_const_iterator = View<index_type>::const_iterator

An iterator that provides read-only access to the indices in the view.

using index_iterator = View<index_type>::iterator

An iterator that provides access to the indices in the view and allows to modify them.

Public Functions

inline BinarySparseMatrix(uint32 *indices, uint32 *indptr, uint32 numRows, uint32 numCols)
Parameters:
  • indices – A pointer to an array of type uint32, shape (numDenseElements), that stores the row or column indices of all dense elements explicitly stored in the matrix

  • indptr – A pointer to an array of type uint32, shape (numCols + 1) or (numRows + 1), that stores the indices of the first element in indices that corresponds to a certain column, if indices stores row indices, or row, if indices stores column indices. The index at the last position must be equal to numDenseElements

  • numRows – The number of rows in the view

  • numCols – The number of columns in the view

inline BinarySparseMatrix(const BinarySparseMatrix &other)
Parameters:

other – A const reference to an object of type SparseMatrix that should be copied

inline BinarySparseMatrix(BinarySparseMatrix &&other)
Parameters:

other – A reference to an object of type SparseMatrix that should be moved

inline virtual ~BinarySparseMatrix() override
template<typename Matrix>
class IterableBinarySparseMatrixDecorator : public Matrix
#include <view_matrix_sparse_binary.hpp>

Provides row- or column-wise access via iterators to the indices stored in a sparse matrix.

Template Parameters:

Matrix – The type of the matrix

Subclassed by IterableSparseMatrixDecorator< Matrix >

Public Types

using index_const_iterator = typename Matrix::view_type::index_const_iterator

An iterator that provides read-only access to the indices in the matrix.

using index_iterator = typename Matrix::view_type::index_iterator

An iterator that provides access to the indices in the matrix and allows to modify them.

Public Functions

inline explicit IterableBinarySparseMatrixDecorator(typename Matrix::view_type &&view)
Parameters:

view – The view, the matrix should be backed by

inline virtual ~IterableBinarySparseMatrixDecorator() override
inline index_const_iterator indices_cbegin(uint32 index) const

Returns an index_const_iterator to the beginning of the indices in a specific row or column of the matrix, depending on the memory layout of the view, the matrix is backed by.

Parameters:

index – The index of the row or column

Returns:

An index_const_iterator to the beginning of the indices

inline index_const_iterator indices_cend(uint32 index) const

Returns an index_const_iterator to the end of the indices in a specific row or column of the matrix, depending on the memory layout of the view, the matrix is backed by.

Parameters:

index – The index of the row or column

Returns:

An index_const_iterator to the end of the indices

inline index_iterator indices_begin(uint32 index)

Returns an index_iterator to the beginning of the indices in a specific row or column of the matrix, depending on the memory layout of the view, the matrix is backed by.

Parameters:

index – The index of the row or column

Returns:

An index_iterator to the beginning of the indices

inline index_iterator indices_end(uint32 index)

Returns an index_iterator to the end of the indices in a specific row or column of the matrix, depending on the memory layout of the view, the matrix is backed by.

Parameters:

index – The index of the row or column

Returns:

An index_iterator to the end of the indices

inline uint32 getNumDenseElements() const

Returns the number of dense elements explicitly stored in the matrix.

Returns:

The number of dense elements explicitly stored in the matrix