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

Expression template node combining two grid expressions E1 and E2 element-wise via the binary functor F. More...

#include <GridExpression.hpp>

+ Inheritance diagram for CDPL::Math::GridBinary1< E1, E2, 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 element reference type. More...
 
typedef const ValueType Reference
 Mutable element 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 CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
 The common size type of the two wrapped expressions. More...
 
typedef CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
 The common signed difference type of the two wrapped expressions. More...
 
- Public Types inherited from CDPL::Math::GridExpression< GridBinary1< E1, E2, F > >
typedef GridBinary1< E1, E2, F > ExpressionType
 The derived grid expression type. More...
 
- Public Types inherited from CDPL::Math::Expression< E >
typedef E ExpressionType
 The derived expression type. More...
 

Public Member Functions

 GridBinary1 (const Expression1Type &e1, const Expression2Type &e2)
 Constructs the expression template node wrapping e1 and e2. More...
 
SizeType getSize1 () const
 Returns the size along the first dimension after verifying that both wrapped expressions agree on it. More...
 
SizeType getSize2 () const
 Returns the size along the second dimension after verifying that both wrapped expressions agree on it. More...
 
SizeType getSize3 () const
 Returns the size along the third dimension after verifying that both wrapped expressions agree on it. More...
 
ConstReference operator() (SizeType i, SizeType j, SizeType k) const
 Applies the binary functor to the elements at (i, j, k) of the two wrapped expressions and returns the result. More...
 
- Public Member Functions inherited from CDPL::Math::GridExpression< GridBinary1< E1, E2, F > >
const ExpressionTypeoperator() () const
 Returns a const reference to the derived grid expression class instance. More...
 
ExpressionTypeoperator() ()
 Returns a reference to the derived grid expression class instance. More...
 

Additional Inherited Members

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

Detailed Description

template<typename E1, typename E2, typename F>
class CDPL::Math::GridBinary1< E1, E2, F >

Expression template node combining two grid expressions E1 and E2 element-wise via the binary functor F.

Template Parameters
E1The first wrapped grid expression type.
E2The second wrapped grid expression type.
FThe binary functor type.

Member Typedef Documentation

◆ ValueType

template<typename E1 , typename E2 , typename F >
typedef F::ResultType CDPL::Math::GridBinary1< E1, E2, F >::ValueType

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

◆ ConstReference

template<typename E1 , typename E2 , typename F >
typedef const ValueType CDPL::Math::GridBinary1< E1, E2, F >::ConstReference

Constant element reference type.

◆ Reference

template<typename E1 , typename E2 , typename F >
typedef const ValueType CDPL::Math::GridBinary1< E1, E2, F >::Reference

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

◆ ConstClosureType

template<typename E1 , typename E2 , typename F >
typedef const SelfType CDPL::Math::GridBinary1< E1, E2, F >::ConstClosureType

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

◆ ClosureType

template<typename E1 , typename E2 , typename F >
typedef SelfType CDPL::Math::GridBinary1< E1, E2, F >::ClosureType

Closure type used when this expression appears inside another expression.

◆ SizeType

template<typename E1 , typename E2 , typename F >
typedef CommonType<typename E1::SizeType, typename E2::SizeType>::Type CDPL::Math::GridBinary1< E1, E2, F >::SizeType

The common size type of the two wrapped expressions.

◆ DifferenceType

template<typename E1 , typename E2 , typename F >
typedef CommonType<typename E1::DifferenceType, typename E2::DifferenceType>::Type CDPL::Math::GridBinary1< E1, E2, F >::DifferenceType

The common signed difference type of the two wrapped expressions.

Constructor & Destructor Documentation

◆ GridBinary1()

template<typename E1 , typename E2 , typename F >
CDPL::Math::GridBinary1< E1, E2, F >::GridBinary1 ( const Expression1Type &  e1,
const Expression2Type &  e2 
)
inline

Constructs the expression template node wrapping e1 and e2.

Parameters
e1The first grid expression.
e2The second grid expression.

Member Function Documentation

◆ getSize1()

template<typename E1 , typename E2 , typename F >
SizeType CDPL::Math::GridBinary1< E1, E2, F >::getSize1 ( ) const
inline

Returns the size along the first dimension after verifying that both wrapped expressions agree on it.

Returns
The size in the first dimension.
Exceptions
Base::SizeErrorif the two wrapped expressions report different first dimension sizes.

◆ getSize2()

template<typename E1 , typename E2 , typename F >
SizeType CDPL::Math::GridBinary1< E1, E2, F >::getSize2 ( ) const
inline

Returns the size along the second dimension after verifying that both wrapped expressions agree on it.

Returns
The size in the second dimension.
Exceptions
Base::SizeErrorif the two wrapped expressions report different second dimension sizes.

◆ getSize3()

template<typename E1 , typename E2 , typename F >
SizeType CDPL::Math::GridBinary1< E1, E2, F >::getSize3 ( ) const
inline

Returns the size along the third dimension after verifying that both wrapped expressions agree on it.

Returns
The size in the third dimension.
Exceptions
Base::SizeErrorif the two wrapped expressions report different third dimension sizes.

◆ operator()()

template<typename E1 , typename E2 , typename F >
ConstReference CDPL::Math::GridBinary1< E1, E2, F >::operator() ( SizeType  i,
SizeType  j,
SizeType  k 
) const
inline

Applies the binary functor to the elements at (i, j, k) of the two wrapped expressions 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 combined by the functor.

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