Chemical Data Processing Library C++ API - Version 1.1.1
Quaternion.hpp
Go to the documentation of this file.
1 /*
2  * Quaternion.hpp
3  *
4  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
27 #ifndef CDPL_MATH_QUATERNION_HPP
28 #define CDPL_MATH_QUATERNION_HPP
29 
30 #include <algorithm>
31 #include <utility>
32 #include <type_traits>
33 
36 #include "CDPL/Math/Functional.hpp"
37 #include "CDPL/Math/TypeTraits.hpp"
38 
39 
40 namespace CDPL
41 {
42 
43  namespace Math
44  {
45 
46  template <typename Q>
47  class QuaternionReference : public QuaternionExpression<QuaternionReference<Q> >
48  {
49 
51 
52  public:
53  typedef Q QuaternionType;
54  typedef typename Q::ValueType ValueType;
55  typedef typename std::conditional<std::is_const<Q>::value,
56  typename Q::ConstReference,
57  typename Q::Reference>::type Reference;
58  typedef typename Q::ConstReference ConstReference;
60  typedef const SelfType ConstClosureType;
61 
63  data(q) {}
64 
66  {
67  return data.getC1();
68  }
69 
71  {
72  return data.getC2();
73  }
74 
76  {
77  return data.getC3();
78  }
79 
81  {
82  return data.getC4();
83  }
84 
86  {
87  return data.getC1();
88  }
89 
91  {
92  return data.getC2();
93  }
94 
96  {
97  return data.getC3();
98  }
99 
101  {
102  return data.getC4();
103  }
104 
105  const QuaternionType& getData() const
106  {
107  return data;
108  }
109 
111  {
112  return data;
113  }
114 
116  {
117  data.operator=(r.data);
118  return *this;
119  }
120 
121  template <typename E>
123  {
124  data.operator=(e);
125  return *this;
126  }
127 
128  template <typename T>
129  typename std::enable_if<IsScalar<T>::value, QuaternionReference>::type&
130  operator=(const T& t)
131  {
132  data.operator=(t);
133  return *this;
134  }
135 
136  template <typename E>
138  {
139  data.operator+=(e);
140  return *this;
141  }
142 
143  template <typename T>
144  typename std::enable_if<IsScalar<T>::value, QuaternionReference>::type&
145  operator+=(const T& t)
146  {
147  data.operator+=(t);
148  return *this;
149  }
150 
151  template <typename E>
153  {
154  data.operator-=(e);
155  return *this;
156  }
157 
158  template <typename T>
159  typename std::enable_if<IsScalar<T>::value, QuaternionReference>::type&
160  operator-=(const T& t)
161  {
162  data.operator-=(t);
163  return *this;
164  }
165 
166  template <typename E>
168  {
169  data.operator*=(e);
170  return *this;
171  }
172 
173  template <typename T>
174  typename std::enable_if<IsScalar<T>::value, QuaternionReference>::type&
175  operator*=(const T& t)
176  {
177  data.operator*=(t);
178  return *this;
179  }
180 
181  template <typename E>
183  {
184  data.operator/=(e);
185  return *this;
186  }
187 
188  template <typename T>
189  typename std::enable_if<IsScalar<T>::value, QuaternionReference>::type&
190  operator/=(const T& t)
191  {
192  data.operator/=(t);
193  return *this;
194  }
195 
196  template <typename E>
198  {
199  data.assign(e);
200  return *this;
201  }
202 
203  template <typename E>
205  {
206  data.plusAssign(e);
207  return *this;
208  }
209 
210  template <typename E>
212  {
213  data.minusAssign(e);
214  return *this;
215  }
216 
218  {
219  data.swap(r.data);
220  }
221 
223  {
224  r1.swap(r2);
225  }
226 
227  void set(const ValueType& c1 = ValueType(), const ValueType& c2 = ValueType(),
228  const ValueType& c3 = ValueType(), const ValueType& c4 = ValueType())
229  {
230  data.set(c1, c2, c3, c4);
231  }
232 
233  private:
234  QuaternionType& data;
235  };
236 
237  template <typename T>
238  class Quaternion : public QuaternionContainer<Quaternion<T> >
239  {
240 
241  typedef Quaternion<T> SelfType;
242 
243  public:
244  typedef T ValueType;
245  typedef T& Reference;
246  typedef const T& ConstReference;
247  typedef ValueType ArrayType[4];
248  typedef T* Pointer;
249  typedef const T* ConstPointer;
253 
255 
256  explicit Quaternion(const ValueType& c1, const ValueType& c2 = ValueType(),
257  const ValueType& c3 = ValueType(), const ValueType& c4 = ValueType())
258  {
259  data[0] = c1;
260  data[1] = c2;
261  data[2] = c3;
262  data[3] = c4;
263  }
264 
266  {
267  std::copy(q.data, q.data + 4, data);
268  }
269 
270  template <typename E>
272  {
273  quaternionAssignQuaternion<ScalarAssignment>(*this, e);
274  }
275 
277  {
278  return data;
279  }
280 
282  {
283  return data;
284  }
285 
287  {
288  return data[0];
289  }
290 
292  {
293  return data[1];
294  }
295 
297  {
298  return data[2];
299  }
300 
302  {
303  return data[3];
304  }
305 
307  {
308  return data[0];
309  }
310 
312  {
313  return data[1];
314  }
315 
317  {
318  return data[2];
319  }
320 
322  {
323  return data[3];
324  }
325 
326  void set(const ValueType& c1 = ValueType(), const ValueType& c2 = ValueType(),
327  const ValueType& c3 = ValueType(), const ValueType& c4 = ValueType())
328  {
329  data[0] = c1;
330  data[1] = c2;
331  data[2] = c3;
332  data[3] = c4;
333  }
334 
336  {
337  if (this != &q)
338  std::copy(q.data, q.data + 4, data);
339 
340  return *this;
341  }
342 
343  template <typename C>
345  {
346  return assign(c);
347  }
348 
349  template <typename E>
351  {
352  Quaternion tmp(e);
353 
354  return this->operator=(tmp);
355  }
356 
357  template <typename T1>
358  typename std::enable_if<IsScalar<T1>::value, Quaternion>::type&
359  operator=(const T1& t)
360  {
361  data[0] = t;
362  data[1] = ValueType();
363  data[2] = ValueType();
364  data[3] = ValueType();
365 
366  return *this;
367  }
368 
369  template <typename T1>
370  typename std::enable_if<IsScalar<T1>::value, Quaternion>::type&
371  operator+=(const T1& t)
372  {
373  data[0] += t;
374  return *this;
375  }
376 
377  template <typename C>
379  {
380  return plusAssign(c);
381  }
382 
383  template <typename E>
385  {
386  Quaternion tmp(*this + e);
387 
388  return this->operator=(tmp);
389  }
390 
391  template <typename T1>
392  typename std::enable_if<IsScalar<T1>::value, Quaternion>::type&
393  operator-=(const T1& t)
394  {
395  data[0] -= t;
396  return *this;
397  }
398 
399  template <typename C>
401  {
402  return minusAssign(c);
403  }
404 
405  template <typename E>
407  {
408  Quaternion tmp(*this - e);
409 
410  return this->operator=(tmp);
411  }
412 
413  template <typename T1>
414  typename std::enable_if<IsScalar<T1>::value, Quaternion>::type&
415  operator*=(const T1& t)
416  {
417  quaternionAssignScalar<ScalarMultiplicationAssignment>(*this, t);
418  return *this;
419  }
420 
421  template <typename E>
423  {
424  Quaternion tmp(*this * e);
425 
426  return this->operator=(tmp);
427  }
428 
429  template <typename T1>
430  typename std::enable_if<IsScalar<T1>::value, Quaternion>::type&
431  operator/=(const T1& t)
432  {
433  quaternionAssignScalar<ScalarDivisionAssignment>(*this, t);
434  return *this;
435  }
436 
437  template <typename E>
439  {
440  Quaternion tmp(*this / e);
441 
442  return this->operator=(tmp);
443  }
444 
445  template <typename E>
447  {
448  quaternionAssignQuaternion<ScalarAssignment>(*this, e);
449  return *this;
450  }
451 
452  template <typename E>
454  {
455  quaternionAssignQuaternion<ScalarAdditionAssignment>(*this, e);
456  return *this;
457  }
458 
459  template <typename E>
461  {
462  quaternionAssignQuaternion<ScalarSubtractionAssignment>(*this, e);
463  return *this;
464  }
465 
466  void swap(Quaternion& q)
467  {
468  if (this != &q)
469  std::swap_ranges(data, data + 4, q.data);
470  }
471 
472  friend void swap(Quaternion& q1, Quaternion& q2)
473  {
474  q1.swap(q2);
475  }
476 
477  private:
478  ArrayType data;
479  };
480 
481  template <typename T>
482  class RealQuaternion : public QuaternionContainer<RealQuaternion<T> >
483  {
484 
485  typedef RealQuaternion<T> SelfType;
486 
487  public:
488  typedef T ValueType;
489  typedef const T& Reference;
490  typedef const T& ConstReference;
494 
496  value() {}
497 
499  value(r) {}
500 
501  template <typename T1>
503  value(q.getC1())
504  {}
505 
507  {
508  return value;
509  }
510 
512  {
513  return zero;
514  }
515 
517  {
518  return zero;
519  }
520 
522  {
523  return zero;
524  }
525 
526  operator ValueType() const
527  {
528  return value;
529  }
530 
532  {
533  value = q.value;
534  return *this;
535  }
536 
537  template <typename T1>
539  {
540  value = q.getC1();
541  return *this;
542  }
543 
544  template <typename T1>
545  typename std::enable_if<IsScalar<T1>::value, RealQuaternion>::type&
546  operator=(const T1& t)
547  {
548  value = t;
549  return *this;
550  }
551 
552  template <typename T1>
554  {
555  value += q.getC1();
556  return *this;
557  }
558 
559  template <typename T1>
560  typename std::enable_if<IsScalar<T1>::value, RealQuaternion>::type&
561  operator+=(const T1& t)
562  {
563  value += t;
564  return *this;
565  }
566 
567  template <typename T1>
569  {
570  value -= q.getC1();
571  return *this;
572  }
573 
574  template <typename T1>
575  typename std::enable_if<IsScalar<T1>::value, RealQuaternion>::type&
576  operator-=(const T1& t)
577  {
578  value -= t;
579  return *this;
580  }
581 
582  template <typename T1>
584  {
585  value *= q.getC1();
586  return *this;
587  }
588 
589  template <typename T1>
590  typename std::enable_if<IsScalar<T1>::value, RealQuaternion>::type&
591  operator*=(const T1& t)
592  {
593  value *= t;
594  return *this;
595  }
596 
597  template <typename T1>
599  {
600  value /= q.getC1();
601  return *this;
602  }
603 
604  template <typename T1>
605  typename std::enable_if<IsScalar<T1>::value, RealQuaternion>::type&
606  operator/=(const T1& t)
607  {
608  value /= t;
609  return *this;
610  }
611 
612  template <typename T1>
614  {
615  value = q.getC1();
616  return *this;
617  }
618 
619  template <typename T1>
621  {
622  value += q.getC1();
623  return *this;
624  }
625 
626  template <typename T1>
628  {
629  value -= q.getC1();
630  return *this;
631  }
632 
634  {
635  if (this != &q)
636  std::swap(value, q.value);
637  }
638 
639  friend void swap(RealQuaternion& q1, RealQuaternion& q2)
640  {
641  q1.swap(q2);
642  }
643 
644  private:
645  ValueType value;
646  static const ValueType zero;
647  };
648 
649  template <typename T>
650  const typename RealQuaternion<T>::ValueType RealQuaternion<T>::zero = RealQuaternion<T>::ValueType();
651 
652  template <typename Q>
654  {};
655 
656  template <typename Q>
658  {};
659 
660  template <typename T>
661  typename std::enable_if<IsScalar<T>::value, RealQuaternion<T> >::type
662  quat(const T& t)
663  {
664  return RealQuaternion<T>(t);
665  }
666 
667  template <typename T1, typename T2>
668  Quaternion<typename CommonType<T1, T2>::Type>
669  quat(const T1& t1, const T2& t2)
670  {
671  typedef Quaternion<typename CommonType<T1, T2>::Type> QuaternionType;
672 
673  return QuaternionType(t1, t2);
674  }
675 
676  template <typename T1, typename T2, typename T3>
677  Quaternion<typename CommonType<typename CommonType<T1, T2>::Type, T3>::Type>
678  quat(const T1& t1, const T2& t2, const T3& t3)
679  {
680  typedef Quaternion<typename CommonType<typename CommonType<T1, T2>::Type, T3>::Type> QuaternionType;
681 
682  return QuaternionType(t1, t2, t3);
683  }
684 
685  template <typename T1, typename T2, typename T3, typename T4>
686  Quaternion<typename CommonType<typename CommonType<typename CommonType<T1, T2>::Type, T3>::Type, T4>::Type>
687  quat(const T1& t1, const T2& t2, const T3& t3, const T4& t4)
688  {
690 
691  return QuaternionType(t1, t2, t3, t4);
692  }
693 
698 
703  } // namespace Math
704 } // namespace CDPL
705 
706 #endif // CDPL_MATH_QUATERNION_HPP
CDPL::Math::Quaternion::ConstReference
const T & ConstReference
Definition: Quaternion.hpp:246
CDPL::Math::Quaternion::getC1
ConstReference getC1() const
Definition: Quaternion.hpp:306
CDPL::Chem::AtomType::Q
const unsigned int Q
A generic type that covers any element except hydrogen and carbon.
Definition: AtomType.hpp:627
CDPL::Math::Quaternion::Reference
T & Reference
Definition: Quaternion.hpp:245
CDPL::Math::Quaternion::operator-=
Quaternion & operator-=(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:406
CDPL::Math::Quaternion::getData
ConstPointer getData() const
Definition: Quaternion.hpp:281
CDPL::Math::QuaternionReference::operator=
QuaternionReference & operator=(const QuaternionReference &r)
Definition: Quaternion.hpp:115
CDPL::Math::RealQuaternion::operator=
RealQuaternion & operator=(const RealQuaternion &q)
Definition: Quaternion.hpp:531
CDPL::Math::RealQuaternion::ConstClosureType
const QuaternionReference< const SelfType > ConstClosureType
Definition: Quaternion.hpp:492
CDPL::Math::RealQuaternion::operator/=
std::enable_if< IsScalar< T1 >::value, RealQuaternion >::type & operator/=(const T1 &t)
Definition: Quaternion.hpp:606
CDPL::Math::RealQuaternion::swap
friend void swap(RealQuaternion &q1, RealQuaternion &q2)
Definition: Quaternion.hpp:639
CDPL::Math::RealQuaternion::plusAssign
RealQuaternion & plusAssign(const RealQuaternion< T1 > &q)
Definition: Quaternion.hpp:620
CDPL::Math::RealQuaternion::getC4
ConstReference getC4() const
Definition: Quaternion.hpp:521
CDPL::Math::QuaternionReference::minusAssign
QuaternionReference & minusAssign(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:211
CDPL::Math::QuaternionReference::getC1
ConstReference getC1() const
Definition: Quaternion.hpp:85
CDPL::Math::QuaternionReference::swap
friend void swap(QuaternionReference &r1, QuaternionReference &r2)
Definition: Quaternion.hpp:222
CDPL::Math::QuaternionReference::operator*=
QuaternionReference & operator*=(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:167
CDPL::Math::QuaternionReference::operator*=
std::enable_if< IsScalar< T >::value, QuaternionReference >::type & operator*=(const T &t)
Definition: Quaternion.hpp:175
CDPL::Math::RealQuaternion
Definition: Quaternion.hpp:483
CDPL::Math::Quaternion::operator=
Quaternion & operator=(const Quaternion &q)
Definition: Quaternion.hpp:335
CDPL::Math::QuaternionReference::ClosureType
SelfType ClosureType
Definition: Quaternion.hpp:59
CDPL::Math::Quaternion::operator+=
Quaternion & operator+=(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:384
CDPL::Math::Quaternion::swap
friend void swap(Quaternion &q1, Quaternion &q2)
Definition: Quaternion.hpp:472
CDPL::Math::Quaternion::operator+=
std::enable_if< IsScalar< T1 >::value, Quaternion >::type & operator+=(const T1 &t)
Definition: Quaternion.hpp:371
CDPL::Math::QuaternionReference::assign
QuaternionReference & assign(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:197
CDPL::Math::quat
std::enable_if< IsScalar< T >::value, RealQuaternion< T > >::type quat(const T &t)
Definition: Quaternion.hpp:662
CDPL::Math::RealQuaternion::ConstReference
const T & ConstReference
Definition: Quaternion.hpp:490
CDPL::Math::RealQuaternion::RealQuaternion
RealQuaternion()
Definition: Quaternion.hpp:495
CDPL::Math::Quaternion::ArrayType
ValueType ArrayType[4]
Definition: Quaternion.hpp:247
CDPL::Math::QuaternionReference::QuaternionReference
QuaternionReference(QuaternionType &q)
Definition: Quaternion.hpp:62
CDPL::Math::Quaternion::swap
void swap(Quaternion &q)
Definition: Quaternion.hpp:466
CDPL::Math::Quaternion
Definition: Quaternion.hpp:239
CDPL::Math::Quaternion::Pointer
T * Pointer
Definition: Quaternion.hpp:248
CDPL::Math::RealQuaternion::swap
void swap(RealQuaternion &q)
Definition: Quaternion.hpp:633
CDPL::Math::ULRealQuaternion
RealQuaternion< unsigned long > ULRealQuaternion
Definition: Quaternion.hpp:702
CDPL::Math::RealQuaternion::operator-=
std::enable_if< IsScalar< T1 >::value, RealQuaternion >::type & operator-=(const T1 &t)
Definition: Quaternion.hpp:576
CDPL::Math::QuaternionReference::ConstClosureType
const SelfType ConstClosureType
Definition: Quaternion.hpp:60
CDPL::Math::QuaternionReference::getC3
ConstReference getC3() const
Definition: Quaternion.hpp:95
QuaternionExpression.hpp
Definition of various quaternion expression types and operations.
CDPL::Math::QuaternionContainer
Definition: Expression.hpp:186
CDPL::Math::Quaternion::getC4
ConstReference getC4() const
Definition: Quaternion.hpp:321
CDPL::Math::RealQuaternion::operator-=
RealQuaternion & operator-=(const RealQuaternion< T1 > &q)
Definition: Quaternion.hpp:568
CDPL::Math::Quaternion::operator*=
std::enable_if< IsScalar< T1 >::value, Quaternion >::type & operator*=(const T1 &t)
Definition: Quaternion.hpp:415
CDPL::Math::QuaternionReference::operator+=
std::enable_if< IsScalar< T >::value, QuaternionReference >::type & operator+=(const T &t)
Definition: Quaternion.hpp:145
CDPL::Math::RealQuaternion::getC2
ConstReference getC2() const
Definition: Quaternion.hpp:511
CDPL::Math::RealQuaternion::getC1
ConstReference getC1() const
Definition: Quaternion.hpp:506
CDPL::Math::QuaternionExpression
Definition: Expression.hpp:98
CDPL::Math::RealQuaternion::Reference
const T & Reference
Definition: Quaternion.hpp:489
CDPL::Math::QuaternionReference::ConstReference
Q::ConstReference ConstReference
Definition: Quaternion.hpp:58
CDPL::Math::Quaternion::operator=
Quaternion & operator=(const QuaternionContainer< C > &c)
Definition: Quaternion.hpp:344
CDPL::Math::Quaternion::operator/=
std::enable_if< IsScalar< T1 >::value, Quaternion >::type & operator/=(const T1 &t)
Definition: Quaternion.hpp:431
CDPL::Math::QuaternionReference::QuaternionType
Q QuaternionType
Definition: Quaternion.hpp:53
CDPL::Math::QuaternionReference::operator=
std::enable_if< IsScalar< T >::value, QuaternionReference >::type & operator=(const T &t)
Definition: Quaternion.hpp:130
CDPL::Math::RealQuaternion::ValueType
T ValueType
Definition: Quaternion.hpp:488
CDPL::Math::QuaternionReference::operator=
QuaternionReference & operator=(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:122
CDPL::Math::FRealQuaternion
RealQuaternion< float > FRealQuaternion
Definition: Quaternion.hpp:699
CDPL::Math::Quaternion::Quaternion
Quaternion(const Quaternion &q)
Definition: Quaternion.hpp:265
CDPL::Math::Quaternion::getC3
ConstReference getC3() const
Definition: Quaternion.hpp:316
CDPL::Math::QuaternionReference::operator-=
std::enable_if< IsScalar< T >::value, QuaternionReference >::type & operator-=(const T &t)
Definition: Quaternion.hpp:160
CDPL::Math::RealQuaternion::getC3
ConstReference getC3() const
Definition: Quaternion.hpp:516
CDPL::Math::RealQuaternion::operator*=
RealQuaternion & operator*=(const RealQuaternion< T1 > &q)
Definition: Quaternion.hpp:583
CDPL::Math::QuaternionReference::operator+=
QuaternionReference & operator+=(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:137
CDPL::Math::Quaternion::getC3
Reference getC3()
Definition: Quaternion.hpp:296
CDPL::Math::Quaternion::getC2
ConstReference getC2() const
Definition: Quaternion.hpp:311
CDPL::Math::QuaternionReference::Reference
std::conditional< std::is_const< Q >::value, typename Q::ConstReference, typename Q::Reference >::type Reference
Definition: Quaternion.hpp:57
CDPL::Math::Quaternion::Quaternion
Quaternion(const ValueType &c1, const ValueType &c2=ValueType(), const ValueType &c3=ValueType(), const ValueType &c4=ValueType())
Definition: Quaternion.hpp:256
TypeTraits.hpp
Definition of type traits.
CDPL::Math::QuaternionReference::getC3
Reference getC3()
Definition: Quaternion.hpp:75
CDPL::Math::Quaternion::QuaternionTemporaryType
SelfType QuaternionTemporaryType
Definition: Quaternion.hpp:252
CDPL::Math::Quaternion::plusAssign
Quaternion & plusAssign(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:453
CDPL::Math::QuaternionReference::getData
const QuaternionType & getData() const
Definition: Quaternion.hpp:105
CDPL::Math::LRealQuaternion
RealQuaternion< long > LRealQuaternion
Definition: Quaternion.hpp:701
CDPL::Math::QuaternionReference::set
void set(const ValueType &c1=ValueType(), const ValueType &c2=ValueType(), const ValueType &c3=ValueType(), const ValueType &c4=ValueType())
Definition: Quaternion.hpp:227
CDPL::Math::RealQuaternion::RealQuaternion
RealQuaternion(const ValueType &r)
Definition: Quaternion.hpp:498
CDPL::Math::Quaternion::getC1
Reference getC1()
Definition: Quaternion.hpp:286
Functional.hpp
Definition of various functors.
CDPL::Math::Quaternion::minusAssign
Quaternion & minusAssign(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:460
CDPL::Math::QuaternionTemporaryTraits
Definition: TypeTraits.hpp:193
CDPL::Math::RealQuaternion::assign
RealQuaternion & assign(const RealQuaternion< T1 > &q)
Definition: Quaternion.hpp:613
CDPL::Math::QuaternionReference::getC4
ConstReference getC4() const
Definition: Quaternion.hpp:100
QuaternionAssignment.hpp
Implementation of quaternion assignment routines.
CDPL::Chem::AtomType::T
const unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
CDPL::Math::Quaternion::ConstPointer
const T * ConstPointer
Definition: Quaternion.hpp:249
CDPL::Math::Quaternion::operator-=
std::enable_if< IsScalar< T1 >::value, Quaternion >::type & operator-=(const T1 &t)
Definition: Quaternion.hpp:393
CDPL::Math::Quaternion::operator=
Quaternion & operator=(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:350
CDPL::Chem::CIPDescriptor::r
const unsigned int r
Specifies that the stereocenter has r configuration.
Definition: CIPDescriptor.hpp:76
CDPL::Math::LQuaternion
Quaternion< long > LQuaternion
Definition: Quaternion.hpp:696
CDPL::Math::RealQuaternion::operator=
RealQuaternion & operator=(const RealQuaternion< T1 > &q)
Definition: Quaternion.hpp:538
CDPL::Math::Quaternion::operator+=
Quaternion & operator+=(const QuaternionContainer< C > &c)
Definition: Quaternion.hpp:378
CDPL::Math::Quaternion::ValueType
T ValueType
Definition: Quaternion.hpp:244
CDPL::Math::Quaternion::getData
Pointer getData()
Definition: Quaternion.hpp:276
CDPL::Math::QuaternionReference::getC2
ConstReference getC2() const
Definition: Quaternion.hpp:90
CDPL::Math::RealQuaternion::operator=
std::enable_if< IsScalar< T1 >::value, RealQuaternion >::type & operator=(const T1 &t)
Definition: Quaternion.hpp:546
CDPL::Math::RealQuaternion::minusAssign
RealQuaternion & minusAssign(const RealQuaternion< T1 > &q)
Definition: Quaternion.hpp:627
CDPL::Math::QuaternionReference::operator-=
QuaternionReference & operator-=(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:152
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Math::QuaternionReference::getData
QuaternionType & getData()
Definition: Quaternion.hpp:110
CDPL::Math::RealQuaternion::operator+=
RealQuaternion & operator+=(const RealQuaternion< T1 > &q)
Definition: Quaternion.hpp:553
CDPL::Math::QuaternionReference::getC4
Reference getC4()
Definition: Quaternion.hpp:80
CDPL::Math::RealQuaternion::operator+=
std::enable_if< IsScalar< T1 >::value, RealQuaternion >::type & operator+=(const T1 &t)
Definition: Quaternion.hpp:561
CDPL::Math::Quaternion::ConstClosureType
const QuaternionReference< const SelfType > ConstClosureType
Definition: Quaternion.hpp:251
CDPL::Math::QuaternionReference
Definition: Quaternion.hpp:48
CDPL::Math::Quaternion::operator-=
Quaternion & operator-=(const QuaternionContainer< C > &c)
Definition: Quaternion.hpp:400
CDPL::Math::RealQuaternion::RealQuaternion
RealQuaternion(const RealQuaternion< T1 > &q)
Definition: Quaternion.hpp:502
CDPL::Math::Quaternion::set
void set(const ValueType &c1=ValueType(), const ValueType &c2=ValueType(), const ValueType &c3=ValueType(), const ValueType &c4=ValueType())
Definition: Quaternion.hpp:326
CDPL::Math::QuaternionReference::ValueType
Q::ValueType ValueType
Definition: Quaternion.hpp:54
CDPL::Math::QuaternionReference::plusAssign
QuaternionReference & plusAssign(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:204
CDPL::Math::Quaternion::ClosureType
QuaternionReference< SelfType > ClosureType
Definition: Quaternion.hpp:250
CDPL::Math::Quaternion::operator*=
Quaternion & operator*=(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:422
CDPL::Math::Quaternion::assign
Quaternion & assign(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:446
CDPL::Math::RealQuaternion::ClosureType
QuaternionReference< SelfType > ClosureType
Definition: Quaternion.hpp:491
CDPL::Math::Quaternion::Quaternion
Quaternion()
Definition: Quaternion.hpp:254
CDPL::Math::Quaternion::Quaternion
Quaternion(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:271
CDPL::Math::RealQuaternion::operator*=
std::enable_if< IsScalar< T1 >::value, RealQuaternion >::type & operator*=(const T1 &t)
Definition: Quaternion.hpp:591
CDPL::Math::RealQuaternion::operator/=
RealQuaternion & operator/=(const RealQuaternion< T1 > &q)
Definition: Quaternion.hpp:598
CDPL::Math::FQuaternion
Quaternion< float > FQuaternion
Definition: Quaternion.hpp:694
CDPL::Math::QuaternionReference::getC2
Reference getC2()
Definition: Quaternion.hpp:70
CDPL::Math::QuaternionReference::operator/=
std::enable_if< IsScalar< T >::value, QuaternionReference >::type & operator/=(const T &t)
Definition: Quaternion.hpp:190
CDPL::Math::DRealQuaternion
RealQuaternion< double > DRealQuaternion
Definition: Quaternion.hpp:700
CDPL::Math::ULQuaternion
Quaternion< unsigned long > ULQuaternion
Definition: Quaternion.hpp:697
CDPL::Math::QuaternionReference::operator/=
QuaternionReference & operator/=(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:182
CDPL::Math::QuaternionReference::swap
void swap(QuaternionReference &r)
Definition: Quaternion.hpp:217
CDPL::Math::Quaternion::operator=
std::enable_if< IsScalar< T1 >::value, Quaternion >::type & operator=(const T1 &t)
Definition: Quaternion.hpp:359
CDPL::Math::DQuaternion
Quaternion< double > DQuaternion
Definition: Quaternion.hpp:695
CDPL::Math::Quaternion::getC4
Reference getC4()
Definition: Quaternion.hpp:301
CDPL::Math::RealQuaternion::QuaternionTemporaryType
Quaternion< T > QuaternionTemporaryType
Definition: Quaternion.hpp:493
CDPL::Math::QuaternionReference::getC1
Reference getC1()
Definition: Quaternion.hpp:65
CDPL::Math::Quaternion::getC2
Reference getC2()
Definition: Quaternion.hpp:291
CDPL::Math::Quaternion::operator/=
Quaternion & operator/=(const QuaternionExpression< E > &e)
Definition: Quaternion.hpp:438