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

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

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

Go to the source code of this file.

Classes

class  CDPL::Math::QuaternionUnary1< E, F >
 Expression-template node applying a unary functor F that returns a quaternion result to a quaternion expression E. More...
 
struct  CDPL::Math::QuaternionUnary1Traits< E, F >
 Traits selecting the expression-template node and its result type for the Math::QuaternionUnary1 instantiation <E, F>. More...
 
class  CDPL::Math::QuaternionUnary2< E, F >
 Expression-template node applying a per-component functor F to a quaternion expression E, where F exposes four separate apply methods (applyC1 / applyC2 / applyC3 / applyC4) operating on the whole source expression. More...
 
struct  CDPL::Math::QuaternionUnary2Traits< E, F >
 Traits selecting the expression-template node and its result type for the Math::QuaternionUnary2 instantiation <E, F>. More...
 
class  CDPL::Math::QuaternionBinary1< E1, E2, F >
 Expression-template node combining two quaternion expressions E1 and E2 component-wise via the binary functor F. More...
 
struct  CDPL::Math::QuaternionBinary1Traits< E1, E2, F >
 Traits selecting the expression-template node and its result type for the Math::QuaternionBinary1 instantiation <E1, E2, F>. More...
 
class  CDPL::Math::QuaternionBinary2< E1, E2, F >
 Expression-template node combining two quaternion expressions E1 and E2 via the per-component functor F (which exposes four separate applyC1 / applyC2 / applyC3 / applyC4 methods operating on the whole source expressions). More...
 
struct  CDPL::Math::QuaternionBinary2Traits< E1, E2, F >
 Traits selecting the expression-template node and its result type for the Math::QuaternionBinary2 instantiation <E1, E2, F>. More...
 
class  CDPL::Math::Scalar1QuaternionBinary1< E1, E2, F >
 Expression-template node combining a scalar E1 (lhs) and a quaternion expression E2 (rhs) component-wise via the binary functor F. More...
 
struct  CDPL::Math::Scalar1QuaternionBinary1Traits< E1, E2, F >
 Traits selecting the expression-template node and its result type for the Math::Scalar1QuaternionBinary1 instantiation <E1, E2, F>. More...
 
class  CDPL::Math::Scalar1QuaternionBinary2< E1, E2, F >
 Expression-template node combining a scalar E1 (lhs) and a quaternion expression E2 (rhs) via the per-component functor F (which exposes applyC1 / applyC2 / applyC3 / applyC4 methods). More...
 
struct  CDPL::Math::Scalar1QuaternionBinary2Traits< E1, E2, F >
 Traits selecting the expression-template node and its result type for the Math::Scalar1QuaternionBinary2 instantiation <E1, E2, F>. More...
 
class  CDPL::Math::Scalar2QuaternionBinary1< E1, E2, F >
 Expression-template node combining a quaternion expression E1 (lhs) and a scalar E2 (rhs) component-wise via the binary functor F. More...
 
struct  CDPL::Math::Scalar2QuaternionBinary1Traits< E1, E2, F >
 Traits selecting the expression-template node and its result type for the Math::Scalar2QuaternionBinary1 instantiation <E1, E2, F>. More...
 
class  CDPL::Math::Scalar2QuaternionBinary2< E1, E2, F >
 Expression-template node combining a quaternion expression E1 (lhs) and a scalar E2 (rhs) via the per-component functor F (which exposes applyC1 / applyC2 / applyC3 / applyC4 methods). More...
 
struct  CDPL::Math::Scalar2QuaternionBinary2Traits< E1, E2, F >
 Traits selecting the expression-template node and its result type for the Math::Scalar2QuaternionBinary2 instantiation <E1, E2, F>. More...
 
class  CDPL::Math::Scalar3QuaternionTernary< E1, E2, E3, F >
 Expression-template node combining two quaternion expressions E1 (lhs) and E2 (middle) with a scalar E3 (rhs) via the per-component ternary functor F. More...
 
struct  CDPL::Math::Scalar3QuaternionTernaryTraits< E1, E2, E3, F >
 Traits selecting the expression-template node and its result type for the Math::Scalar3QuaternionTernary instantiation <E1, E2, E3, F>. More...
 
class  CDPL::Math::Scalar13QuaternionTernary< E1, E2, E3, F >
 Expression-template node combining a scalar E1 (lhs), a quaternion expression E2 (middle), and a scalar E3 (rhs) via the per-component ternary functor F. More...
 
struct  CDPL::Math::Scalar13QuaternionTernaryTraits< E1, E2, E3, F >
 Traits selecting the expression-template node and its result type for the Math::Scalar13QuaternionTernary instantiation <E1, E2, E3, 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 >
QuaternionUnary1Traits< E, ScalarNegation< typename E::ValueType > >::ResultType CDPL::Math::operator- (const QuaternionExpression< E > &e)
 Returns the component-wise negation of the quaternion expression e. More...
 
template<typename E >
const E & CDPL::Math::operator+ (const QuaternionExpression< E > &e)
 Returns the quaternion expression e unchanged (unary +). More...
 
template<typename E1 , typename E2 >
QuaternionBinary1Traits< E1, E2, ScalarAddition< typename E1::ValueType, typename E2::ValueType > >::ResultType CDPL::Math::operator+ (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Returns the component-wise sum of the quaternion expressions e1 and e2. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2QuaternionBinary2Traits< E, T, Scalar2QuaternionAddition< E, T > >::ResultType >::type CDPL::Math::operator+ (const QuaternionExpression< E > &e, const T &t)
 Adds the scalar t to the real component (C1) of the quaternion expression e. More...
 
template<typename T , typename E >
std::enable_if< IsScalar< T >::value, typename Scalar1QuaternionBinary2Traits< T, E, Scalar1QuaternionAddition< T, E > >::ResultType >::type CDPL::Math::operator+ (const T &t, const QuaternionExpression< E > &e)
 Adds the scalar t to the real component (C1) of the quaternion expression e (commutative form). More...
 
template<typename E1 , typename E2 >
QuaternionBinary1Traits< E1, E2, ScalarSubtraction< typename E1::ValueType, typename E2::ValueType > >::ResultType CDPL::Math::operator- (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Returns the component-wise difference of the quaternion expressions e1 and e2. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2QuaternionBinary2Traits< E, T, Scalar2QuaternionSubtraction< E, T > >::ResultType >::type CDPL::Math::operator- (const QuaternionExpression< E > &e, const T &t)
 Subtracts the scalar t from the real component (C1) of the quaternion expression e. More...
 
template<typename T , typename E >
std::enable_if< IsScalar< T >::value, typename Scalar1QuaternionBinary2Traits< T, E, Scalar1QuaternionSubtraction< T, E > >::ResultType >::type CDPL::Math::operator- (const T &t, const QuaternionExpression< E > &e)
 Subtracts the quaternion expression e from the scalar t (forming \( t - e \) as a quaternion expression). More...
 
template<typename E1 , typename E2 >
QuaternionBinary2Traits< E1, E2, QuaternionProduct< E1, E2 > >::ResultType CDPL::Math::operator* (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Returns the (Hamilton) product of the quaternion expressions e1 and e2. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2QuaternionBinary1Traits< E, T, ScalarMultiplication< typename E::ValueType, T > >::ResultType >::type CDPL::Math::operator* (const QuaternionExpression< E > &e, const T &t)
 Returns the component-wise product of the quaternion expression e and the scalar t. More...
 
template<typename T , typename E >
std::enable_if< IsScalar< T >::value, typename Scalar1QuaternionBinary1Traits< T, E, ScalarMultiplication< T, typename E::ValueType > >::ResultType >::type CDPL::Math::operator* (const T &t, const QuaternionExpression< E > &e)
 Returns the component-wise product of the scalar t and the quaternion expression e. More...
 
template<typename E1 , typename E2 >
Scalar3QuaternionTernaryTraits< E1, E2, typename QuaternionNorm2< E2 >::ResultType, QuaternionDivision< E1, E2, typename QuaternionNorm2< E2 >::ResultType > >::ResultType CDPL::Math::operator/ (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Returns the quaternion division \( e_1 \cdot e_2^{-1} \) as an expression-template node. More...
 
template<typename E , typename T >
std::enable_if< IsScalar< T >::value, typename Scalar2QuaternionBinary1Traits< E, T, ScalarDivision< typename E::ValueType, T > >::ResultType >::type CDPL::Math::operator/ (const QuaternionExpression< E > &e, const T &t)
 Returns the component-wise quotient of the quaternion expression e by the scalar t. More...
 
template<typename T , typename E >
std::enable_if< IsScalar< T >::value, typename Scalar13QuaternionTernaryTraits< T, E, typename QuaternionNorm2< E >::ResultType, ScalarQuaternionDivision< T, E, typename QuaternionNorm2< E >::ResultType > >::ResultType >::type CDPL::Math::operator/ (const T &t, const QuaternionExpression< E > &e)
 Returns the quaternion division of the scalar t by the quaternion expression e ( \( t \cdot e^{-1} \)). More...
 
template<typename E1 , typename E2 >
QuaternionEquality< E1, E2 >::ResultType CDPL::Math::operator== (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Tells whether the quaternion expressions e1 and e2 are component-wise equal. More...
 
template<typename E1 , typename E2 >
QuaternionEquality< E1, E2 >::ResultType CDPL::Math::operator!= (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Tells whether the quaternion expressions e1 and e2 differ in at least one component. More...
 
template<typename E1 , typename E2 , typename T >
std::enable_if< std::is_arithmetic< T >::value, typename QuaternionToleranceEquality< E1, E2, T >::ResultType >::type CDPL::Math::equals (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, const T &eps)
 Tells whether the quaternion expressions e1 and e2 agree component-wise within the absolute tolerance eps. More...
 
template<typename E1 , typename E2 >
QuaternionBinary1Traits< E1, E2, ScalarDivision< typename E1::ValueType, typename E2::ValueType > >::ResultType CDPL::Math::elemDiv (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Returns the component-wise quotient of the quaternion expressions e1 and e2. More...
 
template<typename E1 , typename E2 >
QuaternionBinary1Traits< E1, E2, ScalarMultiplication< typename E1::ValueType, typename E2::ValueType > >::ResultType CDPL::Math::elemProd (const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
 Returns the component-wise product (Hadamard product) of the quaternion expressions e1 and e2. More...
 
template<typename E >
E::ValueType CDPL::Math::real (const QuaternionExpression< E > &e)
 Returns the real component (C1) of the quaternion expression e. More...
 
template<typename E >
QuaternionUnary2Traits< E, QuaternionUnreal< E > >::ResultType CDPL::Math::unreal (const QuaternionExpression< E > &e)
 Returns the unreal (pure-quaternion) part of the quaternion expression e (with C1 zeroed out). More...
 
template<typename E >
QuaternionUnary2Traits< E, QuaternionConjugate< E > >::ResultType CDPL::Math::conj (const QuaternionExpression< E > &e)
 Returns the quaternion conjugate of the quaternion expression e (negates C2, C3, C4). More...
 
template<typename E >
Scalar2QuaternionBinary2Traits< E, typename QuaternionNorm2< E >::ResultType, QuaternionInverse< E, typename QuaternionNorm2< E >::ResultType > >::ResultType CDPL::Math::inv (const QuaternionExpression< E > &e)
 Returns the multiplicative inverse of the quaternion expression e ( \( \overline{e} / |e|^2 \)). More...
 
template<typename E >
QuaternionNorm< E >::ResultType CDPL::Math::norm (const QuaternionExpression< E > &e)
 Returns the norm (Euclidean length) of the quaternion expression e. More...
 
template<typename E >
QuaternionNorm2< E >::ResultType CDPL::Math::norm2 (const QuaternionExpression< E > &e)
 Returns the squared norm of the quaternion expression e. More...
 
template<typename E >
QuaternionElementSum< E >::ResultType CDPL::Math::sum (const QuaternionExpression< E > &e)
 Returns the sum of the four components of the quaternion expression e. More...
 

Detailed Description

Definition of various quaternion expression types and operations.