Chemical Data Processing Library C++ API - Version 1.4.0
Classes | Namespaces | Functions
GridExpression.hpp File Reference

Definition of various grid expression types and operations. More...

#include <type_traits>
#include "CDPL/Math/Check.hpp"
#include "CDPL/Math/Expression.hpp"
#include "CDPL/Math/CommonType.hpp"
#include "CDPL/Math/Functional.hpp"
#include "CDPL/Math/TypeTraits.hpp"
#include "CDPL/Base/Exceptions.hpp"

Go to the source code of this file.

Classes

class  CDPL::Math::GridUnary< E, F >
 Expression-template node applying a unary functor F element-wise to a grid expression E. More...
 
struct  CDPL::Math::GridUnaryTraits< E, F >
 Traits selecting the expression-template node and its result type for the Math::GridUnary instantiation <E, F>. More...
 
class  CDPL::Math::GridBinary1< E1, E2, F >
 Expression-template node combining two grid expressions E1 and E2 element-wise via the binary functor F. More...
 
struct  CDPL::Math::GridBinary1Traits< E1, E2, F >
 Traits selecting the expression-template node and its result type for the Math::GridBinary1 instantiation Binary <E1, E2, F>. More...
 
class  CDPL::Math::Scalar1GridBinary< E1, E2, F >
 Expression-template node combining a scalar E1 (lhs) and a grid expression E2 (rhs) element-wise via the binary functor F. More...
 
struct  CDPL::Math::Scalar1GridBinaryTraits< E1, E2, F >
 Traits selecting the expression-template node and its result type for the Math::Scalar1GridBinary instantiation <E1, E2, F>. More...
 
class  CDPL::Math::Scalar2GridBinary< E1, E2, F >
 Expression-template node combining a grid expression E1 (lhs) and a scalar E2 (rhs) element-wise via the binary functor F. More...
 
struct  CDPL::Math::Scalar2GridBinaryTraits< E1, E2, F >
 Traits selecting the expression-template node and its result type for the Math::Scalar2GridBinary instantiation <E1, E2, F>. More...
 

Namespaces

 CDPL
 The namespace of the Chemical Data Processing Library.
 
 CDPL::Math
 Contains classes and functions related to mathematics.
 

Functions

template<typename E >
GridUnaryTraits< E, ScalarNegation< typename E::ValueType > >::ResultType CDPL::Math::operator- (const GridExpression< E > &e)
 Returns the element-wise negation of the grid expression e. More...
 
template<typename E >
const E & CDPL::Math::operator+ (const GridExpression< E > &e)
 Returns the grid expression e unchanged (unary +). More...
 
template<typename E1 , typename E2 >
GridBinary1Traits< E1, E2, ScalarAddition< typename E1::ValueType, typename E2::ValueType > >::ResultType CDPL::Math::operator+ (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
 Returns the element-wise sum of the grid expressions e1 and e2. More...
 
template<typename E1 , typename E2 >
GridBinary1Traits< E1, E2, ScalarSubtraction< typename E1::ValueType, typename E2::ValueType > >::ResultType CDPL::Math::operator- (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
 Returns the element-wise difference of the grid expressions e1 and e2. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2GridBinaryTraits< E, T, ScalarMultiplication< typename E::ValueType, T > >::ResultType >::type CDPL::Math::operator* (const GridExpression< E > &e, const T &t)
 Returns the element-wise product of the grid expression e and the scalar t. More...
 
template<typename T , typename E >
std::enable_if< IsScalar< T >::value, typename Scalar1GridBinaryTraits< T, E, ScalarMultiplication< T, typename E::ValueType > >::ResultType >::type CDPL::Math::operator* (const T &t, const GridExpression< E > &e)
 Returns the element-wise product of the scalar t and the grid expression e. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2GridBinaryTraits< E, T, ScalarDivision< typename E::ValueType, T > >::ResultType >::type CDPL::Math::operator/ (const GridExpression< E > &e, const T &t)
 Returns the element-wise quotient of the grid expression e by the scalar t. More...
 
template<typename E1 , typename E2 >
GridEquality< E1, E2 >::ResultType CDPL::Math::operator== (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
 Tells whether the grid expressions e1 and e2 are element-wise equal. More...
 
template<typename E1 , typename E2 >
GridEquality< E1, E2 >::ResultType CDPL::Math::operator!= (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
 Tells whether the grid expressions e1 and e2 differ in at least one element. More...
 
template<typename E1 , typename E2 , typename T >
std::enable_if< std::is_arithmetic< T >::value, typename GridToleranceEquality< E1, E2, T >::ResultType >::type CDPL::Math::equals (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2, const T &eps)
 Tells whether the grid expressions e1 and e2 agree element-wise within the absolute tolerance eps. More...
 
template<typename E >
GridUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType CDPL::Math::conj (const GridExpression< E > &e)
 Returns the element-wise complex conjugate of the grid expression e (identity for real-valued grids). More...
 
template<typename E >
GridUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType CDPL::Math::herm (const GridExpression< E > &e)
 Returns the Hermitian conjugate of the grid expression e (alias of conj() for grids). More...
 
template<typename E >
GridUnaryTraits< E, ScalarReal< typename E::ValueType > >::ResultType CDPL::Math::real (const GridExpression< E > &e)
 Returns the element-wise real part of the grid expression e. More...
 
template<typename E >
GridUnaryTraits< E, ScalarImaginary< typename E::ValueType > >::ResultType CDPL::Math::imag (const GridExpression< E > &e)
 Returns the element-wise imaginary part of the grid expression e. More...
 
template<typename E1 , typename E2 >
GridBinary1Traits< E1, E2, ScalarDivision< typename E1::ValueType, typename E2::ValueType > >::ResultType CDPL::Math::elemDiv (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
 Returns the element-wise quotient of the grid expressions e1 and e2. More...
 
template<typename E1 , typename E2 >
GridBinary1Traits< E1, E2, ScalarMultiplication< typename E1::ValueType, typename E2::ValueType > >::ResultType CDPL::Math::elemProd (const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
 Returns the element-wise product of the grid expressions e1 and e2 (Hadamard product). More...
 
template<typename E >
GridElementSum< E >::ResultType CDPL::Math::sum (const GridExpression< E > &e)
 Returns the sum of all elements of the grid expression e. More...
 

Detailed Description

Definition of various grid expression types and operations.