Chemical Data Processing Library C++ API - Version 1.1.1
VectorExpression.hpp
Go to the documentation of this file.
1 /*
2  * VectorExpression.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_VECTOREXPRESSION_HPP
28 #define CDPL_MATH_VECTOREXPRESSION_HPP
29 
30 #include <type_traits>
31 
32 #include "CDPL/Math/Check.hpp"
33 #include "CDPL/Math/Expression.hpp"
34 #include "CDPL/Math/CommonType.hpp"
35 #include "CDPL/Math/Functional.hpp"
36 #include "CDPL/Math/TypeTraits.hpp"
37 #include "CDPL/Base/Exceptions.hpp"
38 
39 
40 namespace CDPL
41 {
42 
43  namespace Math
44  {
45 
46  template <typename E, typename F>
47  class VectorUnary : public VectorExpression<VectorUnary<E, F> >
48  {
49 
51  typedef F FunctorType;
52  typedef E ExpressionType;
53  typedef typename E::ConstClosureType ExpressionClosureType;
54 
55  public:
56  typedef typename F::ResultType ValueType;
57  typedef const ValueType ConstReference;
58  typedef const ValueType Reference;
59  typedef const SelfType ConstClosureType;
61  typedef typename E::SizeType SizeType;
62  typedef typename E::DifferenceType DifferenceType;
63 
64  VectorUnary(const ExpressionType& e):
65  expr(e) {}
66 
67  SizeType getSize() const
68  {
69  return expr.getSize();
70  }
71 
73  {
74  return FunctorType::apply(expr(i));
75  }
76 
78  {
79  return FunctorType::apply(expr[i]);
80  }
81 
82  private:
83  ExpressionClosureType expr;
84  };
85 
86  template <typename E, typename F>
88  {
89 
92  };
93 
94  template <typename E1, typename E2, typename F>
95  class VectorBinary1 : public VectorExpression<VectorBinary1<E1, E2, F> >
96  {
97 
99  typedef F FunctorType;
100  typedef E1 Expression1Type;
101  typedef E2 Expression2Type;
102  typedef typename E1::ConstClosureType Expression1ClosureType;
103  typedef typename E2::ConstClosureType Expression2ClosureType;
104 
105  public:
106  typedef typename F::ResultType ValueType;
107  typedef const ValueType ConstReference;
108  typedef const ValueType Reference;
109  typedef const SelfType ConstClosureType;
113 
114  VectorBinary1(const Expression1Type& e1, const Expression2Type& e2):
115  expr1(e1), expr2(e2) {}
116 
118  {
119  return CDPL_MATH_CHECK_SIZE_EQUALITY(SizeType(expr1.getSize()), SizeType(expr2.getSize()), Base::SizeError);
120  }
121 
123  {
124  return FunctorType::apply(expr1(i), expr2(i));
125  }
126 
128  {
129  return FunctorType::apply(expr1[i], expr2[i]);
130  }
131 
132  private:
133  Expression1ClosureType expr1;
134  Expression2ClosureType expr2;
135  };
136 
137  template <typename E1, typename E2, typename F>
139  {
140 
143  };
144 
145  template <typename E1, typename E2, typename F>
146  class VectorBinary2 : public VectorExpression<VectorBinary2<E1, E2, F> >
147  {
148 
150  typedef F FunctorType;
151  typedef E1 Expression1Type;
152  typedef E2 Expression2Type;
153  typedef typename E1::ConstClosureType Expression1ClosureType;
154  typedef typename E2::ConstClosureType Expression2ClosureType;
155 
156  public:
157  typedef typename F::ResultType ValueType;
158  typedef const ValueType ConstReference;
159  typedef const ValueType Reference;
160  typedef const SelfType ConstClosureType;
164 
165  VectorBinary2(const Expression1Type& e1, const Expression2Type& e2):
166  expr1(e1), expr2(e2) {}
167 
169  {
170  return CDPL_MATH_CHECK_SIZE_EQUALITY(SizeType(expr1.getSize()), SizeType(expr2.getSize()), Base::SizeError);
171  }
172 
174  {
175  return FunctorType::apply(expr1, expr2, i);
176  }
177 
179  {
180  return FunctorType::apply(expr1, expr2, i);
181  }
182 
183  private:
184  Expression1ClosureType expr1;
185  Expression2ClosureType expr2;
186  };
187 
188  template <typename E1, typename E2, typename F>
190  {
191 
194  };
195 
196  template <typename E1, typename E2, typename F>
197  class Scalar1VectorBinary : public VectorExpression<Scalar1VectorBinary<E1, E2, F> >
198  {
199 
201  typedef F FunctorType;
202  typedef E1 Expression1Type;
203  typedef E2 Expression2Type;
204  typedef const E1 Expression1ClosureType;
205  typedef typename E2::ConstClosureType Expression2ClosureType;
206 
207  public:
208  typedef typename F::ResultType ValueType;
209  typedef const ValueType ConstReference;
210  typedef const ValueType Reference;
211  typedef const SelfType ConstClosureType;
213  typedef typename E2::SizeType SizeType;
214  typedef typename E2::DifferenceType DifferenceType;
215 
216  Scalar1VectorBinary(const Expression1Type& e1, const Expression2Type& e2):
217  expr1(e1), expr2(e2) {}
218 
220  {
221  return expr2.getSize();
222  }
223 
225  {
226  return FunctorType::apply(expr1, expr2(i));
227  }
228 
230  {
231  return FunctorType::apply(expr1, expr2[i]);
232  }
233 
234  private:
235  Expression1ClosureType expr1;
236  Expression2ClosureType expr2;
237  };
238 
239  template <typename E1, typename E2, typename F>
241  {
242 
245  };
246 
247  template <typename E1, typename E2, typename F>
248  class Scalar2VectorBinary : public VectorExpression<Scalar2VectorBinary<E1, E2, F> >
249  {
250 
252  typedef F FunctorType;
253  typedef E1 Expression1Type;
254  typedef E2 Expression2Type;
255  typedef typename E1::ConstClosureType Expression1ClosureType;
256  typedef const E2 Expression2ClosureType;
257 
258  public:
259  typedef typename F::ResultType ValueType;
260  typedef const ValueType ConstReference;
261  typedef const ValueType Reference;
262  typedef const SelfType ConstClosureType;
264  typedef typename E1::SizeType SizeType;
265  typedef typename E1::DifferenceType DifferenceType;
266 
267  Scalar2VectorBinary(const Expression1Type& e1, const Expression2Type& e2):
268  expr1(e1), expr2(e2) {}
269 
271  {
272  return expr1.getSize();
273  }
274 
276  {
277  return FunctorType::apply(expr1(i), expr2);
278  }
279 
281  {
282  return FunctorType::apply(expr1[i], expr2);
283  }
284 
285  private:
286  Expression1ClosureType expr1;
287  Expression2ClosureType expr2;
288  };
289 
290  template <typename E1, typename E2, typename F>
292  {
293 
296  };
297 
298  template <typename E1, typename E2, typename F>
299  class QuaternionVectorBinary : public VectorExpression<QuaternionVectorBinary<E1, E2, F> >
300  {
301 
303  typedef F FunctorType;
304  typedef E1 Expression1Type;
305  typedef E2 Expression2Type;
306  typedef typename E1::ConstClosureType Expression1ClosureType;
307  typedef typename E2::ConstClosureType Expression2ClosureType;
308 
309  public:
310  typedef typename F::ResultType ValueType;
311  typedef const ValueType ConstReference;
312  typedef const ValueType Reference;
313  typedef const SelfType ConstClosureType;
315  typedef typename E2::SizeType SizeType;
316  typedef typename E2::DifferenceType DifferenceType;
317 
318  QuaternionVectorBinary(const Expression1Type& e1, const Expression2Type& e2):
319  expr1(e1), expr2(e2) {}
320 
322  {
323  return expr2.getSize();
324  }
325 
327  {
328  return FunctorType::apply(expr1, expr2, i);
329  }
330 
332  {
333  return FunctorType::apply(expr1, expr2, i);
334  }
335 
336  private:
337  Expression1ClosureType expr1;
338  Expression2ClosureType expr2;
339  };
340 
341  template <typename E1, typename E2, typename F>
343  {
344 
347  };
348 
349  template <typename E>
352  {
353  typedef typename VectorUnaryTraits<E, ScalarNegation<typename E::ValueType> >::ExpressionType ExpressionType;
354 
355  return ExpressionType(e());
356  }
357 
358  template <typename E>
359  const E&
361  {
362  return e();
363  }
364 
365  template <typename E1, typename E2>
366  typename VectorBinary1Traits<E1, E2, ScalarAddition<typename E1::ValueType, typename E2::ValueType> >::ResultType
368  {
369  typedef typename VectorBinary1Traits<E1, E2,
371 
372  return ExpressionType(e1(), e2());
373  }
374 
375  template <typename E1, typename E2>
376  typename VectorBinary1Traits<E1, E2, ScalarSubtraction<typename E1::ValueType, typename E2::ValueType> >::ResultType
378  {
379  typedef typename VectorBinary1Traits<E1, E2,
381 
382  return ExpressionType(e1(), e2());
383  }
384 
385  template <typename E, typename T>
386  typename std::enable_if<IsScalar<T>::value, typename Scalar2VectorBinaryTraits<E, T, ScalarMultiplication<typename E::ValueType, T> >::ResultType>::type
387  operator*(const VectorExpression<E>& e, const T& t)
388  {
389  typedef typename Scalar2VectorBinaryTraits<E, T,
390  ScalarMultiplication<typename E::ValueType, T> >::ExpressionType ExpressionType;
391 
392  return ExpressionType(e(), t);
393  }
394 
395  template <typename T, typename E>
396  typename std::enable_if<IsScalar<T>::value, typename Scalar1VectorBinaryTraits<T, E, ScalarMultiplication<T, typename E::ValueType> >::ResultType>::type
397  operator*(const T& t, const VectorExpression<E>& e)
398  {
399  typedef typename Scalar1VectorBinaryTraits<T, E,
400  ScalarMultiplication<T, typename E::ValueType> >::ExpressionType ExpressionType;
401 
402  return ExpressionType(t, e());
403  }
404 
405  template <typename E, typename T>
406  typename std::enable_if<IsScalar<T>::value, typename Scalar2VectorBinaryTraits<E, T, ScalarDivision<typename E::ValueType, T> >::ResultType>::type
407  operator/(const VectorExpression<E>& e, const T& t)
408  {
409  typedef typename Scalar2VectorBinaryTraits<E, T,
410  ScalarDivision<typename E::ValueType, T> >::ExpressionType ExpressionType;
411 
412  return ExpressionType(e(), t);
413  }
414 
415  template <typename E1, typename E2>
418  {
419  return VectorEquality<E1, E2>::apply(e1, e2);
420  }
421 
422  template <typename E1, typename E2>
425  {
426  return !VectorEquality<E1, E2>::apply(e1, e2);
427  }
428 
429  template <typename E1, typename E2, typename T>
430  typename std::enable_if<std::is_arithmetic<T>::value, typename VectorToleranceEquality<E1, E2, T>::ResultType>::type
431  equals(const VectorExpression<E1>& e1, const VectorExpression<E2>& e2, const T& eps)
432  {
433  return VectorToleranceEquality<E1, E2, T>::apply(e1, e2, eps);
434  }
435 
436  template <typename E>
437  typename VectorUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ResultType
439  {
440  typedef typename VectorUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ExpressionType ExpressionType;
441 
442  return ExpressionType(e());
443  }
444 
445  template <typename E>
446  typename VectorUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ResultType
448  {
449  typedef typename VectorUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ExpressionType ExpressionType;
450 
451  return ExpressionType(e());
452  }
453 
454  template <typename E>
455  typename VectorUnaryTraits<E, ScalarReal<typename E::ValueType> >::ResultType
457  {
458  typedef typename VectorUnaryTraits<E, ScalarReal<typename E::ValueType> >::ExpressionType ExpressionType;
459 
460  return ExpressionType(e());
461  }
462 
463  template <typename E>
464  typename VectorUnaryTraits<E, ScalarImaginary<typename E::ValueType> >::ResultType
466  {
467  typedef typename VectorUnaryTraits<E, ScalarImaginary<typename E::ValueType> >::ExpressionType ExpressionType;
468 
469  return ExpressionType(e());
470  }
471 
472  template <typename E1, typename E2>
473  typename VectorBinary1Traits<E1, E2, ScalarDivision<typename E1::ValueType, typename E2::ValueType> >::ResultType
475  {
476  typedef typename VectorBinary1Traits<E1, E2,
478 
479  return ExpressionType(e1(), e2());
480  }
481 
482  template <typename E1, typename E2>
483  typename VectorBinary1Traits<E1, E2, ScalarMultiplication<typename E1::ValueType, typename E2::ValueType> >::ResultType
485  {
486  typedef typename VectorBinary1Traits<E1, E2,
488 
489  return ExpressionType(e1(), e2());
490  }
491 
492  template <typename E1, typename E2>
493  typename VectorBinary2Traits<E1, E2, VectorCrossProduct<E1, E2> >::ResultType
495  {
496  typedef typename VectorBinary2Traits<E1, E2,
497  VectorCrossProduct<E1, E2> >::ExpressionType ExpressionType;
498 
499  return ExpressionType(e1(), e2());
500  }
501 
502  template <typename E1, typename E2>
505  {
506  return VectorInnerProduct<E1, E2>::apply(e1, e2);
507  }
508 
509  template <typename E1, typename E2, typename T>
511  angleCos(const VectorExpression<E1>& e1, const VectorExpression<E2>& e2, const T& sd, bool clamp = true)
512  {
513  return VectorAngleCosine<E1, E2, T>::apply(e1, e2, sd, clamp);
514  }
515 
516  template <typename E>
519  {
520  return VectorElementSum<E>::apply(e);
521  }
522 
523  template <typename E>
526  {
527  return VectorNorm1<E>::apply(e);
528  }
529 
530  template <typename E>
533  {
534  return VectorNorm2<E>::apply(e);
535  }
536 
537  template <typename E>
540  {
542  }
543 
544  template <typename E>
547  {
549  }
550 
551  template <typename E>
554  {
555  return norm2(e);
556  }
557 
558  template <typename E>
559  const E&
561  {
562  return e();
563  }
564 
565  template <typename E>
566  E&
568  {
569  return e();
570  }
571 
572  template <typename E1, typename E2>
573  typename QuaternionVectorBinaryTraits<E1, E2, QuaternionVectorRotation<E1, E2> >::ResultType
575  {
576  typedef typename QuaternionVectorBinaryTraits<E1, E2, QuaternionVectorRotation<E1, E2> >::ExpressionType ExpressionType;
577 
578  return ExpressionType(e1(), e2());
579  }
580  } // namespace Math
581 } // namespace CDPL
582 
583 #endif // CDPL_MATH_VECTOREXPRESSION_HPP
CDPL::Math::VectorAngleCosine::ResultType
CommonType< typename VectorInnerProduct< V1, V2 >::ResultType, T >::Type ResultType
Definition: Functional.hpp:296
CDPL::Math::VectorUnary::ConstClosureType
const SelfType ConstClosureType
Definition: VectorExpression.hpp:59
CDPL::Math::Scalar1VectorBinary
Definition: VectorExpression.hpp:198
CDPL::Math::VectorNorm2::ResultType
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:474
CDPL::Math::Scalar1VectorBinary::SizeType
E2::SizeType SizeType
Definition: VectorExpression.hpp:213
CDPL::Math::QuaternionVectorBinary::QuaternionVectorBinary
QuaternionVectorBinary(const Expression1Type &e1, const Expression2Type &e2)
Definition: VectorExpression.hpp:318
CDPL::Math::Scalar2VectorBinaryTraits
Definition: VectorExpression.hpp:292
CDPL::Math::Scalar2VectorBinaryTraits::ResultType
ExpressionType ResultType
Definition: VectorExpression.hpp:295
CDPL::Math::operator!=
GridEquality< E1, E2 >::ResultType operator!=(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Definition: GridExpression.hpp:346
CDPL_MATH_CHECK_SIZE_EQUALITY
#define CDPL_MATH_CHECK_SIZE_EQUALITY(size1, size2, e)
Definition: Check.hpp:62
CDPL::Chem::CIPDescriptor::E
const unsigned int E
Specifies that the stereocenter has E configuration.
Definition: CIPDescriptor.hpp:96
CDPL::Math::QuaternionVectorBinary
Definition: VectorExpression.hpp:300
CDPL::Math::CommonType::Type
std::common_type< T1, T2 >::type Type
Definition: CommonType.hpp:43
CDPL::Math::Scalar2VectorBinary::ConstReference
const ValueType ConstReference
Definition: VectorExpression.hpp:260
CDPL::Math::VectorBinary1::DifferenceType
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
Definition: VectorExpression.hpp:112
CDPL::Math::trans
MatrixTranspose< E > trans(MatrixExpression< E > &e)
Definition: MatrixExpression.hpp:941
CDPL::Math::VectorUnary::ValueType
F::ResultType ValueType
Definition: VectorExpression.hpp:56
CDPL::Math::VectorBinary1::operator[]
ConstReference operator[](SizeType i) const
Definition: VectorExpression.hpp:127
CDPL::Math::VectorInnerProduct::apply
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2)
Definition: Functional.hpp:278
CDPL::Math::QuaternionVectorBinary::Reference
const ValueType Reference
Definition: VectorExpression.hpp:312
CDPL::Math::VectorNorm1::ResultType
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:453
CDPL::Math::Scalar1VectorBinary::DifferenceType
E2::DifferenceType DifferenceType
Definition: VectorExpression.hpp:214
CDPL::Math::VectorBinary1Traits
Definition: VectorExpression.hpp:139
CommonType.hpp
Common type deduction.
CDPL::Math::VectorNorm2::apply
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:476
CDPL::Math::norm2
QuaternionNorm2< E >::ResultType norm2(const QuaternionExpression< E > &e)
Definition: QuaternionExpression.hpp:804
CDPL::Math::VectorBinary1Traits::ResultType
ExpressionType ResultType
Definition: VectorExpression.hpp:142
CDPL::Math::QuaternionVectorBinaryTraits::ExpressionType
QuaternionVectorBinary< E1, E2, F > ExpressionType
Definition: VectorExpression.hpp:345
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::VectorBinary1::getSize
SizeType getSize() const
Definition: VectorExpression.hpp:117
CDPL::Math::VectorBinary2::ClosureType
SelfType ClosureType
Definition: VectorExpression.hpp:161
CDPL::Math::VectorBinary1::VectorBinary1
VectorBinary1(const Expression1Type &e1, const Expression2Type &e2)
Definition: VectorExpression.hpp:114
CDPL::Math::VectorElementSum::ResultType
VectorScalarUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:423
CDPL::Math::VectorNorm1::apply
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:455
CDPL::Math::operator==
GridEquality< E1, E2 >::ResultType operator==(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Definition: GridExpression.hpp:339
CDPL::Math::VectorExpression
Definition: Expression.hpp:54
CDPL::Math::Scalar2VectorBinary::DifferenceType
E1::DifferenceType DifferenceType
Definition: VectorExpression.hpp:265
CDPL::Math::VectorToleranceEquality::ResultType
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::ResultType ResultType
Definition: Functional.hpp:355
CDPL::Math::innerProd
VectorInnerProduct< E1, E2 >::ResultType innerProd(const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
Definition: VectorExpression.hpp:504
CDPL::Math::rotate
QuaternionVectorBinaryTraits< E1, E2, QuaternionVectorRotation< E1, E2 > >::ResultType rotate(const QuaternionExpression< E1 > &e1, const VectorExpression< E2 > &e2)
Definition: VectorExpression.hpp:574
CDPL::Math::herm
GridUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType herm(const GridExpression< E > &e)
Definition: GridExpression.hpp:369
CDPL::Math::VectorBinary2::Reference
const ValueType Reference
Definition: VectorExpression.hpp:159
CDPL::Math::VectorBinary1::ConstClosureType
const SelfType ConstClosureType
Definition: VectorExpression.hpp:109
CDPL::Math::VectorUnary::SizeType
E::SizeType SizeType
Definition: VectorExpression.hpp:61
CDPL::Math::real
GridUnaryTraits< E, ScalarReal< typename E::ValueType > >::ResultType real(const GridExpression< E > &e)
Definition: GridExpression.hpp:378
CDPL::Math::VectorUnary::operator()
ConstReference operator()(SizeType i) const
Definition: VectorExpression.hpp:72
CDPL::Math::Scalar2VectorBinary
Definition: VectorExpression.hpp:249
CDPL::Math::QuaternionVectorBinary::SizeType
E2::SizeType SizeType
Definition: VectorExpression.hpp:315
CDPL::Math::VectorBinary2
Definition: VectorExpression.hpp:147
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::ScalarAddition
Definition: Functional.hpp:211
CDPL::Math::QuaternionVectorBinary::DifferenceType
E2::DifferenceType DifferenceType
Definition: VectorExpression.hpp:316
CDPL::Math::VectorBinary2::VectorBinary2
VectorBinary2(const Expression1Type &e1, const Expression2Type &e2)
Definition: VectorExpression.hpp:165
CDPL::Math::VectorBinary2Traits
Definition: VectorExpression.hpp:190
CDPL::Math::Scalar1VectorBinary::ValueType
F::ResultType ValueType
Definition: VectorExpression.hpp:208
CDPL::Math::Scalar2VectorBinary::operator()
ConstReference operator()(SizeType i) const
Definition: VectorExpression.hpp:275
CDPL::Math::Scalar1VectorBinary::Reference
const ValueType Reference
Definition: VectorExpression.hpp:210
CDPL::Math::QuaternionExpression
Definition: Expression.hpp:98
CDPL::Math::ScalarDivision
Definition: Functional.hpp:253
CDPL::Math::QuaternionVectorBinaryTraits::ResultType
ExpressionType ResultType
Definition: VectorExpression.hpp:346
CDPL::Math::VectorBinary2::SizeType
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
Definition: VectorExpression.hpp:162
CDPL::Math::VectorNormInfinityIndex::apply
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:534
CDPL::Math::VectorElementSum::apply
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:425
CDPL::Math::Scalar1VectorBinary::Scalar1VectorBinary
Scalar1VectorBinary(const Expression1Type &e1, const Expression2Type &e2)
Definition: VectorExpression.hpp:216
CDPL::Math::QuaternionVectorBinaryTraits
Definition: VectorExpression.hpp:343
CDPL::Math::QuaternionVectorBinary::operator()
ConstReference operator()(SizeType i) const
Definition: VectorExpression.hpp:326
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::VectorBinary1::ValueType
F::ResultType ValueType
Definition: VectorExpression.hpp:106
CDPL::Math::Scalar2VectorBinary::ValueType
F::ResultType ValueType
Definition: VectorExpression.hpp:259
CDPL::Math::QuaternionVectorBinary::operator[]
ConstReference operator[](SizeType i) const
Definition: VectorExpression.hpp:331
CDPL::Math::VectorNormInfinity::apply
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:500
CDPL::Math::sum
GridElementSum< E >::ResultType sum(const GridExpression< E > &e)
Definition: GridExpression.hpp:416
CDPL::Math::Scalar2VectorBinary::getSize
SizeType getSize() const
Definition: VectorExpression.hpp:270
CDPL::Base::SizeError
Thrown to indicate that the size of a (multidimensional) array is not correct.
Definition: Base/Exceptions.hpp:133
CDPL::Math::crossProd
VectorBinary2Traits< E1, E2, VectorCrossProduct< E1, E2 > >::ResultType crossProd(const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
Definition: VectorExpression.hpp:494
CDPL::Math::VectorUnaryTraits::ExpressionType
VectorUnary< E, F > ExpressionType
Definition: VectorExpression.hpp:90
CDPL::Math::Scalar1VectorBinaryTraits::ExpressionType
Scalar1VectorBinary< E1, E2, F > ExpressionType
Definition: VectorExpression.hpp:243
TypeTraits.hpp
Definition of type traits.
CDPL::Math::VectorBinary2::operator()
ConstReference operator()(SizeType i) const
Definition: VectorExpression.hpp:173
CDPL::Math::ScalarSubtraction
Definition: Functional.hpp:225
CDPL::Math::VectorBinary1
Definition: VectorExpression.hpp:96
CDPL::Math::VectorNormInfinityIndex::ResultType
VectorScalarIndexUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:532
CDPL::Math::operator+
const E & operator+(const GridExpression< E > &e)
Definition: GridExpression.hpp:282
CDPL::Math::Scalar1VectorBinary::ClosureType
SelfType ClosureType
Definition: VectorExpression.hpp:212
CDPL::Math::VectorUnary::Reference
const ValueType Reference
Definition: VectorExpression.hpp:58
CDPL::Math::angleCos
VectorAngleCosine< E1, E2, T >::ResultType angleCos(const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2, const T &sd, bool clamp=true)
Definition: VectorExpression.hpp:511
CDPL::Math::Scalar1VectorBinary::ConstReference
const ValueType ConstReference
Definition: VectorExpression.hpp:209
CDPL::Math::VectorUnary::ConstReference
const ValueType ConstReference
Definition: VectorExpression.hpp:57
CDPL::Math::VectorBinary1::SizeType
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
Definition: VectorExpression.hpp:111
CDPL::Math::VectorAngleCosine::apply
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2, const T &sd, bool clamp)
Definition: Functional.hpp:298
Functional.hpp
Definition of various functors.
CDPL::Math::Scalar1VectorBinary::ConstClosureType
const SelfType ConstClosureType
Definition: VectorExpression.hpp:211
CDPL::Math::VectorBinary1::operator()
ConstReference operator()(SizeType i) const
Definition: VectorExpression.hpp:122
CDPL::Math::Scalar1VectorBinary::getSize
SizeType getSize() const
Definition: VectorExpression.hpp:219
CDPL::Math::conj
GridUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType conj(const GridExpression< E > &e)
Definition: GridExpression.hpp:360
CDPL::Math::Scalar2VectorBinary::ConstClosureType
const SelfType ConstClosureType
Definition: VectorExpression.hpp:262
CDPL::Chem::AtomType::T
const unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
CDPL::Math::VectorBinary2::getSize
SizeType getSize() const
Definition: VectorExpression.hpp:168
CDPL::Math::QuaternionVectorBinary::ClosureType
SelfType ClosureType
Definition: VectorExpression.hpp:314
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::QuaternionVectorBinary::getSize
SizeType getSize() const
Definition: VectorExpression.hpp:321
CDPL::Math::VectorBinary2Traits::ResultType
ExpressionType ResultType
Definition: VectorExpression.hpp:193
Exceptions.hpp
Definition of exception classes.
CDPL::Math::VectorUnary::ClosureType
SelfType ClosureType
Definition: VectorExpression.hpp:60
CDPL::Math::Scalar2VectorBinaryTraits::ExpressionType
Scalar2VectorBinary< E1, E2, F > ExpressionType
Definition: VectorExpression.hpp:294
CDPL::Math::VectorUnary::getSize
SizeType getSize() const
Definition: VectorExpression.hpp:67
CDPL::Math::Scalar2VectorBinary::SizeType
E1::SizeType SizeType
Definition: VectorExpression.hpp:264
CDPL::Math::Scalar2VectorBinary::Scalar2VectorBinary
Scalar2VectorBinary(const Expression1Type &e1, const Expression2Type &e2)
Definition: VectorExpression.hpp:267
CDPL::Math::VectorUnary::operator[]
ConstReference operator[](SizeType i) const
Definition: VectorExpression.hpp:77
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Math::VectorEquality::apply
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2)
Definition: Functional.hpp:326
CDPL::Math::VectorBinary2Traits::ExpressionType
VectorBinary2< E1, E2, F > ExpressionType
Definition: VectorExpression.hpp:192
CDPL::Math::VectorBinary2::DifferenceType
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
Definition: VectorExpression.hpp:163
CDPL::Math::VectorUnary::VectorUnary
VectorUnary(const ExpressionType &e)
Definition: VectorExpression.hpp:64
CDPL::Math::normInf
MatrixNormInfinity< E >::ResultType normInf(const MatrixExpression< E > &e)
Definition: MatrixExpression.hpp:917
CDPL::Math::VectorUnary::DifferenceType
E::DifferenceType DifferenceType
Definition: VectorExpression.hpp:62
CDPL::Math::Scalar2VectorBinary::Reference
const ValueType Reference
Definition: VectorExpression.hpp:261
CDPL::Math::VectorBinary2::ConstClosureType
const SelfType ConstClosureType
Definition: VectorExpression.hpp:160
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::VectorBinary1::ClosureType
SelfType ClosureType
Definition: VectorExpression.hpp:110
CDPL::Math::Scalar1VectorBinaryTraits::ResultType
ExpressionType ResultType
Definition: VectorExpression.hpp:244
CDPL::Math::VectorBinary2::operator[]
ConstReference operator[](SizeType i) const
Definition: VectorExpression.hpp:178
CDPL::Math::VectorUnaryTraits::ResultType
ExpressionType ResultType
Definition: VectorExpression.hpp:91
CDPL::Math::VectorBinary2::ConstReference
const ValueType ConstReference
Definition: VectorExpression.hpp:158
CDPL::Math::VectorEquality::ResultType
VectorBooleanBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:324
CDPL::Math::VectorNormInfinity::ResultType
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:498
CDPL::Math::VectorBinary1::Reference
const ValueType Reference
Definition: VectorExpression.hpp:108
CDPL::Math::VectorBinary2::ValueType
F::ResultType ValueType
Definition: VectorExpression.hpp:157
CDPL::Math::VectorInnerProduct::ResultType
VectorScalarBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:276
CDPL::Math::norm1
MatrixNorm1< E >::ResultType norm1(const MatrixExpression< E > &e)
Definition: MatrixExpression.hpp:903
CDPL::Math::imag
GridUnaryTraits< E, ScalarImaginary< typename E::ValueType > >::ResultType imag(const GridExpression< E > &e)
Definition: GridExpression.hpp:387
CDPL::Math::QuaternionVectorBinary::ConstClosureType
const SelfType ConstClosureType
Definition: VectorExpression.hpp:313
CDPL::Math::VectorBinary1Traits::ExpressionType
VectorBinary1< E1, E2, F > ExpressionType
Definition: VectorExpression.hpp:141
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::QuaternionVectorBinary::ConstReference
const ValueType ConstReference
Definition: VectorExpression.hpp:311
CDPL::Math::Scalar1VectorBinaryTraits
Definition: VectorExpression.hpp:241
CDPL::Math::VectorUnary
Definition: VectorExpression.hpp:48
CDPL::Math::VectorBinary1::ConstReference
const ValueType ConstReference
Definition: VectorExpression.hpp:107
Check.hpp
Definition of various preprocessor macros for error checking.
CDPL::Math::VectorToleranceEquality::apply
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2, Argument3Type epsilon)
Definition: Functional.hpp:358
Expression.hpp
Definition of basic expression types.
CDPL::Math::Scalar2VectorBinary::operator[]
ConstReference operator[](SizeType i) const
Definition: VectorExpression.hpp:280
CDPL::Math::Scalar1VectorBinary::operator()
ConstReference operator()(SizeType i) const
Definition: VectorExpression.hpp:224
CDPL::Chem::AtomType::F
const unsigned int F
Specifies Fluorine.
Definition: AtomType.hpp:107
CDPL::Math::VectorCrossProduct
Definition: Functional.hpp:384
CDPL::Math::VectorUnaryTraits
Definition: VectorExpression.hpp:88
CDPL::Math::Scalar2VectorBinary::ClosureType
SelfType ClosureType
Definition: VectorExpression.hpp:263
CDPL::Math::normInfIndex
VectorNormInfinityIndex< E >::ResultType normInfIndex(const VectorExpression< E > &e)
Definition: VectorExpression.hpp:546
CDPL::Math::QuaternionVectorBinary::ValueType
F::ResultType ValueType
Definition: VectorExpression.hpp:310
CDPL::Math::Scalar1VectorBinary::operator[]
ConstReference operator[](SizeType i) const
Definition: VectorExpression.hpp:229
CDPL::Math::length
VectorNorm2< E >::ResultType length(const VectorExpression< E > &e)
Definition: VectorExpression.hpp:553