![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Dynamically-sized dense row-major matrix with configurable underlying storage. More...
#include <Matrix.hpp>
Inheritance diagram for CDPL::Math::Matrix< T, A >:Public Types | |
| typedef T | ValueType |
| The scalar value type stored in the matrix. More... | |
| typedef T & | Reference |
| Mutable element reference type. More... | |
| typedef const T & | ConstReference |
| Constant element reference type. More... | |
| typedef A::size_type | SizeType |
| The unsigned size type used by the underlying storage container. More... | |
| typedef A::difference_type | DifferenceType |
| The signed difference type used by the underlying storage container. More... | |
| typedef A | ArrayType |
| The underlying storage container type (row-major linear storage). More... | |
| typedef T * | Pointer |
| Pointer type for raw element access. More... | |
| typedef const T * | ConstPointer |
| Constant pointer type for raw element access. 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 Vector< T, A > | VectorTemporaryType |
| Concrete temporary vector type compatible with this matrix's value type and storage. More... | |
| typedef std::shared_ptr< SelfType > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated Matrix instances. More... | |
| typedef std::initializer_list< std::initializer_list< T > > | InitializerListType |
| Type of the brace-initializer list of lists accepted by the corresponding constructor (one inner list per row). More... | |
Public Types inherited from CDPL::Math::MatrixContainer< Matrix< T, std::vector< T > > > | |
| typedef Matrix< T, std::vector< T > > | 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. More... | |
Public Member Functions | |
| Matrix () | |
| Constructs an empty matrix (zero rows and zero columns). More... | |
| Matrix (SizeType m, SizeType n) | |
| Constructs an m×n matrix with default-initialized elements. More... | |
| Matrix (SizeType m, SizeType n, const ValueType &v) | |
| Constructs an m×n matrix with every element initialized to v. More... | |
| Matrix (const Matrix &m) | |
| Constructs a copy of the matrix m. More... | |
| Matrix (Matrix &&m) | |
| Move-constructs a matrix from m (m is left in a valid empty state). More... | |
| Matrix (InitializerListType l) | |
| Constructs the matrix from a brace-initializer list of rows. More... | |
| template<typename E > | |
| Matrix (const MatrixExpression< E > &e) | |
| Constructs the matrix from the matrix expression e (materializing the expression result). 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 number of rows. More... | |
| SizeType | getSize2 () const |
| Returns the number of columns. More... | |
| SizeType | getMaxSize () const |
| Returns the maximum total element count the underlying storage container can hold. More... | |
| ArrayType & | getData () |
| Returns a mutable reference to the underlying storage container (row-major linear layout). More... | |
| const ArrayType & | getData () const |
Returns a const reference to the underlying storage container (row-major linear layout). More... | |
| Matrix & | operator= (const Matrix &m) |
| Copy-assigns the contents of m to this matrix. More... | |
| Matrix & | operator= (Matrix &&m) |
| Move-assigns the contents of m to this matrix. More... | |
| template<typename C > | |
| Matrix & | operator= (const MatrixContainer< C > &c) |
| Assigns the contents of the matrix container c to this matrix (no alias check needed). More... | |
| Matrix & | operator= (InitializerListType l) |
| Assigns the rows in l to this matrix (resizes to match). More... | |
| template<typename E > | |
| Matrix & | operator= (const MatrixExpression< E > &e) |
| Assigns the matrix expression e to this matrix (via a temporary to handle aliasing). More... | |
| template<typename C > | |
| Matrix & | operator+= (const MatrixContainer< C > &c) |
| Adds the contents of the matrix container c element-wise to this matrix (no alias check needed). More... | |
| Matrix & | operator+= (InitializerListType l) |
| Adds the rows in l element-wise to this matrix. More... | |
| template<typename E > | |
| Matrix & | operator+= (const MatrixExpression< E > &e) |
| Adds the matrix expression e element-wise to this matrix (via a temporary to handle aliasing). More... | |
| template<typename C > | |
| Matrix & | operator-= (const MatrixContainer< C > &c) |
| Subtracts the contents of the matrix container c element-wise from this matrix (no alias check needed). More... | |
| Matrix & | operator-= (InitializerListType l) |
| Subtracts the rows in l element-wise from this matrix. More... | |
| template<typename E > | |
| Matrix & | operator-= (const MatrixExpression< E > &e) |
| Subtracts the matrix expression e element-wise from this matrix (via a temporary to handle aliasing). More... | |
| template<typename T1 > | |
| std::enable_if< IsScalar< T1 >::value, Matrix >::type & | operator*= (const T1 &t) |
| Multiplies every element by the scalar t. More... | |
| template<typename T1 > | |
| std::enable_if< IsScalar< T1 >::value, Matrix >::type & | operator/= (const T1 &t) |
| Divides every element by the scalar t. More... | |
| template<typename E > | |
| Matrix & | assign (const MatrixExpression< E > &e) |
| Resizes this matrix to match the dimensions of e and assigns its elements (without intermediate temporary). More... | |
| Matrix & | assign (InitializerListType l) |
| Resizes this matrix to match l and assigns its elements. More... | |
| template<typename E > | |
| Matrix & | plusAssign (const MatrixExpression< E > &e) |
| Adds the elements of the matrix expression e to this matrix without intermediate temporary. More... | |
| Matrix & | plusAssign (InitializerListType l) |
| Adds the rows in l element-wise to this matrix without intermediate temporary. More... | |
| template<typename E > | |
| Matrix & | minusAssign (const MatrixExpression< E > &e) |
| Subtracts the elements of the matrix expression e from this matrix without intermediate temporary. More... | |
| Matrix & | minusAssign (InitializerListType l) |
| Subtracts the rows in l element-wise from this matrix without intermediate temporary. More... | |
| void | swap (Matrix &m) |
| Swaps the contents of this matrix with those of m. More... | |
| void | clear (const ValueType &v=ValueType()) |
| Sets every element of the matrix to the value v. More... | |
| void | resize (SizeType m, SizeType n, bool preserve=true, const ValueType &v=ValueType()) |
| Resizes the matrix to m×n elements. More... | |
Public Member Functions inherited from CDPL::Math::MatrixContainer< Matrix< T, std::vector< T > > > | |
| const ContainerType & | operator() () const |
Returns a const reference to the derived matrix container class instance. More... | |
| ContainerType & | operator() () |
| Returns a reference to the derived matrix container class instance. More... | |
Public Member Functions inherited from CDPL::Math::MatrixExpression< E > | |
| const ExpressionType & | operator() () const |
Returns a const reference to the derived matrix expression class instance. More... | |
| ExpressionType & | operator() () |
| Returns a reference to the derived matrix expression class instance. More... | |
Friends | |
| void | swap (Matrix &m1, Matrix &m2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::MatrixContainer< Matrix< T, std::vector< T > > > | |
| MatrixContainer () | |
| ~MatrixContainer () | |
Protected Member Functions inherited from CDPL::Math::MatrixExpression< E > | |
| MatrixExpression () | |
| ~MatrixExpression () | |
Protected Member Functions inherited from CDPL::Math::Expression< E > | |
| Expression () | |
| ~Expression () | |
Dynamically-sized dense row-major matrix with configurable underlying storage.
| T | The scalar value type. |
| A | The underlying storage container type (default: std::vector). |
| typedef T CDPL::Math::Matrix< T, A >::ValueType |
The scalar value type stored in the matrix.
| typedef T& CDPL::Math::Matrix< T, A >::Reference |
Mutable element reference type.
| typedef const T& CDPL::Math::Matrix< T, A >::ConstReference |
Constant element reference type.
| typedef A::size_type CDPL::Math::Matrix< T, A >::SizeType |
The unsigned size type used by the underlying storage container.
| typedef A::difference_type CDPL::Math::Matrix< T, A >::DifferenceType |
The signed difference type used by the underlying storage container.
| typedef A CDPL::Math::Matrix< T, A >::ArrayType |
The underlying storage container type (row-major linear storage).
| typedef T* CDPL::Math::Matrix< T, A >::Pointer |
Pointer type for raw element access.
| typedef const T* CDPL::Math::Matrix< T, A >::ConstPointer |
Constant pointer type for raw element access.
| typedef MatrixReference<SelfType> CDPL::Math::Matrix< T, A >::ClosureType |
Closure type used when this matrix appears inside another expression.
| typedef const MatrixReference<const SelfType> CDPL::Math::Matrix< T, A >::ConstClosureType |
Constant closure type used when this matrix appears inside another expression.
| typedef SelfType CDPL::Math::Matrix< T, A >::MatrixTemporaryType |
Concrete temporary matrix type used by expression template machinery.
| typedef Vector<T, A> CDPL::Math::Matrix< T, A >::VectorTemporaryType |
Concrete temporary vector type compatible with this matrix's value type and storage.
| typedef std::shared_ptr<SelfType> CDPL::Math::Matrix< T, A >::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated Matrix instances.
| typedef std::initializer_list<std::initializer_list<T> > CDPL::Math::Matrix< T, A >::InitializerListType |
Type of the brace-initializer list of lists accepted by the corresponding constructor (one inner list per row).
|
inline |
Constructs an empty matrix (zero rows and zero columns).
|
inline |
Constructs an m×n matrix with default-initialized elements.
| m | The number of rows. |
| n | The number of columns. |
|
inline |
Constructs an m×n matrix with every element initialized to v.
| m | The number of rows. |
| n | The number of columns. |
| v | The value used for element initialization. |
|
inline |
Constructs a copy of the matrix m.
| m | The matrix to copy. |
|
inline |
Move-constructs a matrix from m (m is left in a valid empty state).
| m | The matrix to move from. |
|
inline |
Constructs the matrix from a brace-initializer list of rows.
The outer list yields the rows andeach inner list yields the row elements. The size is derived from the dimensions of the supplied initializer (all inner lists must have the same length).
| l | The initializer list of rows. |
|
inline |
Constructs the matrix from the matrix expression e (materializing the expression result).
| E | The matrix expression type. |
| e | The matrix expression to materialize. |
|
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 the underlying storage holds no elements, and false otherwise.
|
inline |
Returns the number of rows.
|
inline |
Returns the number of columns.
|
inline |
Returns the maximum total element count the underlying storage container can hold.
|
inline |
Returns a mutable reference to the underlying storage container (row-major linear layout).
|
inline |
Returns a const reference to the underlying storage container (row-major linear layout).
const reference to the storage container.
|
inline |
Copy-assigns the contents of m to this matrix.
| m | The source matrix. |
|
inline |
Move-assigns the contents of m to this matrix.
| m | The source matrix (left in a valid but unspecified state). |
|
inline |
Assigns the contents of the matrix container c to this matrix (no alias check needed).
| C | The source matrix container type. |
| c | The source matrix container. |
|
inline |
Assigns the rows in l to this matrix (resizes to match).
| l | The initializer list of rows. |
|
inline |
Assigns the matrix expression e to this 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 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 matrix.
| l | The initializer list of rows providing the addends. |
|
inline |
Adds the matrix expression e element-wise to this 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 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 matrix.
| l | The initializer list of rows providing the subtrahends. |
|
inline |
Subtracts the matrix expression e element-wise from this 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 |
Resizes this matrix to match the dimensions of e and assigns its elements (without intermediate temporary).
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Resizes this matrix to match l and assigns its elements.
| l | The initializer list of rows providing the new elements. |
|
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 matrix with those of m.
| m | The matrix to swap with. |
|
inline |
Sets every element of the matrix to the value v.
| v | The fill value. |
|
inline |
Resizes the matrix to m×n elements.
| m | The new row count. |
| n | The new column count. |
| preserve | If true, existing element values at indices that remain valid are kept. If false, all elements are set to v. |
| v | The fill value for newly added elements (or for all elements when preserve is false). |
|
friend |
ADL-enabled free-function form of swap().
| m1 | The first matrix. |
| m2 | The second matrix. |