![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Fixed-size dense matrix of dimensions M \( \times \) N backed by a 2D C-array (no dynamic allocation). More...
#include <Matrix.hpp>
Inheritance diagram for CDPL::Math::CMatrix< T, M, N >:Public Types | |
| typedef T | ValueType |
| The scalar value type. More... | |
| typedef T & | Reference |
| Mutable reference type to an element. More... | |
| typedef const T & | ConstReference |
| Constant reference type to an element. More... | |
| typedef std::size_t | SizeType |
| The unsigned size type. More... | |
| typedef std::ptrdiff_t | DifferenceType |
| The signed difference type. More... | |
| typedef ValueType | ArrayType[M][N] |
| The fixed-size 2D C-array type used for in-memory storage of M \( \times \) N elements. More... | |
| typedef T(* | ArrayPointer)[N] |
| Pointer-to-row type for raw access to the element array. More... | |
| typedef const T(* | ConstArrayPointer)[N] |
| Constant pointer-to-row type for raw access to the element array. More... | |
| typedef T * | Pointer |
| Pointer type to a single element. More... | |
| typedef const T * | ConstPointer |
| Constant pointer type to a single element. More... | |
| typedef MatrixReference< SelfType > | ClosureType |
| Closure type used when this matrix appears inside another expression. More... | |
| typedef const MatrixReference< const SelfType > | ConstClosureType |
| Constant closure type used when this matrix appears inside another expression. More... | |
| typedef BoundedMatrix< T, M, N > | MatrixTemporaryType |
| Concrete temporary matrix type used by expression-template machinery (a Math::BoundedMatrix of equal capacity). More... | |
| typedef BoundedVector< T, M *N > | VectorTemporaryType |
| Concrete temporary vector type used when assembling vectors from this matrix. More... | |
| typedef std::shared_ptr< SelfType > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated CMatrix instances. More... | |
| typedef std::initializer_list< std::initializer_list< T > > | InitializerListType |
| The initializer-list-of-rows type accepted by constructors and assignment. More... | |
Public Types inherited from CDPL::Math::MatrixContainer< CMatrix< T, M, N > > | |
| typedef CMatrix< T, M, N > | ContainerType |
| The derived matrix container type. More... | |
Public Types inherited from CDPL::Math::MatrixExpression< E > | |
| typedef E | ExpressionType |
| The derived matrix expression type. More... | |
Public Types inherited from CDPL::Math::Expression< E > | |
| typedef E | ExpressionType |
| The derived expression type (made available to expression-template machinery). More... | |
Public Member Functions | |
| CMatrix () | |
| Constructs a zero-initialized \( M \times N \) matrix. More... | |
| CMatrix (const ValueType &v) | |
| Constructs an \( M \times N \) matrix with every element initialized to v. More... | |
| CMatrix (const CMatrix &m) | |
| Constructs a copy of the fixed-size matrix m. More... | |
| CMatrix (InitializerListType l) | |
| Constructs a fixed-size matrix with the contents of the initializer list of rows l. More... | |
| template<typename E > | |
| CMatrix (const MatrixExpression< E > &e) | |
| Constructs a fixed-size matrix from the matrix expression e. More... | |
| Reference | operator() (SizeType i, SizeType j) |
| Returns a mutable reference to the element at (i, j). More... | |
| ConstReference | operator() (SizeType i, SizeType j) const |
Returns a const reference to the element at (i, j). More... | |
| bool | isEmpty () const |
| Tells whether the matrix is empty (M or N is zero). More... | |
| SizeType | getSize1 () const |
| Returns the fixed row count M. More... | |
| SizeType | getSize2 () const |
| Returns the fixed column count N. More... | |
| SizeType | getMaxSize1 () const |
| Returns the fixed row count M (capacity equals size for Math::CMatrix). More... | |
| SizeType | getMaxSize2 () const |
| Returns the fixed column count N (capacity equals size for Math::CMatrix). More... | |
| ArrayPointer | getData () |
| Returns a mutable pointer-to-row to the contiguous 2D element array. More... | |
| ConstArrayPointer | getData () const |
Returns a const pointer-to-row to the contiguous 2D element array. More... | |
| CMatrix & | operator= (const CMatrix &m) |
| Copy-assigns the elements of m to this fixed-size matrix. More... | |
| template<typename C > | |
| CMatrix & | operator= (const MatrixContainer< C > &c) |
| Assigns the contents of the matrix container c to this fixed-size matrix (no alias check needed). More... | |
| template<typename T1 > | |
| CMatrix & | operator= (InitializerListType l) |
| Assigns the rows in l to this fixed-size matrix (clipped or zero-padded to M \( \times \) N). More... | |
| template<typename E > | |
| CMatrix & | operator= (const MatrixExpression< E > &e) |
| Assigns the matrix expression e to this fixed-size matrix (via a temporary to handle aliasing). More... | |
| template<typename C > | |
| CMatrix & | operator+= (const MatrixContainer< C > &c) |
| Adds the contents of the matrix container c element-wise to this fixed-size matrix (no alias check needed). More... | |
| CMatrix & | operator+= (InitializerListType l) |
| Adds the rows in l element-wise to this fixed-size matrix. More... | |
| template<typename E > | |
| CMatrix & | operator+= (const MatrixExpression< E > &e) |
| Adds the matrix expression e element-wise to this fixed-size matrix (via a temporary to handle aliasing). More... | |
| template<typename C > | |
| CMatrix & | operator-= (const MatrixContainer< C > &c) |
| Subtracts the contents of the matrix container c element-wise from this fixed-size matrix (no alias check needed). More... | |
| CMatrix & | operator-= (InitializerListType l) |
| Subtracts the rows in l element-wise from this fixed-size matrix. More... | |
| template<typename E > | |
| CMatrix & | operator-= (const MatrixExpression< E > &e) |
| Subtracts the matrix expression e element-wise from this fixed-size matrix (via a temporary to handle aliasing). More... | |
| template<typename T1 > | |
| std::enable_if< IsScalar< T1 >::value, CMatrix >::type & | operator*= (const T1 &t) |
| Multiplies every element by the scalar t. More... | |
| template<typename T1 > | |
| std::enable_if< IsScalar< T1 >::value, CMatrix >::type & | operator/= (const T1 &t) |
| Divides every element by the scalar t. More... | |
| template<typename E > | |
| CMatrix & | assign (const MatrixExpression< E > &e) |
| Assigns the elements of the matrix expression e to this fixed-size matrix without intermediate temporary. More... | |
| CMatrix & | assign (InitializerListType l) |
| Assigns the rows in l to this fixed-size matrix (clipped or zero-padded to M \( \times \) N). More... | |
| template<typename E > | |
| CMatrix & | plusAssign (const MatrixExpression< E > &e) |
| Adds the elements of the matrix expression e to this matrix without intermediate temporary. More... | |
| CMatrix & | plusAssign (InitializerListType l) |
| Adds the rows in l element-wise to this matrix without intermediate temporary. More... | |
| template<typename E > | |
| CMatrix & | minusAssign (const MatrixExpression< E > &e) |
| Subtracts the elements of the matrix expression e from this matrix without intermediate temporary. More... | |
| CMatrix & | minusAssign (InitializerListType l) |
| Subtracts the rows in l element-wise from this matrix without intermediate temporary. More... | |
| void | swap (CMatrix &m) |
| Swaps the contents of this fixed-size matrix with those of m. More... | |
| void | clear (const ValueType &v=ValueType()) |
| Sets every element of the matrix to the value v. More... | |
Public Member Functions inherited from CDPL::Math::MatrixContainer< CMatrix< T, M, N > > | |
| const ContainerType & | operator() () const |
Returns a const reference to the derived matrix container. More... | |
| ContainerType & | operator() () |
| Returns a reference to the derived matrix container. More... | |
Public Member Functions inherited from CDPL::Math::MatrixExpression< E > | |
| const ExpressionType & | operator() () const |
Returns a const reference to the derived matrix expression. More... | |
| ExpressionType & | operator() () |
| Returns a reference to the derived matrix expression. More... | |
Static Public Attributes | |
| static const SizeType | Size1 = M |
| The compile-time fixed row count M. More... | |
| static const SizeType | Size2 = N |
| The compile-time fixed column count N. More... | |
Friends | |
| void | swap (CMatrix &m1, CMatrix &m2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::MatrixContainer< CMatrix< T, M, N > > | |
| MatrixContainer () | |
| ~MatrixContainer () | |
Protected Member Functions inherited from CDPL::Math::MatrixExpression< E > | |
| MatrixExpression () | |
| ~MatrixExpression () | |
Protected Member Functions inherited from CDPL::Math::Expression< E > | |
| Expression () | |
| ~Expression () | |
Fixed-size dense matrix of dimensions M \( \times \) N backed by a 2D C-array (no dynamic allocation).
| T | The scalar value type. |
| M | The fixed number of rows. |
| N | The fixed number of columns. |
| typedef T CDPL::Math::CMatrix< T, M, N >::ValueType |
The scalar value type.
| typedef T& CDPL::Math::CMatrix< T, M, N >::Reference |
Mutable reference type to an element.
| typedef const T& CDPL::Math::CMatrix< T, M, N >::ConstReference |
Constant reference type to an element.
| typedef std::size_t CDPL::Math::CMatrix< T, M, N >::SizeType |
The unsigned size type.
| typedef std::ptrdiff_t CDPL::Math::CMatrix< T, M, N >::DifferenceType |
The signed difference type.
| typedef ValueType CDPL::Math::CMatrix< T, M, N >::ArrayType[M][N] |
The fixed-size 2D C-array type used for in-memory storage of M \( \times \) N elements.
| typedef T(* CDPL::Math::CMatrix< T, M, N >::ArrayPointer)[N] |
Pointer-to-row type for raw access to the element array.
| typedef const T(* CDPL::Math::CMatrix< T, M, N >::ConstArrayPointer)[N] |
Constant pointer-to-row type for raw access to the element array.
| typedef T* CDPL::Math::CMatrix< T, M, N >::Pointer |
Pointer type to a single element.
| typedef const T* CDPL::Math::CMatrix< T, M, N >::ConstPointer |
Constant pointer type to a single element.
| typedef MatrixReference<SelfType> CDPL::Math::CMatrix< T, M, N >::ClosureType |
Closure type used when this matrix appears inside another expression.
| typedef const MatrixReference<const SelfType> CDPL::Math::CMatrix< T, M, N >::ConstClosureType |
Constant closure type used when this matrix appears inside another expression.
| typedef BoundedMatrix<T, M, N> CDPL::Math::CMatrix< T, M, N >::MatrixTemporaryType |
Concrete temporary matrix type used by expression-template machinery (a Math::BoundedMatrix of equal capacity).
| typedef BoundedVector<T, M * N> CDPL::Math::CMatrix< T, M, N >::VectorTemporaryType |
Concrete temporary vector type used when assembling vectors from this matrix.
| typedef std::shared_ptr<SelfType> CDPL::Math::CMatrix< T, M, N >::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated CMatrix instances.
| typedef std::initializer_list<std::initializer_list<T> > CDPL::Math::CMatrix< T, M, N >::InitializerListType |
The initializer-list-of-rows type accepted by constructors and assignment.
|
inline |
Constructs a zero-initialized \( M \times N \) matrix.
|
inlineexplicit |
Constructs an \( M \times N \) matrix with every element initialized to v.
| v | The initial element value. |
|
inline |
Constructs a copy of the fixed-size matrix m.
| m | The fixed-size matrix to copy. |
|
inline |
Constructs a fixed-size matrix with the contents of the initializer list of rows l.
| l | The initializer list of rows (clipped or zero-padded to M \( \times \) N). |
|
inline |
Constructs a fixed-size matrix from the matrix expression e.
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Returns a mutable reference to the element at (i, j).
| i | The zero-based row index. |
| j | The zero-based column index. |
| Base::IndexError | if either index is out of range. |
|
inline |
Returns a const reference to the element at (i, j).
| i | The zero-based row index. |
| j | The zero-based column index. |
const reference to the element. | Base::IndexError | if either index is out of range. |
|
inline |
Tells whether the matrix is empty (M or N is zero).
true if either M or N is zero, and false otherwise.
|
inline |
Returns the fixed row count M.
|
inline |
Returns the fixed column count N.
|
inline |
Returns the fixed row count M (capacity equals size for Math::CMatrix).
|
inline |
Returns the fixed column count N (capacity equals size for Math::CMatrix).
|
inline |
Returns a mutable pointer-to-row to the contiguous 2D element array.
|
inline |
Returns a const pointer-to-row to the contiguous 2D element array.
const array pointer.
|
inline |
Copy-assigns the elements of m to this fixed-size matrix.
| m | The source fixed-size matrix. |
|
inline |
Assigns the contents of the matrix container c to this fixed-size matrix (no alias check needed).
| C | The source matrix container type. |
| c | The source matrix container. |
|
inline |
Assigns the rows in l to this fixed-size matrix (clipped or zero-padded to M \( \times \) N).
| l | The initializer list of rows. |
|
inline |
Assigns the matrix expression e to this fixed-size matrix (via a temporary to handle aliasing).
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Adds the contents of the matrix container c element-wise to this fixed-size matrix (no alias check needed).
| C | The source matrix container type. |
| c | The source matrix container. |
|
inline |
Adds the rows in l element-wise to this fixed-size matrix.
| l | The initializer list of rows providing the addends. |
|
inline |
Adds the matrix expression e element-wise to this fixed-size matrix (via a temporary to handle aliasing).
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Subtracts the contents of the matrix container c element-wise from this fixed-size matrix (no alias check needed).
| C | The source matrix container type. |
| c | The source matrix container. |
|
inline |
Subtracts the rows in l element-wise from this fixed-size matrix.
| l | The initializer list of rows providing the subtrahends. |
|
inline |
Subtracts the matrix expression e element-wise from this fixed-size matrix (via a temporary to handle aliasing).
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Multiplies every element by the scalar t.
| T1 | The scalar type. |
| t | The scalar multiplier. |
|
inline |
Divides every element by the scalar t.
| T1 | The scalar type. |
| t | The scalar divisor. |
|
inline |
Assigns the elements of the matrix expression e to this fixed-size matrix without intermediate temporary.
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Assigns the rows in l to this fixed-size matrix (clipped or zero-padded to M \( \times \) N).
| l | The initializer list of rows. |
| Base::SizeError | if l.size() exceeds M or any row's size exceeds N. |
|
inline |
Adds the elements of the matrix expression e to this matrix without intermediate temporary.
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Adds the rows in l element-wise to this matrix without intermediate temporary.
| l | The initializer list of rows providing the addends. |
|
inline |
Subtracts the elements of the matrix expression e from this matrix without intermediate temporary.
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Subtracts the rows in l element-wise from this matrix without intermediate temporary.
| l | The initializer list of rows providing the subtrahends. |
|
inline |
Swaps the contents of this fixed-size matrix with those of m.
| m | The fixed-size matrix to swap with. |
|
inline |
Sets every element of the matrix to the value v.
| v | The fill value. |
|
friend |
ADL-enabled free-function form of swap().
| m1 | The first fixed-size matrix. |
| m2 | The second fixed-size matrix. |
|
static |
The compile-time fixed row count M.
|
static |
The compile-time fixed column count N.