File view_matrix_dense.hpp

template<typename T>
class DenseMatrix : public BaseView<T>, public Matrix
#include <view_matrix_dense.hpp>

A two-dimensional view that provides access to values stored in a dense matrix of a specific size.

Template Parameters:

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

Subclassed by CContiguousView< T >, FortranContiguousView< T >

Public Types

using value_const_iterator = const BaseView<T>::value_type*

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

using value_iterator = BaseView<T>::value_type*

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

Public Functions

inline DenseMatrix(T *array, uint32 numRows, uint32 numCols)
Parameters:
  • array – A pointer to an array of template type T that stores the values, the view should provide access to

  • numRows – The number of rows in the view

  • numCols – The number of columns in the view

inline DenseMatrix(const DenseMatrix<T> &other)
Parameters:

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

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

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

inline virtual ~DenseMatrix() override
inline void clear()

Sets all values stored in the matrix to zero.

template<typename Matrix>
class DenseMatrixAllocator : public Matrix
#include <view_matrix_dense.hpp>

Allocates the memory, a two-dimensional dense view provides access to.

Template Parameters:

Matrix – The type of the view

Public Functions

inline DenseMatrixAllocator(uint32 numRows, uint32 numCols, bool init = false)
Parameters:
  • numRows – The number of rows in the view

  • numCols – The number of columns in the view

  • init – True, if all elements in the view should be value-initialized, false otherwise

inline DenseMatrixAllocator(const DenseMatrixAllocator<Matrix> &other)
Parameters:

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

inline DenseMatrixAllocator(DenseMatrixAllocator<Matrix> &&other)
Parameters:

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

inline virtual ~DenseMatrixAllocator() override
template<typename Matrix>
class IterableDenseMatrixDecorator : public Matrix
#include <view_matrix_dense.hpp>

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

Template Parameters:

Matrix – The type of the matrix

Public Types

using value_const_iterator = Matrix::view_type::value_const_iterator

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

using value_iterator = Matrix::view_type::value_iterator

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

Public Functions

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

view – The view, the matrix should be backed by

inline virtual ~IterableDenseMatrixDecorator() override
inline value_const_iterator values_cbegin(uint32 index) const

Returns a value_const_iterator to the beginning of a specific row or column in 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:

A value_const_iterator to the beginning of the row or column

inline value_const_iterator values_cend(uint32 index) const

Returns a value_const_iterator to the end of a specific row or column in 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:

A value_const_iterator to the end of the row or column

inline value_iterator values_begin(uint32 index)

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

Parameters:

index – The index of the row or column

Returns:

A value_iterator to the beginning of the row or column

inline value_iterator values_end(uint32 index)

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

Parameters:

index – The index of the row or column

Returns:

A value_iterator to the end of the row or column