![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Variable-size matrix with fixed upper capacities M \( \times \) N stored in a stack-allocated array. More...
#include <Matrix.hpp>
Inheritance diagram for CDPL::Math::BoundedMatrix< 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-capacity 2D C-array type used for in-memory storage. 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 SelfType | MatrixTemporaryType |
| Concrete temporary matrix type used by expression-template machinery. More... | |
| typedef BoundedVector< T, M *N > | VectorTemporaryType |
| Concrete temporary vector type used when assembling vectors from this matrix (a bounded vector of capacity M * N). More... | |
| typedef std::shared_ptr< SelfType > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated BoundedMatrix 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< BoundedMatrix< T, M, N > > | |
| typedef BoundedMatrix< 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 | |
| BoundedMatrix () | |
| Constructs an empty bounded matrix (zero rows, zero columns). More... | |
| BoundedMatrix (SizeType m, SizeType n) | |
| Constructs a bounded matrix of size \( m \times n \) with value-initialized elements. More... | |
| BoundedMatrix (SizeType m, SizeType n, const ValueType &v) | |
| Constructs a bounded matrix of size \( m \times n \) with every element initialized to v. More... | |
| BoundedMatrix (const BoundedMatrix &m) | |
| Constructs a copy of the bounded matrix m. More... | |
| BoundedMatrix (InitializerListType l) | |
| Constructs a bounded matrix from the initializer list of rows l. More... | |
| template<typename E > | |
| BoundedMatrix (const MatrixExpression< E > &e) | |
| Constructs a bounded 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. More... | |
| SizeType | getSize1 () const |
| Returns the current row count. More... | |
| SizeType | getSize2 () const |
| Returns the current column count. More... | |
| SizeType | getMaxSize1 () const |
| Returns the compile-time maximum row count M. More... | |
| SizeType | getMaxSize2 () const |
| Returns the compile-time maximum column count N. 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... | |
| BoundedMatrix & | operator= (const BoundedMatrix &m) |
| Copy-assigns the elements of m to this bounded matrix. More... | |
| template<typename C > | |
| BoundedMatrix & | operator= (const MatrixContainer< C > &c) |
| Assigns the contents of the matrix container c to this bounded matrix (no alias check needed). More... | |
| BoundedMatrix & | operator= (InitializerListType l) |
| Assigns the rows in l to this bounded matrix (resizes to match, respecting the bounds). More... | |
| template<typename E > | |
| BoundedMatrix & | operator= (const MatrixExpression< E > &e) |
| Assigns the matrix expression e to this bounded matrix (via a temporary to handle aliasing). More... | |
| template<typename C > | |
| BoundedMatrix & | operator+= (const MatrixContainer< C > &c) |
| Adds the contents of the matrix container c element-wise to this bounded matrix (no alias check needed). More... | |
| BoundedMatrix & | operator+= (InitializerListType l) |
| Adds the rows in l element-wise to this bounded matrix. More... | |
| template<typename E > | |
| BoundedMatrix & | operator+= (const MatrixExpression< E > &e) |
| Adds the matrix expression e element-wise to this bounded matrix (via a temporary to handle aliasing). More... | |
| template<typename C > | |
| BoundedMatrix & | operator-= (const MatrixContainer< C > &c) |
| Subtracts the contents of the matrix container c element-wise from this bounded matrix (no alias check needed). More... | |
| BoundedMatrix & | operator-= (InitializerListType l) |
| Subtracts the rows in l element-wise from this bounded matrix. More... | |
| template<typename E > | |
| BoundedMatrix & | operator-= (const MatrixExpression< E > &e) |
| Subtracts the matrix expression e element-wise from this bounded matrix (via a temporary to handle aliasing). More... | |
| template<typename T1 > | |
| std::enable_if< IsScalar< T1 >::value, BoundedMatrix >::type & | operator*= (const T1 &v) |
| Multiplies every element by the scalar v. More... | |
| template<typename T1 > | |
| std::enable_if< IsScalar< T1 >::value, BoundedMatrix >::type & | operator/= (const T1 &v) |
| Divides every element by the scalar v. More... | |
| template<typename E > | |
| BoundedMatrix & | assign (const MatrixExpression< E > &e) |
| Resizes this matrix to match e and assigns its elements without intermediate temporary. More... | |
| BoundedMatrix & | assign (InitializerListType l) |
| Resizes this matrix to match l and assigns its elements. More... | |
| template<typename E > | |
| BoundedMatrix & | plusAssign (const MatrixExpression< E > &e) |
| Adds the elements of the matrix expression e to this matrix without intermediate temporary. More... | |
| BoundedMatrix & | plusAssign (InitializerListType l) |
| Adds the rows in l element-wise to this matrix without intermediate temporary. More... | |
| template<typename E > | |
| BoundedMatrix & | minusAssign (const MatrixExpression< E > &e) |
| Subtracts the elements of the matrix expression e from this matrix without intermediate temporary. More... | |
| BoundedMatrix & | minusAssign (InitializerListType l) |
| Subtracts the rows in l element-wise from this matrix without intermediate temporary. More... | |
| void | swap (BoundedMatrix &m) |
| Swaps the contents of this bounded matrix with those of m. More... | |
| void | clear (const ValueType &v=ValueType()) |
| Sets every element of the matrix to the value v (dimensions unchanged). More... | |
| void | resize (SizeType m, SizeType n) |
| Resizes the matrix to \( m \times n \) elements (new elements are left value-uninitialized). More... | |
| void | resize (SizeType m, SizeType n, const ValueType &v) |
| Resizes the matrix to \( m \times n \) elements; newly added cells are set to v. More... | |
Public Member Functions inherited from CDPL::Math::MatrixContainer< BoundedMatrix< 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 | MaxSize1 = M |
| The compile-time maximum number of rows M. More... | |
| static const SizeType | MaxSize2 = N |
| The compile-time maximum number of columns N. More... | |
Friends | |
| void | swap (BoundedMatrix &m1, BoundedMatrix &m2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::MatrixContainer< BoundedMatrix< 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 () | |
Variable-size matrix with fixed upper capacities M \( \times \) N stored in a stack-allocated array.
| T | The scalar value type. |
| M | The maximum number of rows. |
| N | The maximum number of columns. |
| typedef T CDPL::Math::BoundedMatrix< T, M, N >::ValueType |
The scalar value type.
| typedef T& CDPL::Math::BoundedMatrix< T, M, N >::Reference |
Mutable reference type to an element.
| typedef const T& CDPL::Math::BoundedMatrix< T, M, N >::ConstReference |
Constant reference type to an element.
| typedef std::size_t CDPL::Math::BoundedMatrix< T, M, N >::SizeType |
The unsigned size type.
| typedef std::ptrdiff_t CDPL::Math::BoundedMatrix< T, M, N >::DifferenceType |
The signed difference type.
| typedef ValueType CDPL::Math::BoundedMatrix< T, M, N >::ArrayType[M][N] |
The fixed-capacity 2D C-array type used for in-memory storage.
| typedef T(* CDPL::Math::BoundedMatrix< T, M, N >::ArrayPointer)[N] |
Pointer-to-row type for raw access to the element array.
| typedef const T(* CDPL::Math::BoundedMatrix< T, M, N >::ConstArrayPointer)[N] |
Constant pointer-to-row type for raw access to the element array.
| typedef T* CDPL::Math::BoundedMatrix< T, M, N >::Pointer |
Pointer type to a single element.
| typedef const T* CDPL::Math::BoundedMatrix< T, M, N >::ConstPointer |
Constant pointer type to a single element.
| typedef MatrixReference<SelfType> CDPL::Math::BoundedMatrix< T, M, N >::ClosureType |
Closure type used when this matrix appears inside another expression.
| typedef const MatrixReference<const SelfType> CDPL::Math::BoundedMatrix< T, M, N >::ConstClosureType |
Constant closure type used when this matrix appears inside another expression.
| typedef SelfType CDPL::Math::BoundedMatrix< T, M, N >::MatrixTemporaryType |
Concrete temporary matrix type used by expression-template machinery.
| typedef BoundedVector<T, M * N> CDPL::Math::BoundedMatrix< T, M, N >::VectorTemporaryType |
Concrete temporary vector type used when assembling vectors from this matrix (a bounded vector of capacity M * N).
| typedef std::shared_ptr<SelfType> CDPL::Math::BoundedMatrix< T, M, N >::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated BoundedMatrix instances.
| typedef std::initializer_list<std::initializer_list<T> > CDPL::Math::BoundedMatrix< T, M, N >::InitializerListType |
The initializer-list-of-rows type accepted by constructors and assignment.
|
inline |
Constructs an empty bounded matrix (zero rows, zero columns).
|
inline |
Constructs a bounded matrix of size \( m \times n \) with value-initialized elements.
| m | The initial row count. |
| n | The initial column count. |
| Base::SizeError | if m exceeds the bound M or n exceeds N. |
|
inline |
Constructs a bounded matrix of size \( m \times n \) with every element initialized to v.
| m | The initial row count. |
| n | The initial column count. |
| v | The initial element value. |
| Base::SizeError | if m exceeds the bound M or n exceeds N. |
|
inline |
Constructs a copy of the bounded matrix m.
| m | The bounded matrix to copy. |
|
inline |
Constructs a bounded matrix from the initializer list of rows l.
| l | The initializer list of rows. |
| Base::SizeError | if the dimensions of l exceed the bounds M, N. |
|
inline |
Constructs a bounded matrix from the matrix expression e.
| E | The source matrix expression type. |
| e | The source matrix expression. |
| Base::SizeError | if the dimensions of e exceed the bounds M, N. |
|
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.
true if either dimension is zero, and false otherwise.
|
inline |
Returns the current row count.
|
inline |
Returns the current column count.
|
inline |
Returns the compile-time maximum row count M.
|
inline |
Returns the compile-time maximum column count N.
|
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 bounded matrix.
| m | The source bounded matrix. |
|
inline |
Assigns the contents of the matrix container c to this bounded matrix (no alias check needed).
| C | The source matrix container type. |
| c | The source matrix container. |
|
inline |
Assigns the rows in l to this bounded matrix (resizes to match, respecting the bounds).
| l | The initializer list of rows. |
| Base::SizeError | if the dimensions of l exceed the bounds M, N. |
|
inline |
Assigns the matrix expression e to this bounded matrix (via a temporary to handle aliasing).
| E | The source matrix expression type. |
| e | The source matrix expression. |
| Base::SizeError | if the dimensions of e exceed the bounds M, N. |
|
inline |
Adds the contents of the matrix container c element-wise to this bounded 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 bounded matrix.
| l | The initializer list of rows providing the addends. |
|
inline |
Adds the matrix expression e element-wise to this bounded 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 bounded 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 bounded matrix.
| l | The initializer list of rows providing the subtrahends. |
|
inline |
Subtracts the matrix expression e element-wise from this bounded 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 v.
| T1 | The scalar type. |
| v | The scalar multiplier. |
|
inline |
Divides every element by the scalar v.
| T1 | The scalar type. |
| v | The scalar divisor. |
|
inline |
Resizes this matrix to match e and assigns its elements without intermediate temporary.
| E | The source matrix expression type. |
| e | The source matrix expression. |
| Base::SizeError | if the dimensions of e exceed the bounds M, N. |
|
inline |
Resizes this matrix to match l and assigns its elements.
| l | The initializer list of rows providing the new elements. |
| Base::SizeError | if the dimensions of l exceed the bounds M, 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 bounded matrix with those of m.
| m | The bounded matrix to swap with. |
|
inline |
Sets every element of the matrix to the value v (dimensions unchanged).
| v | The fill value. |
|
inline |
Resizes the matrix to \( m \times n \) elements (new elements are left value-uninitialized).
| m | The new row count. |
| n | The new column count. |
| Base::SizeError | if m exceeds M or n exceeds N. |
|
inline |
Resizes the matrix to \( m \times n \) elements; newly added cells are set to v.
| m | The new row count. |
| n | The new column count. |
| v | The fill value for newly added cells. |
| Base::SizeError | if m exceeds M or n exceeds N. |
|
friend |
ADL-enabled free-function form of swap().
| m1 | The first bounded matrix. |
| m2 | The second bounded matrix. |
|
static |
The compile-time maximum number of rows M.
|
static |
The compile-time maximum number of columns N.