![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Constant grid expression in which every cell equals the same scalar value. More...
#include <Grid.hpp>
Inheritance diagram for CDPL::Math::ScalarGrid< T >:Public Types | |
| typedef T | ValueType |
| The scalar value type. More... | |
| typedef const T & | Reference |
Reference type (always a const reference — cells are immutable). More... | |
| typedef const T & | ConstReference |
| Constant reference type to a cell. More... | |
| typedef std::size_t | SizeType |
| The unsigned size type. More... | |
| typedef std::ptrdiff_t | DifferenceType |
| The signed difference type. 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 Grid< T > | GridTemporaryType |
| Concrete temporary grid type used by expression-template machinery. More... | |
Public Types inherited from CDPL::Math::GridContainer< ScalarGrid< T > > | |
| typedef ScalarGrid< 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 | |
| ScalarGrid () | |
| Constructs an empty scalar grid. More... | |
| ScalarGrid (SizeType m, SizeType n, SizeType o, const ValueType &v=ValueType()) | |
| Constructs a scalar grid of size \( m \times n \times o \) in which every cell equals v. More... | |
| ScalarGrid (const ScalarGrid &m) | |
| Constructs a copy of the scalar grid m. More... | |
| ConstReference | operator() (SizeType i) const |
Returns a const reference to the common cell value (linear-index form). More... | |
| ConstReference | operator() (SizeType i, SizeType j, SizeType k) const |
Returns a const reference to the common cell value (3D-index form). More... | |
| bool | isEmpty () const |
| Tells whether the grid is empty (any axis has zero size). 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 | getMaxSize1 () const |
| Returns the maximum representable first-axis size. More... | |
| SizeType | getMaxSize2 () const |
| Returns the maximum representable second-axis size. More... | |
| SizeType | getMaxSize3 () const |
| Returns the maximum representable third-axis size. More... | |
| ScalarGrid & | operator= (const ScalarGrid &g) |
| Copy-assigns the axis sizes and common value from g. More... | |
| void | swap (ScalarGrid &g) |
| Swaps the axis sizes and common value with g. More... | |
| void | resize (SizeType m, SizeType n, SizeType o) |
| Resizes the grid axes to (m, n, o). More... | |
Public Member Functions inherited from CDPL::Math::GridContainer< ScalarGrid< 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 (ScalarGrid &g1, ScalarGrid &g2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::GridContainer< ScalarGrid< 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 () | |
Constant grid expression in which every cell equals the same scalar value.
| T | The scalar value type. |
| typedef T CDPL::Math::ScalarGrid< T >::ValueType |
The scalar value type.
| typedef const T& CDPL::Math::ScalarGrid< T >::Reference |
Reference type (always a const reference — cells are immutable).
| typedef const T& CDPL::Math::ScalarGrid< T >::ConstReference |
Constant reference type to a cell.
| typedef std::size_t CDPL::Math::ScalarGrid< T >::SizeType |
The unsigned size type.
| typedef std::ptrdiff_t CDPL::Math::ScalarGrid< T >::DifferenceType |
The signed difference type.
| typedef GridReference<SelfType> CDPL::Math::ScalarGrid< T >::ClosureType |
Closure type used when this grid appears inside another expression.
| typedef const GridReference<const SelfType> CDPL::Math::ScalarGrid< T >::ConstClosureType |
Constant closure type used when this grid appears inside another expression.
| typedef Grid<T> CDPL::Math::ScalarGrid< T >::GridTemporaryType |
Concrete temporary grid type used by expression-template machinery.
|
inline |
Constructs an empty scalar grid.
|
inline |
Constructs a scalar grid of size \( m \times n \times o \) in which every cell equals v.
| m | The first-axis size. |
| n | The second-axis size. |
| o | The third-axis size. |
| v | The common cell value. |
|
inline |
Constructs a copy of the scalar grid m.
| m | The scalar grid to copy. |
|
inline |
Returns a const reference to the common cell value (linear-index form).
| i | The zero-based linear index. |
const reference to the common cell value. | Base::IndexError | if i is out of range. |
|
inline |
Returns a const reference to the common cell value (3D-index form).
| 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 common cell value. | Base::IndexError | if any of the indices is out of range. |
|
inline |
Tells whether the grid is empty (any axis has zero size).
true if any axis is zero, 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 representable first-axis size.
|
inline |
Returns the maximum representable second-axis size.
|
inline |
Returns the maximum representable third-axis size.
|
inline |
Copy-assigns the axis sizes and common value from g.
| g | The source scalar grid. |
|
inline |
Swaps the axis sizes and common value with g.
| g | The scalar grid to swap with. |
|
inline |
Resizes the grid axes to (m, n, o).
| m | The new first-axis size. |
| n | The new second-axis size. |
| o | The new third-axis size. |
|
friend |
ADL-enabled free-function form of swap().
| g1 | The first scalar grid. |
| g2 | The second scalar grid. |