ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::DenseMatrix< T > Class Template Reference

an \( m \times n \) matrix by rows in one contiguous vector More...

#include <ADS/numeric/DenseMatrix.h>

Public types

using value_type = T
 the type of the entries

Public member functions

 DenseMatrix (void)=default
 the empty \( 0 \times 0 \) matrix
 DenseMatrix (std::size_t m, std::size_t n, const T &v=T(0))
 the \( m \times n \) matrix of entries \( v \)
 DenseMatrix (const Matrix< T > &A)
 the matrix of the rows of the Matrix of the book
std::size_t rows (void) const
 the number \( m \) of rows
std::size_t cols (void) const
 the number \( n \) of columns
T & operator() (std::size_t i, std::size_t j)
 the entry \( ( i , j ) \), at the place \( i n + j \)
const T & operator() (std::size_t i, std::size_t j) const
 the entry \( ( i , j ) \) of a constant matrix
T * data (void)
 the entries, by rows
const T * data (void) const
 the entries of a constant matrix, by rows
Matrix< T > toMatrix (void) const
 the Matrix of the book with the same entries
bool operator== (const DenseMatrix &) const =default
 true if the two matrices have the same sizes and entries

Static public member functions

static DenseMatrix uninitialized (std::size_t m, std::size_t n)
 the \( m \times n \) matrix whose entries are not set, which a function then writes, if T is a number (they are T() otherwise)

Detailed description

template<class T>
class ADS::DenseMatrix< T >

an \( m \times n \) matrix by rows in one contiguous vector

Member typedef documentation

◆ value_type

template<class T>
using ADS::DenseMatrix< T >::value_type = T

the type of the entries

Constructor and destructor documentation

◆ DenseMatrix() [1/3]

template<class T>
ADS::DenseMatrix< T >::DenseMatrix ( void )
default

the empty \( 0 \times 0 \) matrix

◆ DenseMatrix() [2/3]

template<class T>
ADS::DenseMatrix< T >::DenseMatrix ( std::size_t m,
std::size_t n,
const T & v = T( 0 ) )
inline

the \( m \times n \) matrix of entries \( v \)

◆ DenseMatrix() [3/3]

template<class T>
ADS::DenseMatrix< T >::DenseMatrix ( const Matrix< T > & A)
explicit

the matrix of the rows of the Matrix of the book

Precondition
the rows have the same length

Member function documentation

◆ cols()

template<class T>
std::size_t ADS::DenseMatrix< T >::cols ( void ) const
inlinenodiscard

the number \( n \) of columns

◆ data() [1/2]

template<class T>
T * ADS::DenseMatrix< T >::data ( void )
inlinenodiscard

the entries, by rows

◆ data() [2/2]

template<class T>
const T * ADS::DenseMatrix< T >::data ( void ) const
inlinenodiscard

the entries of a constant matrix, by rows

◆ operator()() [1/2]

template<class T>
T & ADS::DenseMatrix< T >::operator() ( std::size_t i,
std::size_t j )
inlinenodiscard

the entry \( ( i , j ) \), at the place \( i n + j \)

Precondition
\( i < \mathrm{rows}() \) and \( j < \mathrm{cols}() \)

◆ operator()() [2/2]

template<class T>
const T & ADS::DenseMatrix< T >::operator() ( std::size_t i,
std::size_t j ) const
inlinenodiscard

the entry \( ( i , j ) \) of a constant matrix

Precondition
\( i < \mathrm{rows}() \) and \( j < \mathrm{cols}() \)

◆ operator==()

template<class T>
bool ADS::DenseMatrix< T >::operator== ( const DenseMatrix< T > & ) const
default

true if the two matrices have the same sizes and entries

◆ rows()

template<class T>
std::size_t ADS::DenseMatrix< T >::rows ( void ) const
inlinenodiscard

the number \( m \) of rows

◆ toMatrix()

template<class T>
Matrix< T > ADS::DenseMatrix< T >::toMatrix ( void ) const
nodiscard

the Matrix of the book with the same entries

◆ uninitialized()

template<class T>
DenseMatrix ADS::DenseMatrix< T >::uninitialized ( std::size_t m,
std::size_t n )
inlinestatic

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


The documentation for this class was generated from the following file: