![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Matrix-expression proxy that views a strided rectangular slice of an underlying matrix. More...
#include <MatrixProxy.hpp>
Inheritance diagram for CDPL::Math::MatrixSlice< M >:Public Types | |
| typedef M | MatrixType |
| The wrapped matrix type. More... | |
| typedef M::SizeType | SizeType |
| The size type used by the wrapped matrix. More... | |
| typedef M::DifferenceType | DifferenceType |
| The signed difference type used by the wrapped matrix. More... | |
| typedef M::ValueType | ValueType |
| The element value type of the wrapped matrix. More... | |
| typedef M::ConstReference | ConstReference |
| Constant reference type to an element. More... | |
| typedef std::conditional< std::is_const< M >::value, typename M::ConstReference, typename M::Reference >::type | Reference |
Mutable reference type (degrades to ConstReference when the wrapped matrix is const). More... | |
| typedef std::conditional< std::is_const< M >::value, typename M::ConstClosureType, typename M::ClosureType >::type | MatrixClosureType |
| Closure type used to store the wrapped matrix internally. More... | |
| typedef const SelfType | ConstClosureType |
| Constant closure type used when this proxy appears inside another expression. More... | |
| typedef SelfType | ClosureType |
| Closure type used when this proxy appears inside another expression. More... | |
| typedef Slice< SizeType, DifferenceType > | SliceType |
| Slice type used to specify the row and column slices (start, stride, size). More... | |
Public Types inherited from CDPL::Math::MatrixExpression< MatrixSlice< M > > | |
| typedef MatrixSlice< M > | 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 | |
| MatrixSlice (MatrixType &m, const SliceType &s1, const SliceType &s2) | |
| Constructs the matrix slice proxy viewing rows in s1 and columns in s2 of m. More... | |
| Reference | operator() (SizeType i, SizeType j) |
| Returns a mutable reference to the element at proxy index (i, j). More... | |
| ConstReference | operator() (SizeType i, SizeType j) const |
Returns a const reference to the element at proxy index (i, j). More... | |
| SizeType | getStart1 () const |
| Returns the row slice's start index in the wrapped matrix. More... | |
| SizeType | getStart2 () const |
| Returns the column slice's start index in the wrapped matrix. More... | |
| DifferenceType | getStride1 () const |
| Returns the row slice's stride in the wrapped matrix. More... | |
| DifferenceType | getStride2 () const |
| Returns the column slice's stride in the wrapped matrix. More... | |
| SizeType | getSize1 () const |
| Returns the number of rows in the proxy (size of the row slice). More... | |
| SizeType | getSize2 () const |
| Returns the number of columns in the proxy (size of the column slice). More... | |
| bool | isEmpty () const |
| Tells whether the proxy is empty (either slice has size zero). More... | |
| MatrixClosureType & | getData () |
| Returns a reference to the wrapped matrix (via its stored closure). More... | |
| const MatrixClosureType & | getData () const |
Returns a const reference to the wrapped matrix (via its stored closure). More... | |
| MatrixSlice & | operator= (const MatrixSlice &s) |
| Copy-assigns the contents of s to this matrix slice (via a temporary to handle aliasing). More... | |
| template<typename E > | |
| MatrixSlice & | operator= (const MatrixExpression< E > &e) |
| Assigns the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing). More... | |
| template<typename E > | |
| MatrixSlice & | operator+= (const MatrixExpression< E > &e) |
| Adds the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing). More... | |
| template<typename E > | |
| MatrixSlice & | operator-= (const MatrixExpression< E > &e) |
| Subtracts the elements of the matrix expression e from this matrix slice (via a temporary to handle aliasing). More... | |
| template<typename T > | |
| std::enable_if< IsScalar< T >::value, MatrixSlice >::type & | operator*= (const T &t) |
| Multiplies every element of this matrix slice by the scalar t. More... | |
| template<typename T > | |
| std::enable_if< IsScalar< T >::value, MatrixSlice >::type & | operator/= (const T &t) |
| Divides every element of this matrix slice by the scalar t. More... | |
| template<typename E > | |
| MatrixSlice & | assign (const MatrixExpression< E > &e) |
| Assigns the elements of the matrix expression e to this matrix slice without intermediate temporary. More... | |
| template<typename E > | |
| MatrixSlice & | plusAssign (const MatrixExpression< E > &e) |
| Adds the elements of the matrix expression e to this matrix slice without intermediate temporary. More... | |
| template<typename E > | |
| MatrixSlice & | minusAssign (const MatrixExpression< E > &e) |
| Subtracts the elements of the matrix expression e from this matrix slice without intermediate temporary. More... | |
| void | swap (MatrixSlice &s) |
| Swaps the contents of this matrix slice with those of s (via element-wise swap of the underlying matrix elements). More... | |
Public Member Functions inherited from CDPL::Math::MatrixExpression< MatrixSlice< M > > | |
| 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... | |
Friends | |
| void | swap (MatrixSlice &s1, MatrixSlice &s2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::MatrixExpression< MatrixSlice< M > > | |
| MatrixExpression () | |
| ~MatrixExpression () | |
Protected Member Functions inherited from CDPL::Math::Expression< E > | |
| Expression () | |
| ~Expression () | |
Matrix-expression proxy that views a strided rectangular slice of an underlying matrix.
| M | The wrapped matrix type. |
| typedef M CDPL::Math::MatrixSlice< M >::MatrixType |
The wrapped matrix type.
| typedef M::SizeType CDPL::Math::MatrixSlice< M >::SizeType |
The size type used by the wrapped matrix.
| typedef M::DifferenceType CDPL::Math::MatrixSlice< M >::DifferenceType |
The signed difference type used by the wrapped matrix.
| typedef M::ValueType CDPL::Math::MatrixSlice< M >::ValueType |
The element value type of the wrapped matrix.
| typedef M::ConstReference CDPL::Math::MatrixSlice< M >::ConstReference |
Constant reference type to an element.
| typedef std::conditional<std::is_const<M>::value, typename M::ConstReference, typename M::Reference>::type CDPL::Math::MatrixSlice< M >::Reference |
Mutable reference type (degrades to ConstReference when the wrapped matrix is const).
| typedef std::conditional<std::is_const<M>::value, typename M::ConstClosureType, typename M::ClosureType>::type CDPL::Math::MatrixSlice< M >::MatrixClosureType |
Closure type used to store the wrapped matrix internally.
| typedef const SelfType CDPL::Math::MatrixSlice< M >::ConstClosureType |
Constant closure type used when this proxy appears inside another expression.
| typedef SelfType CDPL::Math::MatrixSlice< M >::ClosureType |
Closure type used when this proxy appears inside another expression.
| typedef Slice<SizeType, DifferenceType> CDPL::Math::MatrixSlice< M >::SliceType |
Slice type used to specify the row and column slices (start, stride, size).
|
inline |
Constructs the matrix slice proxy viewing rows in s1 and columns in s2 of m.
| m | The wrapped matrix. |
| s1 | The row slice (start, stride, size). |
| s2 | The column slice (start, stride, size). |
|
inline |
Returns a mutable reference to the element at proxy index (i, j).
| i | The zero-based proxy row index. |
| j | The zero-based proxy column index. |
m(s1(i), s2(j)).
|
inline |
Returns a const reference to the element at proxy index (i, j).
| i | The zero-based proxy row index. |
| j | The zero-based proxy column index. |
const reference to the underlying element m(s1(i), s2(j)).
|
inline |
Returns the row slice's start index in the wrapped matrix.
|
inline |
Returns the column slice's start index in the wrapped matrix.
|
inline |
Returns the row slice's stride in the wrapped matrix.
|
inline |
Returns the column slice's stride in the wrapped matrix.
|
inline |
Returns the number of rows in the proxy (size of the row slice).
|
inline |
Returns the number of columns in the proxy (size of the column slice).
|
inline |
Tells whether the proxy is empty (either slice has size zero).
true if either slice has zero size, and false otherwise.
|
inline |
Returns a reference to the wrapped matrix (via its stored closure).
|
inline |
Returns a const reference to the wrapped matrix (via its stored closure).
const reference to the wrapped matrix closure.
|
inline |
Copy-assigns the contents of s to this matrix slice (via a temporary to handle aliasing).
| s | The source matrix slice. |
|
inline |
Assigns the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing).
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Adds the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing).
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Subtracts the elements of the matrix expression e from this matrix slice (via a temporary to handle aliasing).
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Multiplies every element of this matrix slice by the scalar t.
| T | The scalar type. |
| t | The scalar multiplier. |
|
inline |
Divides every element of this matrix slice by the scalar t.
| T | The scalar type. |
| t | The scalar divisor. |
|
inline |
Assigns the elements of the matrix expression e to this matrix slice without intermediate temporary.
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Adds the elements of the matrix expression e to this matrix slice without intermediate temporary.
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Subtracts the elements of the matrix expression e from this matrix slice without intermediate temporary.
| E | The source matrix expression type. |
| e | The source matrix expression. |
|
inline |
Swaps the contents of this matrix slice with those of s (via element-wise swap of the underlying matrix elements).
| s | The matrix slice to swap with. |
|
friend |
ADL-enabled free-function form of swap().
| s1 | The first matrix slice. |
| s2 | The second matrix slice. |