Template Class DenseMatrix

Class Documentation

template<class T>
class DenseMatrix

an m x n matrix by rows in one contiguous vector

Public Types

using value_type = T

Public Functions

DenseMatrix(void) = default
inline DenseMatrix(std::size_t m, std::size_t n, const T &v = T(0))

the m x n matrix of entries v

explicit DenseMatrix(const Matrix<T> &A)

the matrix of the rows of the book’s Matrix

Pre:

the rows have the same length

inline std::size_t rows(void) const
inline std::size_t cols(void) const
inline T &operator()(std::size_t i, std::size_t j)

the entry ( i , j )

Pre:

i < rows() and j < cols()

inline const T &operator()(std::size_t i, std::size_t j) const
inline T *data(void)

the entries, by rows

inline const T *data(void) const
Matrix<T> toMatrix(void) const

the book’s Matrix of the same entries

bool operator==(const DenseMatrix&) const = default

Public Static Functions

static inline DenseMatrix uninitialized(std::size_t m, std::size_t n)

the m x n matrix whose entries are not set, which a function then writes, if T is a number (they are T() otherwise)