Chemical Data Processing Library C++ API - Version 1.1.1
QuaternionExpression.hpp
Go to the documentation of this file.
1 /*
2  * QuaternionExpression.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_QUATERNIONEXPRESSION_HPP
28 #define CDPL_MATH_QUATERNIONEXPRESSION_HPP
29 
30 #include <type_traits>
31 
32 #include "CDPL/Math/Expression.hpp"
33 #include "CDPL/Math/CommonType.hpp"
34 #include "CDPL/Math/Functional.hpp"
35 #include "CDPL/Math/TypeTraits.hpp"
36 
37 
38 namespace CDPL
39 {
40 
41  namespace Math
42  {
43 
44  template <typename E, typename F>
45  class QuaternionUnary1 : public QuaternionExpression<QuaternionUnary1<E, F> >
46  {
47 
49  typedef F FunctorType;
50  typedef E ExpressionType;
51  typedef typename E::ConstClosureType ExpressionClosureType;
52 
53  public:
54  typedef typename F::ResultType ValueType;
55  typedef const ValueType ConstReference;
56  typedef const ValueType Reference;
57  typedef const SelfType ConstClosureType;
59 
60  QuaternionUnary1(const ExpressionType& e):
61  expr(e) {}
62 
64  {
65  return FunctorType::apply(expr.getC1());
66  }
67 
69  {
70  return FunctorType::apply(expr.getC2());
71  }
72 
74  {
75  return FunctorType::apply(expr.getC3());
76  }
77 
79  {
80  return FunctorType::apply(expr.getC4());
81  }
82 
83  private:
84  ExpressionClosureType expr;
85  };
86 
87  template <typename E, typename F>
89  {
90 
93  };
94 
95  template <typename E, typename F>
96  class QuaternionUnary2 : public QuaternionExpression<QuaternionUnary2<E, F> >
97  {
98 
100  typedef F FunctorType;
101  typedef E ExpressionType;
102  typedef typename E::ConstClosureType ExpressionClosureType;
103 
104  public:
105  typedef typename F::ResultType ValueType;
106  typedef const ValueType ConstReference;
107  typedef const ValueType Reference;
108  typedef const SelfType ConstClosureType;
110 
111  QuaternionUnary2(const ExpressionType& e):
112  expr(e) {}
113 
115  {
116  return FunctorType::applyC1(expr);
117  }
118 
120  {
121  return FunctorType::applyC2(expr);
122  }
123 
125  {
126  return FunctorType::applyC3(expr);
127  }
128 
130  {
131  return FunctorType::applyC4(expr);
132  }
133 
134  private:
135  ExpressionClosureType expr;
136  };
137 
138  template <typename E, typename F>
140  {
141 
144  };
145 
146  template <typename E1, typename E2, typename F>
147  class QuaternionBinary1 : public QuaternionExpression<QuaternionBinary1<E1, E2, F> >
148  {
149 
151  typedef F FunctorType;
152  typedef E1 Expression1Type;
153  typedef E2 Expression2Type;
154  typedef typename E1::ConstClosureType Expression1ClosureType;
155  typedef typename E2::ConstClosureType Expression2ClosureType;
156 
157  public:
158  typedef typename F::ResultType ValueType;
159  typedef const ValueType ConstReference;
160  typedef const ValueType Reference;
161  typedef const SelfType ConstClosureType;
163 
164  QuaternionBinary1(const Expression1Type& e1, const Expression2Type& e2):
165  expr1(e1), expr2(e2) {}
166 
168  {
169  return FunctorType::apply(expr1.getC1(), expr2.getC1());
170  }
171 
173  {
174  return FunctorType::apply(expr1.getC2(), expr2.getC2());
175  }
176 
178  {
179  return FunctorType::apply(expr1.getC3(), expr2.getC3());
180  }
181 
183  {
184  return FunctorType::apply(expr1.getC4(), expr2.getC4());
185  }
186 
187  private:
188  Expression1ClosureType expr1;
189  Expression2ClosureType expr2;
190  };
191 
192  template <typename E1, typename E2, typename F>
194  {
195 
198  };
199 
200  template <typename E1, typename E2, typename F>
201  class QuaternionBinary2 : public QuaternionExpression<QuaternionBinary2<E1, E2, F> >
202  {
203 
205  typedef F FunctorType;
206  typedef E1 Expression1Type;
207  typedef E2 Expression2Type;
208  typedef typename E1::ConstClosureType Expression1ClosureType;
209  typedef typename E2::ConstClosureType Expression2ClosureType;
210 
211  public:
212  typedef typename F::ResultType ValueType;
213  typedef const ValueType ConstReference;
214  typedef const ValueType Reference;
215  typedef const SelfType ConstClosureType;
217 
218  QuaternionBinary2(const Expression1Type& e1, const Expression2Type& e2):
219  expr1(e1), expr2(e2) {}
220 
222  {
223  return FunctorType::applyC1(expr1, expr2);
224  }
225 
227  {
228  return FunctorType::applyC2(expr1, expr2);
229  }
230 
232  {
233  return FunctorType::applyC3(expr1, expr2);
234  }
235 
237  {
238  return FunctorType::applyC4(expr1, expr2);
239  }
240 
241  private:
242  Expression1ClosureType expr1;
243  Expression2ClosureType expr2;
244  };
245 
246  template <typename E1, typename E2, typename F>
248  {
249 
252  };
253 
254  template <typename E1, typename E2, typename F>
255  class Scalar1QuaternionBinary1 : public QuaternionExpression<Scalar1QuaternionBinary1<E1, E2, F> >
256  {
257 
259  typedef F FunctorType;
260  typedef E1 Expression1Type;
261  typedef E2 Expression2Type;
262  typedef const E1 Expression1ClosureType;
263  typedef typename E2::ConstClosureType Expression2ClosureType;
264 
265  public:
266  typedef typename F::ResultType ValueType;
267  typedef const ValueType ConstReference;
268  typedef const ValueType Reference;
269  typedef const SelfType ConstClosureType;
271 
272  Scalar1QuaternionBinary1(const Expression1Type& e1, const Expression2Type& e2):
273  expr1(e1), expr2(e2) {}
274 
276  {
277  return FunctorType::apply(expr1, expr2.getC1());
278  }
279 
281  {
282  return FunctorType::apply(expr1, expr2.getC2());
283  }
284 
286  {
287  return FunctorType::apply(expr1, expr2.getC3());
288  }
289 
291  {
292  return FunctorType::apply(expr1, expr2.getC4());
293  }
294 
295  private:
296  Expression1ClosureType expr1;
297  Expression2ClosureType expr2;
298  };
299 
300  template <typename E1, typename E2, typename F>
302  {
303 
306  };
307 
308  template <typename E1, typename E2, typename F>
309  class Scalar1QuaternionBinary2 : public QuaternionExpression<Scalar1QuaternionBinary2<E1, E2, F> >
310  {
311 
313  typedef F FunctorType;
314  typedef E1 Expression1Type;
315  typedef E2 Expression2Type;
316  typedef const E1 Expression1ClosureType;
317  typedef typename E2::ConstClosureType Expression2ClosureType;
318 
319  public:
320  typedef typename F::ResultType ValueType;
321  typedef const ValueType ConstReference;
322  typedef const ValueType Reference;
323  typedef const SelfType ConstClosureType;
325 
326  Scalar1QuaternionBinary2(const Expression1Type& e1, const Expression2Type& e2):
327  expr1(e1), expr2(e2) {}
328 
330  {
331  return FunctorType::applyC1(expr1, expr2);
332  }
333 
335  {
336  return FunctorType::applyC2(expr1, expr2);
337  }
338 
340  {
341  return FunctorType::applyC3(expr1, expr2);
342  }
343 
345  {
346  return FunctorType::applyC4(expr1, expr2);
347  }
348 
349  private:
350  Expression1ClosureType expr1;
351  Expression2ClosureType expr2;
352  };
353 
354  template <typename E1, typename E2, typename F>
356  {
357 
360  };
361 
362  template <typename E1, typename E2, typename F>
363  class Scalar2QuaternionBinary1 : public QuaternionExpression<Scalar2QuaternionBinary1<E1, E2, F> >
364  {
365 
367  typedef F FunctorType;
368  typedef E1 Expression1Type;
369  typedef E2 Expression2Type;
370  typedef typename E1::ConstClosureType Expression1ClosureType;
371  typedef const E2 Expression2ClosureType;
372 
373  public:
374  typedef typename F::ResultType ValueType;
375  typedef const ValueType ConstReference;
376  typedef const ValueType Reference;
377  typedef const SelfType ConstClosureType;
379 
380  Scalar2QuaternionBinary1(const Expression1Type& e1, const Expression2Type& e2):
381  expr1(e1), expr2(e2) {}
382 
384  {
385  return FunctorType::apply(expr1.getC1(), expr2);
386  }
387 
389  {
390  return FunctorType::apply(expr1.getC2(), expr2);
391  }
392 
394  {
395  return FunctorType::apply(expr1.getC3(), expr2);
396  }
397 
399  {
400  return FunctorType::apply(expr1.getC4(), expr2);
401  }
402 
403  private:
404  Expression1ClosureType expr1;
405  Expression2ClosureType expr2;
406  };
407 
408  template <typename E1, typename E2, typename F>
410  {
411 
414  };
415 
416  template <typename E1, typename E2, typename F>
417  class Scalar2QuaternionBinary2 : public QuaternionExpression<Scalar2QuaternionBinary2<E1, E2, F> >
418  {
419 
421  typedef F FunctorType;
422  typedef E1 Expression1Type;
423  typedef E2 Expression2Type;
424  typedef typename E1::ConstClosureType Expression1ClosureType;
425  typedef const E2 Expression2ClosureType;
426 
427  public:
428  typedef typename F::ResultType ValueType;
429  typedef const ValueType ConstReference;
430  typedef const ValueType Reference;
431  typedef const SelfType ConstClosureType;
433 
434  Scalar2QuaternionBinary2(const Expression1Type& e1, const Expression2Type& e2):
435  expr1(e1), expr2(e2) {}
436 
438  {
439  return FunctorType::applyC1(expr1, expr2);
440  }
441 
443  {
444  return FunctorType::applyC2(expr1, expr2);
445  }
446 
448  {
449  return FunctorType::applyC3(expr1, expr2);
450  }
451 
453  {
454  return FunctorType::applyC4(expr1, expr2);
455  }
456 
457  private:
458  Expression1ClosureType expr1;
459  Expression2ClosureType expr2;
460  };
461 
462  template <typename E1, typename E2, typename F>
464  {
465 
468  };
469 
470  template <typename E1, typename E2, typename E3, typename F>
471  class Scalar3QuaternionTernary : public QuaternionExpression<Scalar3QuaternionTernary<E1, E2, E3, F> >
472  {
473 
475  typedef F FunctorType;
476  typedef E1 Expression1Type;
477  typedef E2 Expression2Type;
478  typedef E3 Expression3Type;
479  typedef typename E1::ConstClosureType Expression1ClosureType;
480  typedef typename E2::ConstClosureType Expression2ClosureType;
481  typedef const E3 Expression3ClosureType;
482 
483  public:
484  typedef typename F::ResultType ValueType;
485  typedef const ValueType ConstReference;
486  typedef const ValueType Reference;
487  typedef const SelfType ConstClosureType;
489 
490  Scalar3QuaternionTernary(const Expression1Type& e1, const Expression2Type& e2, const Expression3Type& e3):
491  expr1(e1), expr2(e2), expr3(e3) {}
492 
494  {
495  return FunctorType::applyC1(expr1, expr2, expr3);
496  }
497 
499  {
500  return FunctorType::applyC2(expr1, expr2, expr3);
501  }
502 
504  {
505  return FunctorType::applyC3(expr1, expr2, expr3);
506  }
507 
509  {
510  return FunctorType::applyC4(expr1, expr2, expr3);
511  }
512 
513  private:
514  Expression1ClosureType expr1;
515  Expression2ClosureType expr2;
516  Expression3ClosureType expr3;
517  };
518 
519  template <typename E1, typename E2, typename E3, typename F>
521  {
522 
525  };
526 
527  template <typename E1, typename E2, typename E3, typename F>
528  class Scalar13QuaternionTernary : public QuaternionExpression<Scalar13QuaternionTernary<E1, E2, E3, F> >
529  {
530 
532  typedef F FunctorType;
533  typedef E1 Expression1Type;
534  typedef E2 Expression2Type;
535  typedef E3 Expression3Type;
536  typedef const E1 Expression1ClosureType;
537  typedef typename E2::ConstClosureType Expression2ClosureType;
538  typedef const E3 Expression3ClosureType;
539 
540  public:
541  typedef typename F::ResultType ValueType;
542  typedef const ValueType ConstReference;
543  typedef const ValueType Reference;
544  typedef const SelfType ConstClosureType;
546 
547  Scalar13QuaternionTernary(const Expression1Type& e1, const Expression2Type& e2, const Expression3Type& e3):
548  expr1(e1), expr2(e2), expr3(e3) {}
549 
551  {
552  return FunctorType::applyC1(expr1, expr2, expr3);
553  }
554 
556  {
557  return FunctorType::applyC2(expr1, expr2, expr3);
558  }
559 
561  {
562  return FunctorType::applyC3(expr1, expr2, expr3);
563  }
564 
566  {
567  return FunctorType::applyC4(expr1, expr2, expr3);
568  }
569 
570  private:
571  Expression1ClosureType expr1;
572  Expression2ClosureType expr2;
573  Expression3ClosureType expr3;
574  };
575 
576  template <typename E1, typename E2, typename E3, typename F>
578  {
579 
582  };
583 
584  template <typename E>
587  {
588  typedef typename QuaternionUnary1Traits<E, ScalarNegation<typename E::ValueType> >::ExpressionType ExpressionType;
589 
590  return ExpressionType(e());
591  }
592 
593  template <typename E>
594  const E&
596  {
597  return e();
598  }
599 
600  template <typename E1, typename E2>
601  typename QuaternionBinary1Traits<E1, E2, ScalarAddition<typename E1::ValueType, typename E2::ValueType> >::ResultType
603  {
604  typedef typename QuaternionBinary1Traits<E1, E2,
606 
607  return ExpressionType(e1(), e2());
608  }
609 
610  template <typename E, typename T>
611  typename std::enable_if<IsScalar<T>::value, typename Scalar2QuaternionBinary2Traits<E, T, Scalar2QuaternionAddition<E, T> >::ResultType>::type
612  operator+(const QuaternionExpression<E>& e, const T& t)
613  {
614  typedef typename Scalar2QuaternionBinary2Traits<E, T, Scalar2QuaternionAddition<E, T> >::ExpressionType ExpressionType;
615 
616  return ExpressionType(e(), t);
617  }
618 
619  template <typename T, typename E>
620  typename std::enable_if<IsScalar<T>::value, typename Scalar1QuaternionBinary2Traits<T, E, Scalar1QuaternionAddition<T, E> >::ResultType>::type
621  operator+(const T& t, const QuaternionExpression<E>& e)
622  {
623  typedef typename Scalar1QuaternionBinary2Traits<T, E, Scalar1QuaternionAddition<T, E> >::ExpressionType ExpressionType;
624 
625  return ExpressionType(t, e());
626  }
627 
628  template <typename E1, typename E2>
629  typename QuaternionBinary1Traits<E1, E2, ScalarSubtraction<typename E1::ValueType, typename E2::ValueType> >::ResultType
631  {
632  typedef typename QuaternionBinary1Traits<E1, E2,
634 
635  return ExpressionType(e1(), e2());
636  }
637 
638  template <typename E, typename T>
639  typename std::enable_if<IsScalar<T>::value, typename Scalar2QuaternionBinary2Traits<E, T, Scalar2QuaternionSubtraction<E, T> >::ResultType>::type
640  operator-(const QuaternionExpression<E>& e, const T& t)
641  {
642  typedef typename Scalar2QuaternionBinary2Traits<E, T, Scalar2QuaternionSubtraction<E, T> >::ExpressionType ExpressionType;
643 
644  return ExpressionType(e(), t);
645  }
646 
647  template <typename T, typename E>
648  typename std::enable_if<IsScalar<T>::value, typename Scalar1QuaternionBinary2Traits<T, E, Scalar1QuaternionSubtraction<T, E> >::ResultType>::type
649  operator-(const T& t, const QuaternionExpression<E>& e)
650  {
651  typedef typename Scalar1QuaternionBinary2Traits<T, E, Scalar1QuaternionSubtraction<T, E> >::ExpressionType ExpressionType;
652 
653  return ExpressionType(t, e());
654  }
655 
656  template <typename E1, typename E2>
657  typename QuaternionBinary2Traits<E1, E2, QuaternionProduct<E1, E2> >::ResultType
659  {
660  typedef typename QuaternionBinary2Traits<E1, E2, QuaternionProduct<E1, E2> >::ExpressionType ExpressionType;
661 
662  return ExpressionType(e1(), e2());
663  }
664 
665  template <typename E, typename T>
666  typename std::enable_if<IsScalar<T>::value, typename Scalar2QuaternionBinary1Traits<E, T, ScalarMultiplication<typename E::ValueType, T> >::ResultType>::type
667  operator*(const QuaternionExpression<E>& e, const T& t)
668  {
669  typedef typename Scalar2QuaternionBinary1Traits<E, T,
670  ScalarMultiplication<typename E::ValueType, T> >::ExpressionType ExpressionType;
671 
672  return ExpressionType(e(), t);
673  }
674 
675  template <typename T, typename E>
676  typename std::enable_if<IsScalar<T>::value, typename Scalar1QuaternionBinary1Traits<T, E, ScalarMultiplication<T, typename E::ValueType> >::ResultType>::type
677  operator*(const T& t, const QuaternionExpression<E>& e)
678  {
679  typedef typename Scalar1QuaternionBinary1Traits<T, E,
680  ScalarMultiplication<T, typename E::ValueType> >::ExpressionType ExpressionType;
681 
682  return ExpressionType(t, e());
683  }
684 
685  template <typename E1, typename E2>
689  {
692 
693  return ExpressionType(e1(), e2(), norm2(e2));
694  }
695 
696  template <typename E, typename T>
697  typename std::enable_if<IsScalar<T>::value, typename Scalar2QuaternionBinary1Traits<E, T, ScalarDivision<typename E::ValueType, T> >::ResultType>::type
698  operator/(const QuaternionExpression<E>& e, const T& t)
699  {
700  typedef typename Scalar2QuaternionBinary1Traits<E, T,
701  ScalarDivision<typename E::ValueType, T> >::ExpressionType ExpressionType;
702 
703  return ExpressionType(e(), t);
704  }
705 
706  template <typename T, typename E>
707  typename std::enable_if<IsScalar<T>::value,
710  operator/(const T& t, const QuaternionExpression<E>& e)
711  {
714 
715  return ExpressionType(t, e(), norm2(e));
716  }
717 
718  template <typename E1, typename E2>
721  {
722  return QuaternionEquality<E1, E2>::apply(e1, e2);
723  }
724 
725  template <typename E1, typename E2>
728  {
729  return !QuaternionEquality<E1, E2>::apply(e1, e2);
730  }
731 
732  template <typename E1, typename E2, typename T>
733  typename std::enable_if<std::is_arithmetic<T>::value, typename QuaternionToleranceEquality<E1, E2, T>::ResultType>::type
734  equals(const QuaternionExpression<E1>& e1, const QuaternionExpression<E2>& e2, const T& eps)
735  {
737  }
738 
739  template <typename E1, typename E2>
740  typename QuaternionBinary1Traits<E1, E2, ScalarDivision<typename E1::ValueType, typename E2::ValueType> >::ResultType
742  {
743  typedef typename QuaternionBinary1Traits<E1, E2,
745 
746  return ExpressionType(e1(), e2());
747  }
748 
749  template <typename E1, typename E2>
750  typename QuaternionBinary1Traits<E1, E2, ScalarMultiplication<typename E1::ValueType, typename E2::ValueType> >::ResultType
752  {
753  typedef typename QuaternionBinary1Traits<E1, E2,
755 
756  return ExpressionType(e1(), e2());
757  }
758 
759  template <typename E>
760  typename E::ValueType
762  {
763  return e().getC1();
764  }
765 
766  template <typename E>
767  typename QuaternionUnary2Traits<E, QuaternionUnreal<E> >::ResultType
769  {
770  typedef typename QuaternionUnary2Traits<E, QuaternionUnreal<E> >::ExpressionType ExpressionType;
771 
772  return ExpressionType(e());
773  }
774 
775  template <typename E>
776  typename QuaternionUnary2Traits<E, QuaternionConjugate<E> >::ResultType
778  {
779  typedef typename QuaternionUnary2Traits<E, QuaternionConjugate<E> >::ExpressionType ExpressionType;
780 
781  return ExpressionType(e());
782  }
783 
784  template <typename E>
788  {
790  QuaternionInverse<E, typename QuaternionNorm2<E>::ResultType> >::ExpressionType ExpressionType;
791 
792  return ExpressionType(e(), norm2(e));
793  }
794 
795  template <typename E>
798  {
799  return QuaternionNorm<E>::apply(e);
800  }
801 
802  template <typename E>
805  {
806  return QuaternionNorm2<E>::apply(e);
807  }
808 
809  template <typename E>
812  {
814  }
815  } // namespace Math
816 } // namespace CDPL
817 
818 #endif // CDPL_MATH_QUATERNIONEXPRESSION_HPP
CDPL::Math::QuaternionBinary2::getC4
ConstReference getC4() const
Definition: QuaternionExpression.hpp:236
CDPL::Math::QuaternionBinary2::ValueType
F::ResultType ValueType
Definition: QuaternionExpression.hpp:212
CDPL::Math::Scalar1QuaternionBinary1::getC3
ConstReference getC3() const
Definition: QuaternionExpression.hpp:285
CDPL::Math::QuaternionBinary1::getC4
ConstReference getC4() const
Definition: QuaternionExpression.hpp:182
CDPL::Math::Scalar2QuaternionBinary2Traits::ResultType
ExpressionType ResultType
Definition: QuaternionExpression.hpp:467
CDPL::Math::QuaternionUnary1::ValueType
F::ResultType ValueType
Definition: QuaternionExpression.hpp:54
CDPL::Math::QuaternionBinary2Traits::ResultType
ExpressionType ResultType
Definition: QuaternionExpression.hpp:251
CDPL::Math::Scalar3QuaternionTernaryTraits::ResultType
ExpressionType ResultType
Definition: QuaternionExpression.hpp:524
CDPL::Math::operator!=
GridEquality< E1, E2 >::ResultType operator!=(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Definition: GridExpression.hpp:346
CDPL::Chem::CIPDescriptor::E
const unsigned int E
Specifies that the stereocenter has E configuration.
Definition: CIPDescriptor.hpp:96
CDPL::Math::Scalar13QuaternionTernaryTraits::ExpressionType
Scalar13QuaternionTernary< E1, E2, E3, F > ExpressionType
Definition: QuaternionExpression.hpp:580
CDPL::Math::QuaternionUnary2::ConstClosureType
const SelfType ConstClosureType
Definition: QuaternionExpression.hpp:108
CDPL::Math::QuaternionInverse::ResultType
Scalar2QuaternionBinaryFunctor< Q, T >::ResultType ResultType
Definition: Functional.hpp:1274
CommonType.hpp
Common type deduction.
CDPL::Math::norm2
QuaternionNorm2< E >::ResultType norm2(const QuaternionExpression< E > &e)
Definition: QuaternionExpression.hpp:804
CDPL::Math::Scalar2QuaternionBinary1::getC1
ConstReference getC1() const
Definition: QuaternionExpression.hpp:383
CDPL::Math::QuaternionBinary1::getC1
ConstReference getC1() const
Definition: QuaternionExpression.hpp:167
CDPL::Math::operator*
std::enable_if< IsScalar< T >::value, typename Scalar2GridBinaryTraits< E, T, ScalarMultiplication< typename E::ValueType, T > >::ResultType >::type operator*(const GridExpression< E > &e, const T &t)
Definition: GridExpression.hpp:309
CDPL::Math::QuaternionBinary2::ClosureType
SelfType ClosureType
Definition: QuaternionExpression.hpp:216
CDPL::Math::Scalar2QuaternionBinary2::ValueType
F::ResultType ValueType
Definition: QuaternionExpression.hpp:428
CDPL::Math::operator==
GridEquality< E1, E2 >::ResultType operator==(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Definition: GridExpression.hpp:339
CDPL::Math::Scalar2QuaternionBinary2::Scalar2QuaternionBinary2
Scalar2QuaternionBinary2(const Expression1Type &e1, const Expression2Type &e2)
Definition: QuaternionExpression.hpp:434
CDPL::Math::QuaternionUnary1Traits::ExpressionType
QuaternionUnary1< E, F > ExpressionType
Definition: QuaternionExpression.hpp:91
CDPL::Math::QuaternionUnary1::getC2
ConstReference getC2() const
Definition: QuaternionExpression.hpp:68
CDPL::Math::Scalar1QuaternionBinary1Traits::ResultType
ExpressionType ResultType
Definition: QuaternionExpression.hpp:305
CDPL::Math::Scalar1QuaternionBinary2Traits::ResultType
ExpressionType ResultType
Definition: QuaternionExpression.hpp:359
CDPL::Math::Scalar1QuaternionBinary2::ConstReference
const ValueType ConstReference
Definition: QuaternionExpression.hpp:321
CDPL::Math::Scalar13QuaternionTernary::ConstClosureType
const SelfType ConstClosureType
Definition: QuaternionExpression.hpp:544
CDPL::Math::Scalar1QuaternionBinary1::Scalar1QuaternionBinary1
Scalar1QuaternionBinary1(const Expression1Type &e1, const Expression2Type &e2)
Definition: QuaternionExpression.hpp:272
CDPL::Math::QuaternionBinary2Traits::ExpressionType
QuaternionBinary2< E1, E2, F > ExpressionType
Definition: QuaternionExpression.hpp:250
CDPL::Math::Scalar2QuaternionBinary2
Definition: QuaternionExpression.hpp:418
CDPL::Math::Scalar3QuaternionTernary::ClosureType
SelfType ClosureType
Definition: QuaternionExpression.hpp:488
CDPL::Math::QuaternionBinary1::ConstReference
const ValueType ConstReference
Definition: QuaternionExpression.hpp:159
CDPL::Math::Scalar1QuaternionBinary1::getC2
ConstReference getC2() const
Definition: QuaternionExpression.hpp:280
CDPL::Math::Scalar1QuaternionBinary2::getC2
ConstReference getC2() const
Definition: QuaternionExpression.hpp:334
CDPL::Math::real
GridUnaryTraits< E, ScalarReal< typename E::ValueType > >::ResultType real(const GridExpression< E > &e)
Definition: GridExpression.hpp:378
CDPL::Math::Scalar2QuaternionBinary2Traits
Definition: QuaternionExpression.hpp:464
CDPL::Math::QuaternionToleranceEquality::ResultType
Scalar3QuaternionBooleanTernaryFunctor< Q1, Q2, T >::ResultType ResultType
Definition: Functional.hpp:977
CDPL::Math::QuaternionBinary2::getC3
ConstReference getC3() const
Definition: QuaternionExpression.hpp:231
CDPL::Math::Scalar13QuaternionTernary::ValueType
F::ResultType ValueType
Definition: QuaternionExpression.hpp:541
CDPL::Math::QuaternionNorm::apply
static ResultType apply(const QuaternionExpression< Q > &e)
Definition: Functional.hpp:1026
CDPL::Math::operator-
GridUnaryTraits< E, ScalarNegation< typename E::ValueType > >::ResultType operator-(const GridExpression< E > &e)
Definition: GridExpression.hpp:272
CDPL::Math::ScalarMultiplication
Definition: Functional.hpp:239
CDPL::Math::Scalar1QuaternionBinary1::ConstClosureType
const SelfType ConstClosureType
Definition: QuaternionExpression.hpp:269
CDPL::Math::QuaternionBinary1Traits
Definition: QuaternionExpression.hpp:194
CDPL::Math::Scalar1QuaternionBinary1::ValueType
F::ResultType ValueType
Definition: QuaternionExpression.hpp:266
CDPL::Math::QuaternionElementSum::apply
static ResultType apply(const QuaternionExpression< Q > &e)
Definition: Functional.hpp:1003
CDPL::Math::ScalarAddition
Definition: Functional.hpp:211
CDPL::Math::QuaternionUnary1::getC3
ConstReference getC3() const
Definition: QuaternionExpression.hpp:73
CDPL::Math::Scalar3QuaternionTernaryTraits::ExpressionType
Scalar3QuaternionTernary< E1, E2, E3, F > ExpressionType
Definition: QuaternionExpression.hpp:523
CDPL::Math::inv
Scalar2QuaternionBinary2Traits< E, typename QuaternionNorm2< E >::ResultType, QuaternionInverse< E, typename QuaternionNorm2< E >::ResultType > >::ResultType inv(const QuaternionExpression< E > &e)
Definition: QuaternionExpression.hpp:787
CDPL::Math::QuaternionUnary2::getC4
ConstReference getC4() const
Definition: QuaternionExpression.hpp:129
CDPL::Math::Scalar13QuaternionTernary::getC2
ConstReference getC2() const
Definition: QuaternionExpression.hpp:555
CDPL::Math::QuaternionUnary1::QuaternionUnary1
QuaternionUnary1(const ExpressionType &e)
Definition: QuaternionExpression.hpp:60
CDPL::Math::QuaternionExpression
Definition: Expression.hpp:98
CDPL::Math::QuaternionBinary1::getC3
ConstReference getC3() const
Definition: QuaternionExpression.hpp:177
CDPL::Math::ScalarDivision
Definition: Functional.hpp:253
CDPL::Math::Scalar1QuaternionBinary2::ClosureType
SelfType ClosureType
Definition: QuaternionExpression.hpp:324
CDPL::Math::QuaternionDivision::ResultType
Scalar3QuaternionTernaryFunctor< Q1, Q2, T >::ResultType ResultType
Definition: Functional.hpp:1356
CDPL::Math::Scalar1QuaternionBinary2::getC1
ConstReference getC1() const
Definition: QuaternionExpression.hpp:329
CDPL::Math::Scalar3QuaternionTernary::getC1
ConstReference getC1() const
Definition: QuaternionExpression.hpp:493
CDPL::Math::Scalar2QuaternionBinary1::ConstReference
const ValueType ConstReference
Definition: QuaternionExpression.hpp:375
CDPL::Math::Scalar2QuaternionBinary1::ValueType
F::ResultType ValueType
Definition: QuaternionExpression.hpp:374
CDPL::Math::QuaternionEquality::ResultType
QuaternionBooleanBinaryFunctor< Q1, Q2 >::ResultType ResultType
Definition: Functional.hpp:955
CDPL::Math::QuaternionBinary2
Definition: QuaternionExpression.hpp:202
CDPL::Math::Scalar2QuaternionBinary2::getC2
ConstReference getC2() const
Definition: QuaternionExpression.hpp:442
CDPL::Math::Scalar2QuaternionBinary1::getC3
ConstReference getC3() const
Definition: QuaternionExpression.hpp:393
CDPL::Math::elemDiv
GridBinary1Traits< E1, E2, ScalarDivision< typename E1::ValueType, typename E2::ValueType > >::ResultType elemDiv(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Definition: GridExpression.hpp:396
CDPL::Math::Scalar13QuaternionTernary
Definition: QuaternionExpression.hpp:529
CDPL::Math::Scalar3QuaternionTernary::ConstClosureType
const SelfType ConstClosureType
Definition: QuaternionExpression.hpp:487
CDPL::Math::QuaternionUnary2::ConstReference
const ValueType ConstReference
Definition: QuaternionExpression.hpp:106
CDPL::Math::sum
GridElementSum< E >::ResultType sum(const GridExpression< E > &e)
Definition: GridExpression.hpp:416
CDPL::Math::Scalar3QuaternionTernary::ConstReference
const ValueType ConstReference
Definition: QuaternionExpression.hpp:485
CDPL::Math::Scalar13QuaternionTernaryTraits
Definition: QuaternionExpression.hpp:578
CDPL::Math::Scalar2QuaternionBinary2::ConstClosureType
const SelfType ConstClosureType
Definition: QuaternionExpression.hpp:431
CDPL::Math::Scalar2QuaternionBinary1Traits::ResultType
ExpressionType ResultType
Definition: QuaternionExpression.hpp:413
CDPL::Math::Scalar2QuaternionBinary1Traits
Definition: QuaternionExpression.hpp:410
CDPL::Math::Scalar13QuaternionTernary::getC4
ConstReference getC4() const
Definition: QuaternionExpression.hpp:565
CDPL::Math::QuaternionUnary2Traits::ExpressionType
QuaternionUnary2< E, F > ExpressionType
Definition: QuaternionExpression.hpp:142
CDPL::Math::Scalar1QuaternionBinary2::ConstClosureType
const SelfType ConstClosureType
Definition: QuaternionExpression.hpp:323
TypeTraits.hpp
Definition of type traits.
CDPL::Math::QuaternionUnary2::Reference
const ValueType Reference
Definition: QuaternionExpression.hpp:107
CDPL::Math::Scalar1QuaternionBinary2::getC3
ConstReference getC3() const
Definition: QuaternionExpression.hpp:339
CDPL::Math::Scalar1QuaternionBinary2Traits::ExpressionType
Scalar1QuaternionBinary2< E1, E2, F > ExpressionType
Definition: QuaternionExpression.hpp:358
CDPL::Math::ScalarSubtraction
Definition: Functional.hpp:225
CDPL::Math::Scalar3QuaternionTernary::Scalar3QuaternionTernary
Scalar3QuaternionTernary(const Expression1Type &e1, const Expression2Type &e2, const Expression3Type &e3)
Definition: QuaternionExpression.hpp:490
CDPL::Math::Scalar1QuaternionBinary1Traits::ExpressionType
Scalar1QuaternionBinary1< E1, E2, F > ExpressionType
Definition: QuaternionExpression.hpp:304
CDPL::Math::Scalar3QuaternionTernaryTraits
Definition: QuaternionExpression.hpp:521
CDPL::Math::QuaternionNorm2::apply
static ResultType apply(const QuaternionExpression< Q > &e)
Definition: Functional.hpp:1045
CDPL::Math::QuaternionBinary2Traits
Definition: QuaternionExpression.hpp:248
CDPL::Math::Scalar2QuaternionBinary2Traits::ExpressionType
Scalar2QuaternionBinary2< E1, E2, F > ExpressionType
Definition: QuaternionExpression.hpp:466
CDPL::Math::operator+
const E & operator+(const GridExpression< E > &e)
Definition: GridExpression.hpp:282
CDPL::Math::QuaternionBinary1::Reference
const ValueType Reference
Definition: QuaternionExpression.hpp:160
CDPL::Math::QuaternionUnary1::Reference
const ValueType Reference
Definition: QuaternionExpression.hpp:56
CDPL::Math::Scalar1QuaternionBinary2::Scalar1QuaternionBinary2
Scalar1QuaternionBinary2(const Expression1Type &e1, const Expression2Type &e2)
Definition: QuaternionExpression.hpp:326
CDPL::Math::Scalar2QuaternionBinary1Traits::ExpressionType
Scalar2QuaternionBinary1< E1, E2, F > ExpressionType
Definition: QuaternionExpression.hpp:412
CDPL::Math::Scalar13QuaternionTernaryTraits::ResultType
ExpressionType ResultType
Definition: QuaternionExpression.hpp:581
CDPL::Math::QuaternionBinary2::Reference
const ValueType Reference
Definition: QuaternionExpression.hpp:214
CDPL::Math::Scalar13QuaternionTernary::getC1
ConstReference getC1() const
Definition: QuaternionExpression.hpp:550
CDPL::Math::Scalar1QuaternionBinary2::ValueType
F::ResultType ValueType
Definition: QuaternionExpression.hpp:320
CDPL::Math::Scalar1QuaternionBinary1::Reference
const ValueType Reference
Definition: QuaternionExpression.hpp:268
CDPL::Math::Scalar1QuaternionBinary1
Definition: QuaternionExpression.hpp:256
CDPL::Math::Scalar13QuaternionTernary::ConstReference
const ValueType ConstReference
Definition: QuaternionExpression.hpp:542
CDPL::Math::Scalar3QuaternionTernary::Reference
const ValueType Reference
Definition: QuaternionExpression.hpp:486
Functional.hpp
Definition of various functors.
CDPL::Math::conj
GridUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType conj(const GridExpression< E > &e)
Definition: GridExpression.hpp:360
CDPL::Math::Scalar13QuaternionTernary::Scalar13QuaternionTernary
Scalar13QuaternionTernary(const Expression1Type &e1, const Expression2Type &e2, const Expression3Type &e3)
Definition: QuaternionExpression.hpp:547
CDPL::Math::Scalar2QuaternionBinary2::Reference
const ValueType Reference
Definition: QuaternionExpression.hpp:430
CDPL::Math::Scalar2QuaternionBinary1::Reference
const ValueType Reference
Definition: QuaternionExpression.hpp:376
CDPL::Math::Scalar1QuaternionBinary2::Reference
const ValueType Reference
Definition: QuaternionExpression.hpp:322
CDPL::Math::Scalar13QuaternionTernary::getC3
ConstReference getC3() const
Definition: QuaternionExpression.hpp:560
CDPL::Math::Scalar3QuaternionTernary
Definition: QuaternionExpression.hpp:472
CDPL::Chem::AtomType::T
const unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
CDPL::Math::QuaternionBinary1
Definition: QuaternionExpression.hpp:148
CDPL::Math::elemProd
GridBinary1Traits< E1, E2, ScalarMultiplication< typename E1::ValueType, typename E2::ValueType > >::ResultType elemProd(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Definition: GridExpression.hpp:406
CDPL::Math::Scalar1QuaternionBinary2::getC4
ConstReference getC4() const
Definition: QuaternionExpression.hpp:344
CDPL::Math::Scalar3QuaternionTernary::getC2
ConstReference getC2() const
Definition: QuaternionExpression.hpp:498
CDPL::Math::QuaternionBinary1::ConstClosureType
const SelfType ConstClosureType
Definition: QuaternionExpression.hpp:161
CDPL::Math::unreal
QuaternionUnary2Traits< E, QuaternionUnreal< E > >::ResultType unreal(const QuaternionExpression< E > &e)
Definition: QuaternionExpression.hpp:768
CDPL::Math::QuaternionUnary1::ConstReference
const ValueType ConstReference
Definition: QuaternionExpression.hpp:55
CDPL::Math::QuaternionBinary1::getC2
ConstReference getC2() const
Definition: QuaternionExpression.hpp:172
CDPL::Math::Scalar2QuaternionBinary1::getC2
ConstReference getC2() const
Definition: QuaternionExpression.hpp:388
CDPL::Math::QuaternionUnary2::ValueType
F::ResultType ValueType
Definition: QuaternionExpression.hpp:105
CDPL::Math::Scalar2QuaternionBinary1::ClosureType
SelfType ClosureType
Definition: QuaternionExpression.hpp:378
CDPL::Math::QuaternionUnary2::getC1
ConstReference getC1() const
Definition: QuaternionExpression.hpp:114
CDPL::Math::QuaternionUnary2Traits
Definition: QuaternionExpression.hpp:140
CDPL::Math::QuaternionUnary1Traits::ResultType
ExpressionType ResultType
Definition: QuaternionExpression.hpp:92
CDPL::Math::Scalar2QuaternionBinary1::getC4
ConstReference getC4() const
Definition: QuaternionExpression.hpp:398
CDPL::Math::QuaternionUnary1::getC4
ConstReference getC4() const
Definition: QuaternionExpression.hpp:78
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Math::QuaternionBinary1Traits::ResultType
ExpressionType ResultType
Definition: QuaternionExpression.hpp:197
CDPL::Math::Scalar1QuaternionBinary2Traits
Definition: QuaternionExpression.hpp:356
CDPL::Math::QuaternionUnary2Traits::ResultType
ExpressionType ResultType
Definition: QuaternionExpression.hpp:143
CDPL::Math::QuaternionBinary1::ClosureType
SelfType ClosureType
Definition: QuaternionExpression.hpp:162
CDPL::Math::QuaternionEquality::apply
static ResultType apply(const QuaternionExpression< Q1 > &e1, const QuaternionExpression< Q2 > &e2)
Definition: Functional.hpp:957
CDPL::Math::QuaternionUnary1::getC1
ConstReference getC1() const
Definition: QuaternionExpression.hpp:63
CDPL::Math::QuaternionBinary2::ConstReference
const ValueType ConstReference
Definition: QuaternionExpression.hpp:213
CDPL::Math::Scalar3QuaternionTernary::getC4
ConstReference getC4() const
Definition: QuaternionExpression.hpp:508
CDPL::Math::QuaternionUnary1
Definition: QuaternionExpression.hpp:46
CDPL::Math::QuaternionBinary1::QuaternionBinary1
QuaternionBinary1(const Expression1Type &e1, const Expression2Type &e2)
Definition: QuaternionExpression.hpp:164
CDPL::Math::norm
QuaternionNorm< E >::ResultType norm(const QuaternionExpression< E > &e)
Definition: QuaternionExpression.hpp:797
CDPL::Math::Scalar2QuaternionBinary2::getC3
ConstReference getC3() const
Definition: QuaternionExpression.hpp:447
CDPL::Math::operator/
std::enable_if< IsScalar< T >::value, typename Scalar2GridBinaryTraits< E, T, ScalarDivision< typename E::ValueType, T > >::ResultType >::type operator/(const GridExpression< E > &e, const T &t)
Definition: GridExpression.hpp:329
CDPL::Math::Scalar2QuaternionBinary2::getC1
ConstReference getC1() const
Definition: QuaternionExpression.hpp:437
CDPL::Math::Scalar1QuaternionBinary1::getC1
ConstReference getC1() const
Definition: QuaternionExpression.hpp:275
CDPL::Math::QuaternionNorm2::ResultType
QuaternionScalarRealUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1043
CDPL::Math::Scalar1QuaternionBinary2
Definition: QuaternionExpression.hpp:310
CDPL::Math::Scalar3QuaternionTernary::getC3
ConstReference getC3() const
Definition: QuaternionExpression.hpp:503
CDPL::Math::QuaternionUnary1::ClosureType
SelfType ClosureType
Definition: QuaternionExpression.hpp:58
CDPL::Math::equals
std::enable_if< std::is_arithmetic< T >::value, typename GridToleranceEquality< E1, E2, T >::ResultType >::type equals(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2, const T &eps)
Definition: GridExpression.hpp:353
CDPL::Math::Scalar2QuaternionBinary2::ConstReference
const ValueType ConstReference
Definition: QuaternionExpression.hpp:429
CDPL::Math::QuaternionNorm::ResultType
QuaternionScalarRealUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1024
CDPL::Math::QuaternionBinary2::getC2
ConstReference getC2() const
Definition: QuaternionExpression.hpp:226
CDPL::Math::Scalar2QuaternionBinary1::ConstClosureType
const SelfType ConstClosureType
Definition: QuaternionExpression.hpp:377
CDPL::Math::QuaternionBinary2::QuaternionBinary2
QuaternionBinary2(const Expression1Type &e1, const Expression2Type &e2)
Definition: QuaternionExpression.hpp:218
CDPL::Math::QuaternionDivision
Definition: Functional.hpp:1353
CDPL::Math::QuaternionUnary2::ClosureType
SelfType ClosureType
Definition: QuaternionExpression.hpp:109
CDPL::Math::QuaternionBinary2::getC1
ConstReference getC1() const
Definition: QuaternionExpression.hpp:221
CDPL::Math::Scalar13QuaternionTernary::ClosureType
SelfType ClosureType
Definition: QuaternionExpression.hpp:545
CDPL::Math::QuaternionBinary1Traits::ExpressionType
QuaternionBinary1< E1, E2, F > ExpressionType
Definition: QuaternionExpression.hpp:196
CDPL::Math::QuaternionUnary1Traits
Definition: QuaternionExpression.hpp:89
CDPL::Math::ScalarQuaternionDivision::ResultType
Scalar13QuaternionTernaryFunctor< T1, Q, T2 >::ResultType ResultType
Definition: Functional.hpp:1402
CDPL::Math::ScalarQuaternionDivision
Definition: Functional.hpp:1398
CDPL::Math::QuaternionUnary2::getC2
ConstReference getC2() const
Definition: QuaternionExpression.hpp:119
CDPL::Math::Scalar2QuaternionBinary2::getC4
ConstReference getC4() const
Definition: QuaternionExpression.hpp:452
CDPL::Math::Scalar1QuaternionBinary1::getC4
ConstReference getC4() const
Definition: QuaternionExpression.hpp:290
Expression.hpp
Definition of basic expression types.
CDPL::Math::Scalar1QuaternionBinary1Traits
Definition: QuaternionExpression.hpp:302
CDPL::Math::QuaternionElementSum::ResultType
QuaternionScalarUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1001
CDPL::Math::QuaternionInverse
Definition: Functional.hpp:1271
CDPL::Math::QuaternionUnary1::ConstClosureType
const SelfType ConstClosureType
Definition: QuaternionExpression.hpp:57
CDPL::Math::Scalar2QuaternionBinary2::ClosureType
SelfType ClosureType
Definition: QuaternionExpression.hpp:432
CDPL::Math::QuaternionBinary1::ValueType
F::ResultType ValueType
Definition: QuaternionExpression.hpp:158
CDPL::Math::QuaternionUnary2
Definition: QuaternionExpression.hpp:97
CDPL::Math::Scalar3QuaternionTernary::ValueType
F::ResultType ValueType
Definition: QuaternionExpression.hpp:484
CDPL::Math::QuaternionUnary2::QuaternionUnary2
QuaternionUnary2(const ExpressionType &e)
Definition: QuaternionExpression.hpp:111
CDPL::Chem::AtomType::F
const unsigned int F
Specifies Fluorine.
Definition: AtomType.hpp:107
CDPL::Math::QuaternionUnary2::getC3
ConstReference getC3() const
Definition: QuaternionExpression.hpp:124
CDPL::Math::Scalar1QuaternionBinary1::ConstReference
const ValueType ConstReference
Definition: QuaternionExpression.hpp:267
CDPL::Math::Scalar1QuaternionBinary1::ClosureType
SelfType ClosureType
Definition: QuaternionExpression.hpp:270
CDPL::Math::QuaternionBinary2::ConstClosureType
const SelfType ConstClosureType
Definition: QuaternionExpression.hpp:215
CDPL::Math::Scalar13QuaternionTernary::Reference
const ValueType Reference
Definition: QuaternionExpression.hpp:543
CDPL::Math::Scalar2QuaternionBinary1::Scalar2QuaternionBinary1
Scalar2QuaternionBinary1(const Expression1Type &e1, const Expression2Type &e2)
Definition: QuaternionExpression.hpp:380
CDPL::Math::QuaternionToleranceEquality::apply
static ResultType apply(const QuaternionExpression< Q1 > &e1, const QuaternionExpression< Q2 > &e2, Argument3Type epsilon)
Definition: Functional.hpp:980
CDPL::Math::Scalar2QuaternionBinary1
Definition: QuaternionExpression.hpp:364