Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | Friends | List of all members
CDPL::Math::ZeroGrid< T > Class Template Reference

Constant grid expression whose cells are all zero. More...

#include <Grid.hpp>

+ Inheritance diagram for CDPL::Math::ZeroGrid< T >:

Public Types

typedef T ValueType
 The scalar value type. More...
 
typedef const T & Reference
 Reference type (always a const reference — all cells are zero). More...
 
typedef const T & ConstReference
 Constant reference type to the zero element. More...
 
typedef std::size_t SizeType
 The unsigned size type. More...
 
typedef std::ptrdiff_t DifferenceType
 The signed difference type. More...
 
typedef GridReference< SelfTypeClosureType
 Closure type used when this grid appears inside another expression. More...
 
typedef const GridReference< const SelfTypeConstClosureType
 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< ZeroGrid< T > >
typedef ZeroGrid< 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

 ZeroGrid ()
 Constructs an empty zero grid (zero size on every axis). More...
 
 ZeroGrid (SizeType m, SizeType n, SizeType o)
 Constructs a zero grid of size \( m \times n \times o \). More...
 
 ZeroGrid (const ZeroGrid &m)
 Constructs a copy of the zero grid m. More...
 
ConstReference operator() (SizeType i) const
 Returns a const reference to the zero element (linear-index form). More...
 
ConstReference operator() (SizeType i, SizeType j, SizeType k) const
 Returns a const reference to the zero element (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...
 
ZeroGridoperator= (const ZeroGrid &g)
 Copy-assigns the axis sizes from g. More...
 
void swap (ZeroGrid &g)
 Swaps the axis sizes 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< ZeroGrid< T > >
const ContainerTypeoperator() () const
 Returns a const reference to the derived grid container. More...
 
ContainerTypeoperator() ()
 Returns a reference to the derived grid container. More...
 
- Public Member Functions inherited from CDPL::Math::GridExpression< E >
const ExpressionTypeoperator() () const
 Returns a const reference to the derived grid expression. More...
 
ExpressionTypeoperator() ()
 Returns a reference to the derived grid expression. More...
 

Friends

void swap (ZeroGrid &g1, ZeroGrid &g2)
 ADL-enabled free-function form of swap(). More...
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Math::GridContainer< ZeroGrid< 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 ()
 

Detailed Description

template<typename T>
class CDPL::Math::ZeroGrid< T >

Constant grid expression whose cells are all zero.

Template Parameters
TThe scalar value type.

Member Typedef Documentation

◆ ValueType

template<typename T >
typedef T CDPL::Math::ZeroGrid< T >::ValueType

The scalar value type.

◆ Reference

template<typename T >
typedef const T& CDPL::Math::ZeroGrid< T >::Reference

Reference type (always a const reference — all cells are zero).

◆ ConstReference

template<typename T >
typedef const T& CDPL::Math::ZeroGrid< T >::ConstReference

Constant reference type to the zero element.

◆ SizeType

template<typename T >
typedef std::size_t CDPL::Math::ZeroGrid< T >::SizeType

The unsigned size type.

◆ DifferenceType

template<typename T >
typedef std::ptrdiff_t CDPL::Math::ZeroGrid< T >::DifferenceType

The signed difference type.

◆ ClosureType

template<typename T >
typedef GridReference<SelfType> CDPL::Math::ZeroGrid< T >::ClosureType

Closure type used when this grid appears inside another expression.

◆ ConstClosureType

template<typename T >
typedef const GridReference<const SelfType> CDPL::Math::ZeroGrid< T >::ConstClosureType

Constant closure type used when this grid appears inside another expression.

◆ GridTemporaryType

template<typename T >
typedef Grid<T> CDPL::Math::ZeroGrid< T >::GridTemporaryType

Concrete temporary grid type used by expression-template machinery.

Constructor & Destructor Documentation

◆ ZeroGrid() [1/3]

template<typename T >
CDPL::Math::ZeroGrid< T >::ZeroGrid ( )
inline

Constructs an empty zero grid (zero size on every axis).

◆ ZeroGrid() [2/3]

template<typename T >
CDPL::Math::ZeroGrid< T >::ZeroGrid ( SizeType  m,
SizeType  n,
SizeType  o 
)
inline

Constructs a zero grid of size \( m \times n \times o \).

Parameters
mThe first-axis size.
nThe second-axis size.
oThe third-axis size.

◆ ZeroGrid() [3/3]

template<typename T >
CDPL::Math::ZeroGrid< T >::ZeroGrid ( const ZeroGrid< T > &  m)
inline

Constructs a copy of the zero grid m.

Parameters
mThe zero grid to copy.

Member Function Documentation

◆ operator()() [1/2]

template<typename T >
ConstReference CDPL::Math::ZeroGrid< T >::operator() ( SizeType  i) const
inline

Returns a const reference to the zero element (linear-index form).

Parameters
iThe zero-based linear index.
Returns
A const reference to the zero element.
Exceptions
Base::IndexErrorif i is out of range.

◆ operator()() [2/2]

template<typename T >
ConstReference CDPL::Math::ZeroGrid< T >::operator() ( SizeType  i,
SizeType  j,
SizeType  k 
) const
inline

Returns a const reference to the zero element (3D-index form).

Parameters
iThe zero-based first-axis index.
jThe zero-based second-axis index.
kThe zero-based third-axis index.
Returns
A const reference to the zero element.
Exceptions
Base::IndexErrorif any of the indices is out of range.

◆ isEmpty()

template<typename T >
bool CDPL::Math::ZeroGrid< T >::isEmpty ( ) const
inline

Tells whether the grid is empty (any axis has zero size).

Returns
true if any axis is zero, and false otherwise.

◆ getSize()

template<typename T >
SizeType CDPL::Math::ZeroGrid< T >::getSize ( ) const
inline

Returns the total cell count \( \mathrm{size}_1 \cdot \mathrm{size}_2 \cdot \mathrm{size}_3 \).

Returns
The total number of cells.

◆ getSize1()

template<typename T >
SizeType CDPL::Math::ZeroGrid< T >::getSize1 ( ) const
inline

Returns the first-axis size.

Returns
The size along the first axis.

◆ getSize2()

template<typename T >
SizeType CDPL::Math::ZeroGrid< T >::getSize2 ( ) const
inline

Returns the second-axis size.

Returns
The size along the second axis.

◆ getSize3()

template<typename T >
SizeType CDPL::Math::ZeroGrid< T >::getSize3 ( ) const
inline

Returns the third-axis size.

Returns
The size along the third axis.

◆ getMaxSize1()

template<typename T >
SizeType CDPL::Math::ZeroGrid< T >::getMaxSize1 ( ) const
inline

Returns the maximum representable first-axis size.

Returns
The maximum first-axis size.

◆ getMaxSize2()

template<typename T >
SizeType CDPL::Math::ZeroGrid< T >::getMaxSize2 ( ) const
inline

Returns the maximum representable second-axis size.

Returns
The maximum second-axis size.

◆ getMaxSize3()

template<typename T >
SizeType CDPL::Math::ZeroGrid< T >::getMaxSize3 ( ) const
inline

Returns the maximum representable third-axis size.

Returns
The maximum third-axis size.

◆ operator=()

template<typename T >
ZeroGrid& CDPL::Math::ZeroGrid< T >::operator= ( const ZeroGrid< T > &  g)
inline

Copy-assigns the axis sizes from g.

Parameters
gThe source zero grid.
Returns
A reference to itself.

◆ swap()

template<typename T >
void CDPL::Math::ZeroGrid< T >::swap ( ZeroGrid< T > &  g)
inline

Swaps the axis sizes with g.

Parameters
gThe zero grid to swap with.

◆ resize()

template<typename T >
void CDPL::Math::ZeroGrid< T >::resize ( SizeType  m,
SizeType  n,
SizeType  o 
)
inline

Resizes the grid axes to (m, n, o).

Parameters
mThe new first-axis size.
nThe new second-axis size.
oThe new third-axis size.

Friends And Related Function Documentation

◆ swap

template<typename T >
void swap ( ZeroGrid< T > &  g1,
ZeroGrid< T > &  g2 
)
friend

ADL-enabled free-function form of swap().

Parameters
g1The first zero grid.
g2The second zero grid.

The documentation for this class was generated from the following file: