27 #ifndef CDPL_MATH_QUATERNIONASSIGNMENT_HPP
28 #define CDPL_MATH_QUATERNIONASSIGNMENT_HPP
40 class QuaternionExpression;
55 template <
template <
typename T1,
typename T2>
class F,
typename Q,
typename E>
58 typedef F<typename Q::Reference, typename E::ValueType> FunctorType;
60 FunctorType::apply(q.getC1(), e().getC1());
61 FunctorType::apply(q.getC2(), e().getC2());
62 FunctorType::apply(q.getC3(), e().getC3());
63 FunctorType::apply(q.getC4(), e().getC4());
74 template <
template <
typename T1,
typename T2>
class F,
typename Q,
typename T>
77 typedef F<typename Q::Reference, T> FunctorType;
79 FunctorType::apply(q.getC1(), t);
80 FunctorType::apply(q.getC2(), t);
81 FunctorType::apply(q.getC3(), t);
82 FunctorType::apply(q.getC4(), t);
92 template <
typename Q,
typename E>
95 std::swap(q.getC1(), e().getC1());
96 std::swap(q.getC2(), e().getC2());
97 std::swap(q.getC3(), e().getC3());
98 std::swap(q.getC4(), e().getC4());
CRTP base class for all quaternion expression types.
Definition: Expression.hpp:142
constexpr unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
constexpr unsigned int F
Specifies Fluorine.
Definition: AtomType.hpp:107
constexpr unsigned int Q
Generic type that covers any element except hydrogen and carbon.
Definition: AtomType.hpp:647
constexpr unsigned int E
Specifies that the stereocenter has E configuration.
Definition: CIPDescriptor.hpp:96
void quaternionAssignScalar(Q &q, const T &t)
Applies the element-wise functor F to every (quaternion component, scalar) pair.
Definition: QuaternionAssignment.hpp:75
void quaternionSwap(Q &q, QuaternionExpression< E > &e)
Swaps the components of two quaternion expressions component by component.
Definition: QuaternionAssignment.hpp:93
void quaternionAssignQuaternion(Q &q, const QuaternionExpression< E > &e)
Applies the binary functor F componentwise between the destination quaternion q and the source quater...
Definition: QuaternionAssignment.hpp:56
The namespace of the Chemical Data Processing Library.