Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | List of all members
CDPL::Math::GridUnary< E, F > Class Template Reference

Expression-template node applying a unary functor F element-wise to a grid expression E. More...

#include <GridExpression.hpp>

+ Inheritance diagram for CDPL::Math::GridUnary< E, F >:

Public Types

typedef F::ResultType ValueType
 The element value type of the expression (the functor's result type). More...
 
typedef const ValueType ConstReference
 Constant reference type to an element value. More...
 
typedef const ValueType Reference
 Mutable reference type (degrades to const for expression-template results). More...
 
typedef const SelfType ConstClosureType
 Constant closure type used when this expression appears inside another expression. More...
 
typedef SelfType ClosureType
 Closure type used when this expression appears inside another expression. More...
 
typedef E::SizeType SizeType
 The size type inherited from the wrapped expression. More...
 
typedef E::DifferenceType DifferenceType
 The signed difference type inherited from the wrapped expression. More...
 
- Public Types inherited from CDPL::Math::GridExpression< GridUnary< E, F > >
typedef GridUnary< E, F > 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

 GridUnary (const ExpressionType &e)
 Constructs the expression-template node wrapping e. More...
 
SizeType getSize1 () const
 Returns the size of the wrapped grid expression along the first dimension. More...
 
SizeType getSize2 () const
 Returns the size of the wrapped grid expression along the second dimension. More...
 
SizeType getSize3 () const
 Returns the size of the wrapped grid expression along the third dimension. More...
 
ConstReference operator() (SizeType i, SizeType j, SizeType k) const
 Applies the unary functor to the element at (i, j, k) of the wrapped expression and returns the result. More...
 
- Public Member Functions inherited from CDPL::Math::GridExpression< GridUnary< E, F > >
const ExpressionTypeoperator() () const
 Returns a const reference to the derived grid expression. More...
 
ExpressionTypeoperator() ()
 Returns a reference to the derived grid expression. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Math::GridExpression< GridUnary< E, F > >
 GridExpression ()
 
 ~GridExpression ()
 
- Protected Member Functions inherited from CDPL::Math::Expression< E >
 Expression ()
 
 ~Expression ()
 

Detailed Description

template<typename E, typename F>
class CDPL::Math::GridUnary< E, F >

Expression-template node applying a unary functor F element-wise to a grid expression E.

Template Parameters
EThe wrapped grid expression type.
FThe unary functor type.

Member Typedef Documentation

◆ ValueType

template<typename E , typename F >
typedef F::ResultType CDPL::Math::GridUnary< E, F >::ValueType

The element value type of the expression (the functor's result type).

◆ ConstReference

template<typename E , typename F >
typedef const ValueType CDPL::Math::GridUnary< E, F >::ConstReference

Constant reference type to an element value.

◆ Reference

template<typename E , typename F >
typedef const ValueType CDPL::Math::GridUnary< E, F >::Reference

Mutable reference type (degrades to const for expression-template results).

◆ ConstClosureType

template<typename E , typename F >
typedef const SelfType CDPL::Math::GridUnary< E, F >::ConstClosureType

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

◆ ClosureType

template<typename E , typename F >
typedef SelfType CDPL::Math::GridUnary< E, F >::ClosureType

Closure type used when this expression appears inside another expression.

◆ SizeType

template<typename E , typename F >
typedef E::SizeType CDPL::Math::GridUnary< E, F >::SizeType

The size type inherited from the wrapped expression.

◆ DifferenceType

template<typename E , typename F >
typedef E::DifferenceType CDPL::Math::GridUnary< E, F >::DifferenceType

The signed difference type inherited from the wrapped expression.

Constructor & Destructor Documentation

◆ GridUnary()

template<typename E , typename F >
CDPL::Math::GridUnary< E, F >::GridUnary ( const ExpressionType e)
inline

Constructs the expression-template node wrapping e.

Parameters
eThe grid expression to wrap.

Member Function Documentation

◆ getSize1()

template<typename E , typename F >
SizeType CDPL::Math::GridUnary< E, F >::getSize1 ( ) const
inline

Returns the size of the wrapped grid expression along the first dimension.

Returns
The wrapped expression's first-dimension size.

◆ getSize2()

template<typename E , typename F >
SizeType CDPL::Math::GridUnary< E, F >::getSize2 ( ) const
inline

Returns the size of the wrapped grid expression along the second dimension.

Returns
The wrapped expression's second-dimension size.

◆ getSize3()

template<typename E , typename F >
SizeType CDPL::Math::GridUnary< E, F >::getSize3 ( ) const
inline

Returns the size of the wrapped grid expression along the third dimension.

Returns
The wrapped expression's third-dimension size.

◆ operator()()

template<typename E , typename F >
ConstReference CDPL::Math::GridUnary< E, F >::operator() ( SizeType  i,
SizeType  j,
SizeType  k 
) const
inline

Applies the unary functor to the element at (i, j, k) of the wrapped expression and returns the result.

Parameters
iThe zero-based first-dimension index.
jThe zero-based second-dimension index.
kThe zero-based third-dimension index.
Returns
The element value as transformed by the functor.

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