File view_matrix_csc.hpp

template<typename T>
class CscView : public SparseMatrix<T>
#include <view_matrix_csc.hpp>

A two-dimensional view that provides column-wise access to values stored in a matrix in the compressed sparse column (CSC) format.

Template Parameters:

T – The type of the values, the view provides access to

Public Functions

inline CscView(T *values, uint32 *indices, uint32 *indptr, uint32 numRows, uint32 numCols, T sparseValue = 0)
Parameters:
  • values – A pointer to an array of template type T that stores all non-zero values, the view should provide access to

  • indices – A pointer to an array of type uint32, shape (numNonZeroValues), that stores the row indices, the values in values correspond to

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

  • numRows – 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 CscView(const CscView<T> &other)
Parameters:

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

inline CscView(CscView<T> &&other)
Parameters:

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

inline virtual ~CscView() override
inline SparseMatrix<T>::value_const_iterator values_cbegin(uint32 column) const

Returns a value_const_iterator to the beginning of the values in a specific column of the matrix.

Parameters:

column – The index of the column

Returns:

A value_const_iterator to the beginning of the values

inline SparseMatrix<T>::value_const_iterator values_cend(uint32 column) const

Returns a value_const_iterator to the end of the values in a specific column of the matrix.

Parameters:

column – The index of the column

Returns:

A value_const_iterator to the end of the values

inline SparseMatrix<T>::index_const_iterator indices_cbegin(uint32 column) const

Returns an index_const_iterator to the beginning of the indices in a specific column of the matrix.

Parameters:

column – The index of the column

Returns:

An index_const_iterator to the beginning of the indices

inline SparseMatrix<T>::index_const_iterator indices_cend(uint32 column) const

Returns an index_const_iterator to the end of the indices in a specific column of the matrix.

Parameters:

column – The index of the column

Returns:

An index_const_iterator to the end of the indices

inline SparseMatrix<T>::value_iterator values_begin(uint32 column)

Returns a value_iterator to the beginning of the values in a specific column of the matrix.

Parameters:

column – The index of the column

Returns:

A value_iterator to the beginning of the values

inline SparseMatrix<T>::value_iterator values_end(uint32 column)

Returns a value_iterator to the end of the values in a specific column of the matrix.

Parameters:

column – The index of the column

Returns:

A value_iterator to the end of the values

inline SparseMatrix<T>::index_iterator indices_begin(uint32 column)

Returns an index_iterator to the beginning of the indices in a specific column of the matrix.

Parameters:

column – The index of the column

Returns:

An index_iterator to the beginning of the indices

inline SparseMatrix<T>::index_iterator indices_end(uint32 column)

Returns an index_iterator to the end of the indices in a specific column of the matrix.

Parameters:

column – The index of the column

Returns:

An index_iterator to the end of the indices

inline uint32 getNumNonZeroElements() const

Returns the number of non-zero elements in the view.

Returns:

The number of non-zero elements