![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
View adapter that exposes a quaternion as a 4-element vector expression (indices map to the components C1, C2, C3, C4). More...
#include <QuaternionAdapter.hpp>
Inheritance diagram for CDPL::Math::QuaternionVectorAdapter< Q >:Public Types | |
| typedef Q | QuaternionType |
| The wrapped quaternion type. More... | |
| typedef std::size_t | SizeType |
The size type (std::size_t). More... | |
| typedef std::ptrdiff_t | DifferenceType |
The signed difference type (std::ptrdiff_t). More... | |
| typedef Q::ValueType | ValueType |
| The element value type of the wrapped quaternion. More... | |
| typedef Q::ConstReference | ConstReference |
| Constant reference type to an element of the wrapped quaternion. More... | |
| typedef std::conditional< std::is_const< Q >::value, typename Q::ConstReference, typename Q::Reference >::type | Reference |
Mutable reference type (degrades to ConstReference when the wrapped quaternion is const). More... | |
| typedef std::conditional< std::is_const< Q >::value, typename Q::ConstClosureType, typename Q::ClosureType >::type | QuaternionClosureType |
| Closure type used to store the wrapped quaternion internally (mutable or const flavor). More... | |
| typedef const SelfType | ConstClosureType |
| Constant closure type used when this adapter appears inside another expression. More... | |
| typedef SelfType | ClosureType |
| Closure type used when this adapter appears inside another expression. More... | |
Public Types inherited from CDPL::Math::VectorExpression< QuaternionVectorAdapter< Q > > | |
| typedef QuaternionVectorAdapter< Q > | ExpressionType |
| The derived vector 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 | |
| QuaternionVectorAdapter (QuaternionType &q) | |
| Constructs the adapter wrapping the quaternion q. More... | |
| Reference | operator() (SizeType i) |
| Returns a mutable reference to the quaternion component at index i. More... | |
| ConstReference | operator() (SizeType i) const |
Returns a const reference to the quaternion component at index i. More... | |
| Reference | operator[] (SizeType i) |
| Returns a mutable reference to the quaternion component at index i (alias for operator()). More... | |
| ConstReference | operator[] (SizeType i) const |
Returns a const reference to the quaternion component at index i (alias for operator()). More... | |
| SizeType | getSize () const |
| Returns the dimensionality of the view (always 4). More... | |
| bool | isEmpty () const |
Tells whether the view is empty (always false; the view is fixed-size with 4 components). More... | |
| QuaternionClosureType & | getData () |
| Returns a reference to the wrapped quaternion (via its stored closure). More... | |
| const QuaternionClosureType & | getData () const |
Returns a const reference to the wrapped quaternion (via its stored closure). More... | |
| QuaternionVectorAdapter & | operator= (const QuaternionVectorAdapter &a) |
| Copies the components of a into this view (writing through to the wrapped quaternion). More... | |
| template<typename E > | |
| QuaternionVectorAdapter & | operator= (const VectorExpression< E > &e) |
| Assigns the vector expression e to this view (writing through to the wrapped quaternion). More... | |
| template<typename E > | |
| QuaternionVectorAdapter & | operator+= (const VectorExpression< E > &e) |
| Adds the vector expression e componentwise to this view. More... | |
| template<typename E > | |
| QuaternionVectorAdapter & | operator-= (const VectorExpression< E > &e) |
| Subtracts the vector expression e componentwise from this view. More... | |
| template<typename T > | |
| std::enable_if< IsScalar< T >::value, QuaternionVectorAdapter >::type & | operator*= (const T &t) |
| Multiplies every component of this view by the scalar t. More... | |
| template<typename T > | |
| std::enable_if< IsScalar< T >::value, QuaternionVectorAdapter >::type & | operator/= (const T &t) |
| Divides every component of this view by the scalar t. More... | |
| template<typename E > | |
| QuaternionVectorAdapter & | assign (const VectorExpression< E > &e) |
| Assigns the vector expression e to this view without intermediate temporary (use only when e does not alias the wrapped quaternion). More... | |
| template<typename E > | |
| QuaternionVectorAdapter & | plusAssign (const VectorExpression< E > &e) |
| Adds the vector expression e to this view without intermediate temporary. More... | |
| template<typename E > | |
| QuaternionVectorAdapter & | minusAssign (const VectorExpression< E > &e) |
| Subtracts the vector expression e from this view without intermediate temporary. More... | |
| void | swap (QuaternionVectorAdapter &a) |
| Swaps the components of this view with those of a. More... | |
Public Member Functions inherited from CDPL::Math::VectorExpression< QuaternionVectorAdapter< Q > > | |
| const ExpressionType & | operator() () const |
Returns a const reference to the derived vector expression. More... | |
| ExpressionType & | operator() () |
| Returns a reference to the derived vector expression. More... | |
Friends | |
| void | swap (QuaternionVectorAdapter &a1, QuaternionVectorAdapter &a2) |
| ADL-enabled free-function form of swap(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Math::VectorExpression< QuaternionVectorAdapter< Q > > | |
| VectorExpression () | |
| ~VectorExpression () | |
Protected Member Functions inherited from CDPL::Math::Expression< E > | |
| Expression () | |
| ~Expression () | |
View adapter that exposes a quaternion as a 4-element vector expression (indices map to the components C1, C2, C3, C4).
| Q | The wrapped quaternion type. |
| typedef Q CDPL::Math::QuaternionVectorAdapter< Q >::QuaternionType |
The wrapped quaternion type.
| typedef std::size_t CDPL::Math::QuaternionVectorAdapter< Q >::SizeType |
The size type (std::size_t).
| typedef std::ptrdiff_t CDPL::Math::QuaternionVectorAdapter< Q >::DifferenceType |
The signed difference type (std::ptrdiff_t).
| typedef Q::ValueType CDPL::Math::QuaternionVectorAdapter< Q >::ValueType |
The element value type of the wrapped quaternion.
| typedef Q::ConstReference CDPL::Math::QuaternionVectorAdapter< Q >::ConstReference |
Constant reference type to an element of the wrapped quaternion.
| typedef std::conditional<std::is_const<Q>::value, typename Q::ConstReference, typename Q::Reference>::type CDPL::Math::QuaternionVectorAdapter< Q >::Reference |
Mutable reference type (degrades to ConstReference when the wrapped quaternion is const).
| typedef std::conditional<std::is_const<Q>::value, typename Q::ConstClosureType, typename Q::ClosureType>::type CDPL::Math::QuaternionVectorAdapter< Q >::QuaternionClosureType |
Closure type used to store the wrapped quaternion internally (mutable or const flavor).
| typedef const SelfType CDPL::Math::QuaternionVectorAdapter< Q >::ConstClosureType |
Constant closure type used when this adapter appears inside another expression.
| typedef SelfType CDPL::Math::QuaternionVectorAdapter< Q >::ClosureType |
Closure type used when this adapter appears inside another expression.
|
inlineexplicit |
Constructs the adapter wrapping the quaternion q.
| q | The quaternion to be viewed as a 4-element vector. |
|
inline |
Returns a mutable reference to the quaternion component at index i.
| i | The zero-based component index (0 = C1, 1 = C2, 2 = C3, 3 = C4). |
| Base::IndexError | if i is not in the range [0, 3]. |
|
inline |
Returns a const reference to the quaternion component at index i.
| i | The zero-based component index (0 = C1, 1 = C2, 2 = C3, 3 = C4). |
const reference to the component. | Base::IndexError | if i is not in the range [0, 3]. |
|
inline |
Returns a mutable reference to the quaternion component at index i (alias for operator()).
| i | The zero-based component index. |
| Base::IndexError | if i is not in the range [0, 3]. |
|
inline |
Returns a const reference to the quaternion component at index i (alias for operator()).
| i | The zero-based component index. |
const reference to the component. | Base::IndexError | if i is not in the range [0, 3]. |
|
inline |
Returns the dimensionality of the view (always 4).
|
inline |
Tells whether the view is empty (always false; the view is fixed-size with 4 components).
false.
|
inline |
Returns a reference to the wrapped quaternion (via its stored closure).
|
inline |
Returns a const reference to the wrapped quaternion (via its stored closure).
const reference to the wrapped quaternion closure.
|
inline |
Copies the components of a into this view (writing through to the wrapped quaternion).
| a | The source adapter. |
|
inline |
Assigns the vector expression e to this view (writing through to the wrapped quaternion).
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Adds the vector expression e componentwise to this view.
| E | The source vector expression type. |
| e | The vector expression to add. |
|
inline |
Subtracts the vector expression e componentwise from this view.
| E | The source vector expression type. |
| e | The vector expression to subtract. |
|
inline |
Multiplies every component of this view by the scalar t.
| T | The scalar type. |
| t | The scalar multiplier. |
|
inline |
Divides every component of this view by the scalar t.
| T | The scalar type. |
| t | The scalar divisor. |
|
inline |
Assigns the vector expression e to this view without intermediate temporary (use only when e does not alias the wrapped quaternion).
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Adds the vector expression e to this view without intermediate temporary.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Subtracts the vector expression e from this view without intermediate temporary.
| E | The source vector expression type. |
| e | The source vector expression. |
|
inline |
Swaps the components of this view with those of a.
| a | The adapter to swap with. |
|
friend |
ADL-enabled free-function form of swap().
| a1 | The first adapter. |
| a2 | The second adapter. |