27 #ifndef CDPL_MATH_VECTORADAPTER_HPP
28 #define CDPL_MATH_VECTORADAPTER_HPP
30 #include <type_traits>
57 typedef typename std::conditional<std::is_const<V>::value,
58 typename V::ConstReference,
60 typedef typename std::conditional<std::is_const<V>::value,
61 typename V::ConstClosureType,
67 data(v), extElem(1) {}
71 if (i == data.getSize())
79 if (i == data.getSize())
87 if (i == data.getSize())
95 if (i == data.getSize())
103 return (data.getSize() +
SizeType(1));
127 template <
typename E>
134 template <
typename E>
141 template <
typename E>
148 template <
typename T>
151 vectorAssignScalar<ScalarMultiplicationAssignment>(*
this, t);
155 template <
typename T>
158 vectorAssignScalar<ScalarDivisionAssignment>(*
this, t);
162 template <
typename E>
165 vectorAssignVector<ScalarAssignment>(*
this, e);
169 template <
typename E>
172 vectorAssignVector<ScalarAdditionAssignment>(*
this, e);
176 template <
typename E>
179 vectorAssignVector<ScalarSubtractionAssignment>(*
this, e);
199 template <
typename V>
209 typedef typename std::conditional<std::is_const<V>::value,
210 typename V::ConstReference,
212 typedef typename std::conditional<std::is_const<V>::value,
213 typename V::ConstClosureType,
277 template <
typename E>
284 template <
typename T>
295 template <
typename E>
302 template <
typename T>
310 template <
typename E>
317 template <
typename T>
325 template <
typename E>
332 template <
typename T>
336 quaternionAssignScalar<ScalarMultiplicationAssignment>(*
this, t);
340 template <
typename E>
347 template <
typename T>
351 quaternionAssignScalar<ScalarDivisionAssignment>(*
this, t);
355 template <
typename E>
358 quaternionAssignQuaternion<ScalarAssignment>(*
this, e);
362 template <
typename E>
365 quaternionAssignQuaternion<ScalarAdditionAssignment>(*
this, e);
369 template <
typename E>
372 quaternionAssignQuaternion<ScalarSubtractionAssignment>(*
this, e);
400 template <
typename T>
402 template <
typename V>
409 template <
typename V>
416 template <
typename V>
420 template <
typename V>
424 template <
typename E>
431 template <
typename E>
432 VectorQuaternionAdapter<const E>
438 template <
typename E>
439 HomogenousCoordsAdapter<E>
445 template <
typename E>
446 HomogenousCoordsAdapter<const E>
Definition of basic expression types.
Definition of various functors.
Implementation of quaternion assignment routines.
Definition of type traits.
Implementation of vector assignment routines.
Definition: VectorAdapter.hpp:47
const SelfType ConstClosureType
Definition: VectorAdapter.hpp:63
std::enable_if< IsScalar< T >::value, HomogenousCoordsAdapter >::type & operator*=(const T &t)
Definition: VectorAdapter.hpp:149
ConstReference operator[](SizeType i) const
Definition: VectorAdapter.hpp:93
HomogenousCoordsAdapter & minusAssign(const VectorExpression< E > &e)
Definition: VectorAdapter.hpp:177
V VectorType
Definition: VectorAdapter.hpp:52
SelfType ClosureType
Definition: VectorAdapter.hpp:64
std::conditional< std::is_const< V >::value, typename V::ConstReference, typename V::Reference >::type Reference
Definition: VectorAdapter.hpp:59
Reference operator()(SizeType i)
Definition: VectorAdapter.hpp:69
Reference operator[](SizeType i)
Definition: VectorAdapter.hpp:85
const VectorClosureType & getData() const
Definition: VectorAdapter.hpp:116
HomogenousCoordsAdapter & operator=(const HomogenousCoordsAdapter &va)
Definition: VectorAdapter.hpp:121
bool isEmpty() const
Definition: VectorAdapter.hpp:106
std::conditional< std::is_const< V >::value, typename V::ConstClosureType, typename V::ClosureType >::type VectorClosureType
Definition: VectorAdapter.hpp:62
HomogenousCoordsAdapter & operator+=(const VectorExpression< E > &e)
Definition: VectorAdapter.hpp:135
HomogenousCoordsAdapter & operator-=(const VectorExpression< E > &e)
Definition: VectorAdapter.hpp:142
SizeType getSize() const
Definition: VectorAdapter.hpp:101
HomogenousCoordsAdapter(VectorType &v)
Definition: VectorAdapter.hpp:66
HomogenousCoordsAdapter & operator=(const VectorExpression< E > &e)
Definition: VectorAdapter.hpp:128
void swap(HomogenousCoordsAdapter &va)
Definition: VectorAdapter.hpp:183
V::ValueType ValueType
Definition: VectorAdapter.hpp:55
std::enable_if< IsScalar< T >::value, HomogenousCoordsAdapter >::type & operator/=(const T &t)
Definition: VectorAdapter.hpp:156
V::ConstReference ConstReference
Definition: VectorAdapter.hpp:56
ConstReference operator()(SizeType i) const
Definition: VectorAdapter.hpp:77
V::DifferenceType DifferenceType
Definition: VectorAdapter.hpp:54
HomogenousCoordsAdapter & plusAssign(const VectorExpression< E > &e)
Definition: VectorAdapter.hpp:170
VectorClosureType & getData()
Definition: VectorAdapter.hpp:111
friend void swap(HomogenousCoordsAdapter &va1, HomogenousCoordsAdapter &va2)
Definition: VectorAdapter.hpp:189
V::SizeType SizeType
Definition: VectorAdapter.hpp:53
HomogenousCoordsAdapter & assign(const VectorExpression< E > &e)
Definition: VectorAdapter.hpp:163
Definition: Expression.hpp:98
Definition: Quaternion.hpp:239
Definition: Expression.hpp:54
Definition: VectorAdapter.hpp:201
VectorQuaternionAdapter & assign(const QuaternionExpression< E > &e)
Definition: VectorAdapter.hpp:356
Reference getC4()
Definition: VectorAdapter.hpp:236
Reference getC3()
Definition: VectorAdapter.hpp:231
VectorClosureType & getData()
Definition: VectorAdapter.hpp:261
V VectorType
Definition: VectorAdapter.hpp:206
ConstReference getC4() const
Definition: VectorAdapter.hpp:256
ConstReference getC1() const
Definition: VectorAdapter.hpp:241
std::enable_if< IsScalar< T >::value, VectorQuaternionAdapter >::type & operator-=(const T &t)
Definition: VectorAdapter.hpp:319
std::conditional< std::is_const< V >::value, typename V::ConstClosureType, typename V::ClosureType >::type VectorClosureType
Definition: VectorAdapter.hpp:214
V::ValueType ValueType
Definition: VectorAdapter.hpp:207
ConstReference getC2() const
Definition: VectorAdapter.hpp:246
VectorQuaternionAdapter & plusAssign(const QuaternionExpression< E > &e)
Definition: VectorAdapter.hpp:363
std::enable_if< IsScalar< T >::value, VectorQuaternionAdapter >::type & operator+=(const T &t)
Definition: VectorAdapter.hpp:304
void set(const ValueType &c1=ValueType(), const ValueType &c2=ValueType(), const ValueType &c3=ValueType(), const ValueType &c4=ValueType())
Definition: VectorAdapter.hpp:387
ConstReference getC3() const
Definition: VectorAdapter.hpp:251
VectorQuaternionAdapter & operator+=(const QuaternionExpression< E > &e)
Definition: VectorAdapter.hpp:296
const VectorClosureType & getData() const
Definition: VectorAdapter.hpp:266
Reference getC1()
Definition: VectorAdapter.hpp:221
SelfType ClosureType
Definition: VectorAdapter.hpp:216
VectorQuaternionAdapter & operator*=(const QuaternionExpression< E > &e)
Definition: VectorAdapter.hpp:326
std::conditional< std::is_const< V >::value, typename V::ConstReference, typename V::Reference >::type Reference
Definition: VectorAdapter.hpp:211
VectorQuaternionAdapter & operator=(const VectorQuaternionAdapter &a)
Definition: VectorAdapter.hpp:271
std::enable_if< IsScalar< T >::value, VectorQuaternionAdapter >::type & operator=(const T &t)
Definition: VectorAdapter.hpp:286
std::enable_if< IsScalar< T >::value, VectorQuaternionAdapter >::type & operator/=(const T &t)
Definition: VectorAdapter.hpp:349
VectorQuaternionAdapter(VectorType &v)
Definition: VectorAdapter.hpp:218
V::ConstReference ConstReference
Definition: VectorAdapter.hpp:208
Reference getC2()
Definition: VectorAdapter.hpp:226
std::enable_if< IsScalar< T >::value, VectorQuaternionAdapter >::type & operator*=(const T &t)
Definition: VectorAdapter.hpp:334
const SelfType ConstClosureType
Definition: VectorAdapter.hpp:215
void swap(VectorQuaternionAdapter &a)
Definition: VectorAdapter.hpp:376
VectorQuaternionAdapter & minusAssign(const QuaternionExpression< E > &e)
Definition: VectorAdapter.hpp:370
VectorQuaternionAdapter & operator=(const QuaternionExpression< E > &e)
Definition: VectorAdapter.hpp:278
VectorQuaternionAdapter & operator-=(const QuaternionExpression< E > &e)
Definition: VectorAdapter.hpp:311
friend void swap(VectorQuaternionAdapter &a1, VectorQuaternionAdapter &a2)
Definition: VectorAdapter.hpp:382
VectorQuaternionAdapter & operator/=(const QuaternionExpression< E > &e)
Definition: VectorAdapter.hpp:341
constexpr unsigned int V
Specifies Vanadium.
Definition: AtomType.hpp:177
constexpr unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
HomogenousCoordsAdapter< E > homog(VectorExpression< E > &e)
Definition: VectorAdapter.hpp:440
void quaternionSwap(Q &q, QuaternionExpression< E > &e)
Definition: QuaternionAssignment.hpp:65
void vectorSwap(V &v, VectorExpression< E > &e)
Definition: VectorAssignment.hpp:72
std::enable_if< IsScalar< T >::value, RealQuaternion< T > >::type quat(const T &t)
Definition: Quaternion.hpp:662
The namespace of the Chemical Data Processing Library.
Quaternion< typename V::ValueType > Type
Definition: VectorAdapter.hpp:406
Quaternion< typename V::ValueType > Type
Definition: VectorAdapter.hpp:413
Definition: TypeTraits.hpp:193
Q::QuaternionTemporaryType Type
Definition: TypeTraits.hpp:195
Definition: TypeTraits.hpp:179
V::VectorTemporaryType Type
Definition: TypeTraits.hpp:181