![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Lightweight grid expression that proxies a reference to an underlying grid container. More...
#include <Grid.hpp>
Inheritance diagram for CDPL::Math::GridReference< G >:Public Types | |
| typedef G | GridType |
| The wrapped grid type. More... | |
| typedef G::ValueType | ValueType |
| The element value type of the wrapped grid. More... | |
| typedef std::conditional< std::is_const< G >::value, typename G::ConstReference, typename G::Reference >::type | Reference |
Mutable reference type (degrades to ConstReference when the wrapped grid is const). More... | |
| typedef G::ConstReference | ConstReference |
| Constant reference type to an element. More... | |
| typedef G::SizeType | SizeType |
| The unsigned size type used by the wrapped grid. More... | |
| typedef G::DifferenceType | DifferenceType |
| The signed difference type used by the wrapped grid. More... | |
| typedef SelfType | ClosureType |
| Closure type used when this reference appears inside another expression. More... | |
| typedef const SelfType | ConstClosureType |
| Constant closure type used when this reference appears inside another expression. More... | |
Public Types inherited from CDPL::Math::GridExpression< GridReference< G > > | |
| typedef GridReference< G > | ExpressionType |
| The derived grid 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 | |
| GridReference (GridType &g) | |
| Constructs the reference wrapping the grid g. More... | |
| Reference | operator() (SizeType i) |
| Returns a mutable reference to the element at the linear index i of the wrapped grid. More... | |
| ConstReference | operator() (SizeType i) const |
Returns a const reference to the element at the linear index i of the wrapped grid. More... | |
| Reference | operator() (SizeType i, SizeType j, SizeType k) |
| Returns a mutable reference to the element at the (i, j, k) cell of the wrapped grid. More... | |
| ConstReference | operator() (SizeType i, SizeType j, SizeType k) const |
Returns a const reference to the element at the (i, j, k) cell of the wrapped grid. More... | |
| SizeType | getSize () const |
| Returns the total number of cells of the wrapped grid. More... | |
| SizeType | getSize1 () const |
| Returns the size of the wrapped grid along the first dimension. More... | |
| SizeType | getSize2 () const |
| Returns the size of the wrapped grid along the second dimension. More... | |
| SizeType | getSize3 () const |
| Returns the size of the wrapped grid along the third dimension. More... | |
| SizeType | getMaxSize () const |
| Returns the maximum total number of cells the wrapped grid can hold. More... | |
| SizeType | getMaxSize1 () const |
| Returns the maximum size of the wrapped grid along the first dimension. More... | |
| SizeType | getMaxSize2 () const |
| Returns the maximum size of the wrapped grid along the second dimension. More... | |
| SizeType | getMaxSize3 () const |
| Returns the maximum size of the wrapped grid along the third dimension. More... | |
| bool | isEmpty () const |
| Tells whether the wrapped grid is empty (zero cells along any dimension). More... | |
| const GridType & | getData () const |
Returns a const reference to the wrapped grid. More... | |
| GridType & | getData () |
| Returns a mutable reference to the wrapped grid. More... | |
| GridReference & | operator= (const GridReference &r) |
| Copies the cells of r into the wrapped grid. More... | |
| template<typename E > | |
| GridReference & | operator= (const GridExpression< E > &e) |
| Assigns the grid expression e to the wrapped grid. More... | |
| template<typename E > | |
| GridReference & | operator+= (const GridExpression< E > &e) |
| Adds the grid expression e cell-wise to the wrapped grid. More... | |
| template<typename E > | |
| GridReference & | operator-= (const GridExpression< E > &e) |
| Subtracts the grid expression e cell-wise from the wrapped grid. More... | |
| template<typename T > | |
| std::enable_if< IsScalar< T >::value, GridReference >::type & | operator*= (const T &t) |
| Multiplies every cell of the wrapped grid by the scalar t. More... | |
| template<typename T > | |
| std::enable_if< IsScalar< T >::value, GridReference >::type & | operator/= (const T &t) |
| Divides every cell of the wrapped grid by the scalar t. More... | |
| template<typename E > | |
| GridReference & | assign (const GridExpression< E > &e) |
| Assigns the grid expression e to the wrapped grid without intermediate temporary (use only when e does not alias the wrapped grid). More... | |
| template<typename E > | |
| GridReference & | plusAssign (const GridExpression< E > &e) |
| Adds the grid expression e to the wrapped grid without intermediate temporary. More... | |
| template<typename E > | |
| GridReference & | minusAssign (const GridExpression< E > &e) |
| Subtracts the grid expression e from the wrapped grid without intermediate temporary. More... | |
| void | swap (GridReference &r) |
| Swaps the contents of the wrapped grid with those of the grid wrapped by r. More... | |
Public Member Functions inherited from CDPL::Math::GridExpression< GridReference< G > > | |
| const ExpressionType & | operator() () const |
Returns a const reference to the derived grid expression. More... | |
| ExpressionType & | operator() () |
| Returns a reference to the derived grid expression. More... | |
Friends | |
| void | swap (GridReference &r1, GridReference &r2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::GridExpression< GridReference< G > > | |
| GridExpression () | |
| ~GridExpression () | |
Protected Member Functions inherited from CDPL::Math::Expression< E > | |
| Expression () | |
| ~Expression () | |
Lightweight grid expression that proxies a reference to an underlying grid container.
| G | The wrapped grid type. |
| typedef G CDPL::Math::GridReference< G >::GridType |
The wrapped grid type.
| typedef G::ValueType CDPL::Math::GridReference< G >::ValueType |
The element value type of the wrapped grid.
| typedef std::conditional<std::is_const<G>::value, typename G::ConstReference, typename G::Reference>::type CDPL::Math::GridReference< G >::Reference |
Mutable reference type (degrades to ConstReference when the wrapped grid is const).
| typedef G::ConstReference CDPL::Math::GridReference< G >::ConstReference |
Constant reference type to an element.
| typedef G::SizeType CDPL::Math::GridReference< G >::SizeType |
The unsigned size type used by the wrapped grid.
| typedef G::DifferenceType CDPL::Math::GridReference< G >::DifferenceType |
The signed difference type used by the wrapped grid.
| typedef SelfType CDPL::Math::GridReference< G >::ClosureType |
Closure type used when this reference appears inside another expression.
| typedef const SelfType CDPL::Math::GridReference< G >::ConstClosureType |
Constant closure type used when this reference appears inside another expression.
|
inlineexplicit |
Constructs the reference wrapping the grid g.
| g | The grid to wrap. |
|
inline |
Returns a mutable reference to the element at the linear index i of the wrapped grid.
| i | The zero-based linear index. |
|
inline |
Returns a const reference to the element at the linear index i of the wrapped grid.
| i | The zero-based linear index. |
const reference to the element.
|
inline |
Returns a mutable reference to the element at the (i, j, k) cell of the wrapped grid.
| i | The zero-based first-dimension index. |
| j | The zero-based second-dimension index. |
| k | The zero-based third-dimension index. |
|
inline |
Returns a const reference to the element at the (i, j, k) cell of the wrapped grid.
| i | The zero-based first-dimension index. |
| j | The zero-based second-dimension index. |
| k | The zero-based third-dimension index. |
const reference to the element.
|
inline |
Returns the total number of cells of the wrapped grid.
|
inline |
Returns the size of the wrapped grid along the first dimension.
|
inline |
Returns the size of the wrapped grid along the second dimension.
|
inline |
Returns the size of the wrapped grid along the third dimension.
|
inline |
Returns the maximum total number of cells the wrapped grid can hold.
|
inline |
Returns the maximum size of the wrapped grid along the first dimension.
|
inline |
Returns the maximum size of the wrapped grid along the second dimension.
|
inline |
Returns the maximum size of the wrapped grid along the third dimension.
|
inline |
Tells whether the wrapped grid is empty (zero cells along any dimension).
true if the wrapped grid is empty, and false otherwise.
|
inline |
Returns a const reference to the wrapped grid.
const reference to the wrapped grid.
|
inline |
Returns a mutable reference to the wrapped grid.
|
inline |
Copies the cells of r into the wrapped grid.
| r | The source reference. |
|
inline |
Assigns the grid expression e to the wrapped grid.
| E | The source grid expression type. |
| e | The source grid expression. |
|
inline |
Adds the grid expression e cell-wise to the wrapped grid.
| E | The source grid expression type. |
| e | The grid expression to add. |
|
inline |
Subtracts the grid expression e cell-wise from the wrapped grid.
| E | The source grid expression type. |
| e | The grid expression to subtract. |
|
inline |
Multiplies every cell of the wrapped grid by the scalar t.
| T | The scalar type. |
| t | The scalar multiplier. |
|
inline |
Divides every cell of the wrapped grid by the scalar t.
| T | The scalar type. |
| t | The scalar divisor. |
|
inline |
Assigns the grid expression e to the wrapped grid without intermediate temporary (use only when e does not alias the wrapped grid).
| E | The source grid expression type. |
| e | The source grid expression. |
|
inline |
Adds the grid expression e to the wrapped grid without intermediate temporary.
| E | The source grid expression type. |
| e | The source grid expression. |
|
inline |
Subtracts the grid expression e from the wrapped grid without intermediate temporary.
| E | The source grid expression type. |
| e | The source grid expression. |
|
inline |
Swaps the contents of the wrapped grid with those of the grid wrapped by r.
| r | The reference to swap with. |
|
friend |
ADL-enabled free-function form of swap().
| r1 | The first reference. |
| r2 | The second reference. |