![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Dynamically-sized dense 3D grid ( \( d_1 \times d_2 \times d_3 \)) with configurable underlying storage. More...
#include <Grid.hpp>
Inheritance diagram for CDPL::Math::Grid< T, A >:Public Types | |
| typedef T | ValueType |
| The scalar value type stored in the grid. More... | |
| typedef T & | Reference |
| Mutable reference type to an element. More... | |
| typedef const T & | ConstReference |
| Constant reference type to an element. 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. More... | |
| typedef T * | Pointer |
| Pointer type for raw element access. More... | |
| typedef const T * | ConstPointer |
| Constant pointer type for raw element access. More... | |
| typedef GridReference< SelfType > | ClosureType |
| Closure type used when this grid appears inside another expression. More... | |
| typedef const GridReference< const SelfType > | ConstClosureType |
| Constant closure type used when this grid appears inside another expression. More... | |
| typedef SelfType | GridTemporaryType |
| Concrete temporary grid type used by expression-template machinery. More... | |
| typedef std::shared_ptr< SelfType > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated Grid instances. More... | |
Public Types inherited from CDPL::Math::GridContainer< Grid< T, std::vector< T > > > | |
| typedef Grid< T, std::vector< T > > | ContainerType |
| The derived grid container type. More... | |
Public Types inherited from CDPL::Math::GridExpression< E > | |
| typedef E | 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 | |
| Grid () | |
| Constructs an empty grid (zero size on every axis). More... | |
| Grid (SizeType m, SizeType n, SizeType o) | |
| Constructs an m × n × o grid with default-initialized elements. More... | |
| Grid (SizeType m, SizeType n, SizeType o, const ValueType &v) | |
| Constructs an m × n × o grid with every element initialized to v. More... | |
| Grid (const Grid &g) | |
| Constructs a copy of the grid g. More... | |
| Grid (Grid &&g) | |
| Move-constructs a grid from g (g is left in a valid empty state). More... | |
| template<typename E > | |
| Grid (const GridExpression< E > &e) | |
| Constructs the grid from the grid expression e (materializing the expression result). More... | |
| Reference | operator() (SizeType i) |
| Returns a mutable reference to the element at linear index i. More... | |
| ConstReference | operator() (SizeType i) const |
Returns a const reference to the element at linear index i. More... | |
| Reference | operator() (SizeType i, SizeType j, SizeType k) |
| Returns a mutable reference to the element at (i, j, k). More... | |
| ConstReference | operator() (SizeType i, SizeType j, SizeType k) const |
Returns a const reference to the element at (i, j, k). More... | |
| bool | isEmpty () const |
| Tells whether the grid is empty. More... | |
| SizeType | getSize () const |
| Returns the total cell count \( \mathrm{size}_1 \cdot \mathrm{size}_2 \cdot \mathrm{size}_3 \). More... | |
| SizeType | getSize1 () const |
| Returns the first-axis size. More... | |
| SizeType | getSize2 () const |
| Returns the second-axis size. More... | |
| SizeType | getSize3 () const |
| Returns the third-axis size. More... | |
| SizeType | getMaxSize () const |
| Returns the maximum total cell count the underlying storage container can hold. More... | |
| ArrayType & | getData () |
| Returns a mutable reference to the underlying storage container. More... | |
| const ArrayType & | getData () const |
Returns a const reference to the underlying storage container. More... | |
| Grid & | operator= (const Grid &g) |
| Copy-assigns the contents of g to this grid. More... | |
| Grid & | operator= (Grid &&g) |
| Move-assigns the contents of g to this grid. More... | |
| template<typename C > | |
| Grid & | operator= (const GridContainer< C > &c) |
| Assigns the contents of the grid container c to this grid (no alias check needed). More... | |
| template<typename E > | |
| Grid & | operator= (const GridExpression< E > &e) |
| Assigns the grid expression e to this grid (via a temporary to handle aliasing). More... | |
| template<typename C > | |
| Grid & | operator+= (const GridContainer< C > &c) |
| Adds the contents of the grid container c cell-wise to this grid (no alias check needed). More... | |
| template<typename E > | |
| Grid & | operator+= (const GridExpression< E > &e) |
| Adds the grid expression e cell-wise to this grid (via a temporary to handle aliasing). More... | |
| template<typename C > | |
| Grid & | operator-= (const GridContainer< C > &c) |
| Subtracts the contents of the grid container c cell-wise from this grid (no alias check needed). More... | |
| template<typename E > | |
| Grid & | operator-= (const GridExpression< E > &e) |
| Subtracts the grid expression e cell-wise from this grid (via a temporary to handle aliasing). More... | |
| template<typename T1 > | |
| std::enable_if< IsScalar< T1 >::value, Grid >::type & | operator*= (const T1 &t) |
| Multiplies every cell by the scalar t. More... | |
| template<typename T1 > | |
| std::enable_if< IsScalar< T1 >::value, Grid >::type & | operator/= (const T1 &t) |
| Divides every cell by the scalar t. More... | |
| template<typename E > | |
| Grid & | assign (const GridExpression< E > &e) |
| Resizes this grid to match e and assigns its cells without intermediate temporary. More... | |
| template<typename E > | |
| Grid & | plusAssign (const GridExpression< E > &e) |
| Adds the cells of the grid expression e to this grid without intermediate temporary. More... | |
| template<typename E > | |
| Grid & | minusAssign (const GridExpression< E > &e) |
| Subtracts the cells of the grid expression e from this grid without intermediate temporary. More... | |
| void | swap (Grid &g) |
| Swaps the contents of this grid with those of g. More... | |
| void | clear (const ValueType &v=ValueType()) |
| Sets every cell of the grid to the value v. More... | |
| void | resize (SizeType m, SizeType n, SizeType o, bool preserve=true, const ValueType &v=ValueType()) |
| Resizes the grid to \( m \times n \times o \) cells. More... | |
Public Member Functions inherited from CDPL::Math::GridContainer< Grid< T, std::vector< T > > > | |
| const ContainerType & | operator() () const |
Returns a const reference to the derived grid container. More... | |
| ContainerType & | operator() () |
| Returns a reference to the derived grid container. More... | |
Public Member Functions inherited from CDPL::Math::GridExpression< E > | |
| 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 (Grid &g1, Grid &g2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::GridContainer< Grid< T, std::vector< T > > > | |
| GridContainer () | |
| ~GridContainer () | |
Protected Member Functions inherited from CDPL::Math::GridExpression< E > | |
| GridExpression () | |
| ~GridExpression () | |
Protected Member Functions inherited from CDPL::Math::Expression< E > | |
| Expression () | |
| ~Expression () | |
Dynamically-sized dense 3D grid ( \( d_1 \times d_2 \times d_3 \)) with configurable underlying storage.
| T | The scalar value type. |
| A | The underlying storage container type (default: std::vector). |
| typedef T CDPL::Math::Grid< T, A >::ValueType |
The scalar value type stored in the grid.
| typedef T& CDPL::Math::Grid< T, A >::Reference |
Mutable reference type to an element.
| typedef const T& CDPL::Math::Grid< T, A >::ConstReference |
Constant reference type to an element.
| typedef A::size_type CDPL::Math::Grid< T, A >::SizeType |
The unsigned size type used by the underlying storage container.
| typedef A::difference_type CDPL::Math::Grid< T, A >::DifferenceType |
The signed difference type used by the underlying storage container.
| typedef A CDPL::Math::Grid< T, A >::ArrayType |
The underlying storage container type.
| typedef T* CDPL::Math::Grid< T, A >::Pointer |
Pointer type for raw element access.
| typedef const T* CDPL::Math::Grid< T, A >::ConstPointer |
Constant pointer type for raw element access.
| typedef GridReference<SelfType> CDPL::Math::Grid< T, A >::ClosureType |
Closure type used when this grid appears inside another expression.
| typedef const GridReference<const SelfType> CDPL::Math::Grid< T, A >::ConstClosureType |
Constant closure type used when this grid appears inside another expression.
| typedef SelfType CDPL::Math::Grid< T, A >::GridTemporaryType |
Concrete temporary grid type used by expression-template machinery.
| typedef std::shared_ptr<SelfType> CDPL::Math::Grid< T, A >::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated Grid instances.
|
inline |
Constructs an empty grid (zero size on every axis).
|
inline |
Constructs an m × n × o grid with default-initialized elements.
| m | The size along the first axis. |
| n | The size along the second axis. |
| o | The size along the third axis. |
|
inline |
Constructs an m × n × o grid with every element initialized to v.
| m | The size along the first axis. |
| n | The size along the second axis. |
| o | The size along the third axis. |
| v | The element value used to initialize every cell. |
|
inline |
Constructs a copy of the grid g.
| g | The grid to copy. |
|
inline |
Move-constructs a grid from g (g is left in a valid empty state).
| g | The grid to move from. |
|
inline |
Constructs the grid from the grid expression e (materializing the expression result).
| E | The grid expression type. |
| e | The grid expression to materialize. |
|
inline |
Returns a mutable reference to the element at linear index i.
| i | The zero-based linear index. |
| Base::IndexError | if i is out of range. |
|
inline |
Returns a const reference to the element at linear index i.
| i | The zero-based linear index. |
const reference to the cell. | Base::IndexError | if i is out of range. |
|
inline |
Returns a mutable reference to the element at (i, j, k).
| i | The zero-based first-axis index. |
| j | The zero-based second-axis index. |
| k | The zero-based third-axis index. |
| Base::IndexError | if any of the indices is out of range. |
|
inline |
Returns a const reference to the element at (i, j, k).
| i | The zero-based first-axis index. |
| j | The zero-based second-axis index. |
| k | The zero-based third-axis index. |
const reference to the cell. | Base::IndexError | if any of the indices is out of range. |
|
inline |
Tells whether the grid is empty.
true if the underlying storage holds no elements, and false otherwise.
|
inline |
Returns the total cell count \( \mathrm{size}_1 \cdot \mathrm{size}_2 \cdot \mathrm{size}_3 \).
|
inline |
Returns the first-axis size.
|
inline |
Returns the second-axis size.
|
inline |
Returns the third-axis size.
|
inline |
Returns the maximum total cell count the underlying storage container can hold.
|
inline |
Returns a mutable reference to the underlying storage container.
|
inline |
Returns a const reference to the underlying storage container.
const reference to the storage container.
|
inline |
Copy-assigns the contents of g to this grid.
| g | The source grid. |
|
inline |
Move-assigns the contents of g to this grid.
| g | The source grid (left in a valid but unspecified state). |
|
inline |
Assigns the contents of the grid container c to this grid (no alias check needed).
| C | The source grid container type. |
| c | The source grid container. |
|
inline |
Assigns the grid expression e to this grid (via a temporary to handle aliasing).
| E | The source grid expression type. |
| e | The source grid expression. |
|
inline |
Adds the contents of the grid container c cell-wise to this grid (no alias check needed).
| C | The source grid container type. |
| c | The source grid container. |
|
inline |
Adds the grid expression e cell-wise to this grid (via a temporary to handle aliasing).
| E | The source grid expression type. |
| e | The source grid expression. |
|
inline |
Subtracts the contents of the grid container c cell-wise from this grid (no alias check needed).
| C | The source grid container type. |
| c | The source grid container. |
|
inline |
Subtracts the grid expression e cell-wise from this grid (via a temporary to handle aliasing).
| E | The source grid expression type. |
| e | The source grid expression. |
|
inline |
Multiplies every cell by the scalar t.
| T1 | The scalar type. |
| t | The scalar multiplier. |
|
inline |
Divides every cell by the scalar t.
| T1 | The scalar type. |
| t | The scalar divisor. |
|
inline |
Resizes this grid to match e and assigns its cells without intermediate temporary.
| E | The source grid expression type. |
| e | The source grid expression. |
|
inline |
Adds the cells of the grid expression e to this grid without intermediate temporary.
| E | The source grid expression type. |
| e | The source grid expression. |
|
inline |
Subtracts the cells of the grid expression e from this grid without intermediate temporary.
| E | The source grid expression type. |
| e | The source grid expression. |
|
inline |
Swaps the contents of this grid with those of g.
| g | The grid to swap with. |
|
inline |
Sets every cell of the grid to the value v.
| v | The fill value. |
|
inline |
Resizes the grid to \( m \times n \times o \) cells.
| m | The new first-axis size. |
| n | The new second-axis size. |
| o | The new third-axis size. |
| preserve | If true, existing cell values at indices that remain valid are kept; if false, all cells are set to v. |
| v | The fill value for newly added cells (or for all cells when preserve is false). |
|
friend |
ADL-enabled free-function form of swap().
| g1 | The first grid. |
| g2 | The second grid. |