Chemical Data Processing Library C++ API - Version 1.2.0
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 
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
Definition of exception classes.
Definition of various preprocessor macros for error checking.
#define CDPL_MATH_CHECK_SIZE_EQUALITY(size1, size2, e)
Definition: Check.hpp:62
Common type deduction.
Definition of basic expression types.
Definition of various functors.
Definition of type traits.
Thrown to indicate that the size of a (multidimensional) array is not correct.
Definition: Base/Exceptions.hpp:133
E ExpressionType
Definition: Expression.hpp:42
Definition: Expression.hpp:98
Definition: VectorExpression.hpp:300
SelfType ClosureType
Definition: VectorExpression.hpp:314
SizeType getSize() const
Definition: VectorExpression.hpp:321
ConstReference operator()(SizeType i) const
Definition: VectorExpression.hpp:326
E2::SizeType SizeType
Definition: VectorExpression.hpp:315
E2::DifferenceType DifferenceType
Definition: VectorExpression.hpp:316
QuaternionVectorBinary(const Expression1Type &e1, const Expression2Type &e2)
Definition: VectorExpression.hpp:318
const ValueType Reference
Definition: VectorExpression.hpp:312
const ValueType ConstReference
Definition: VectorExpression.hpp:311
const SelfType ConstClosureType
Definition: VectorExpression.hpp:313
F::ResultType ValueType
Definition: VectorExpression.hpp:310
ConstReference operator[](SizeType i) const
Definition: VectorExpression.hpp:331
Definition: VectorExpression.hpp:198
Scalar1VectorBinary(const Expression1Type &e1, const Expression2Type &e2)
Definition: VectorExpression.hpp:216
const ValueType ConstReference
Definition: VectorExpression.hpp:209
ConstReference operator[](SizeType i) const
Definition: VectorExpression.hpp:229
E2::DifferenceType DifferenceType
Definition: VectorExpression.hpp:214
const ValueType Reference
Definition: VectorExpression.hpp:210
SelfType ClosureType
Definition: VectorExpression.hpp:212
const SelfType ConstClosureType
Definition: VectorExpression.hpp:211
E2::SizeType SizeType
Definition: VectorExpression.hpp:213
ConstReference operator()(SizeType i) const
Definition: VectorExpression.hpp:224
SizeType getSize() const
Definition: VectorExpression.hpp:219
F::ResultType ValueType
Definition: VectorExpression.hpp:208
Definition: VectorExpression.hpp:249
const SelfType ConstClosureType
Definition: VectorExpression.hpp:262
E1::DifferenceType DifferenceType
Definition: VectorExpression.hpp:265
F::ResultType ValueType
Definition: VectorExpression.hpp:259
const ValueType ConstReference
Definition: VectorExpression.hpp:260
Scalar2VectorBinary(const Expression1Type &e1, const Expression2Type &e2)
Definition: VectorExpression.hpp:267
SelfType ClosureType
Definition: VectorExpression.hpp:263
SizeType getSize() const
Definition: VectorExpression.hpp:270
ConstReference operator[](SizeType i) const
Definition: VectorExpression.hpp:280
E1::SizeType SizeType
Definition: VectorExpression.hpp:264
ConstReference operator()(SizeType i) const
Definition: VectorExpression.hpp:275
const ValueType Reference
Definition: VectorExpression.hpp:261
Definition: VectorExpression.hpp:96
ConstReference operator()(SizeType i) const
Definition: VectorExpression.hpp:122
ConstReference operator[](SizeType i) const
Definition: VectorExpression.hpp:127
const ValueType Reference
Definition: VectorExpression.hpp:108
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
Definition: VectorExpression.hpp:112
VectorBinary1(const Expression1Type &e1, const Expression2Type &e2)
Definition: VectorExpression.hpp:114
F::ResultType ValueType
Definition: VectorExpression.hpp:106
const SelfType ConstClosureType
Definition: VectorExpression.hpp:109
SizeType getSize() const
Definition: VectorExpression.hpp:117
SelfType ClosureType
Definition: VectorExpression.hpp:110
const ValueType ConstReference
Definition: VectorExpression.hpp:107
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
Definition: VectorExpression.hpp:111
Definition: VectorExpression.hpp:147
SizeType getSize() const
Definition: VectorExpression.hpp:168
ConstReference operator()(SizeType i) const
Definition: VectorExpression.hpp:173
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
Definition: VectorExpression.hpp:162
F::ResultType ValueType
Definition: VectorExpression.hpp:157
const SelfType ConstClosureType
Definition: VectorExpression.hpp:160
const ValueType Reference
Definition: VectorExpression.hpp:159
VectorBinary2(const Expression1Type &e1, const Expression2Type &e2)
Definition: VectorExpression.hpp:165
ConstReference operator[](SizeType i) const
Definition: VectorExpression.hpp:178
SelfType ClosureType
Definition: VectorExpression.hpp:161
const ValueType ConstReference
Definition: VectorExpression.hpp:158
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
Definition: VectorExpression.hpp:163
Definition: Expression.hpp:54
Definition: VectorExpression.hpp:48
E::SizeType SizeType
Definition: VectorExpression.hpp:61
SelfType ClosureType
Definition: VectorExpression.hpp:60
const SelfType ConstClosureType
Definition: VectorExpression.hpp:59
E::DifferenceType DifferenceType
Definition: VectorExpression.hpp:62
VectorUnary(const ExpressionType &e)
Definition: VectorExpression.hpp:64
F::ResultType ValueType
Definition: VectorExpression.hpp:56
const ValueType Reference
Definition: VectorExpression.hpp:58
ConstReference operator[](SizeType i) const
Definition: VectorExpression.hpp:77
const ValueType ConstReference
Definition: VectorExpression.hpp:57
ConstReference operator()(SizeType i) const
Definition: VectorExpression.hpp:72
SizeType getSize() const
Definition: VectorExpression.hpp:67
constexpr unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
constexpr unsigned int F
Specifies Fluorine.
Definition: AtomType.hpp:107
constexpr unsigned int E
Specifies that the stereocenter has E configuration.
Definition: CIPDescriptor.hpp:96
VectorBinary2Traits< E1, E2, VectorCrossProduct< E1, E2 > >::ResultType crossProd(const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
Definition: VectorExpression.hpp:494
GridBinary1Traits< E1, E2, ScalarMultiplication< typename E1::ValueType, typename E2::ValueType > >::ResultType elemProd(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Definition: GridExpression.hpp:406
MatrixTranspose< E > trans(MatrixExpression< E > &e)
Definition: MatrixExpression.hpp:941
GridUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType herm(const GridExpression< E > &e)
Definition: GridExpression.hpp:369
GridUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType conj(const GridExpression< E > &e)
Definition: GridExpression.hpp:360
VectorNormInfinityIndex< E >::ResultType normInfIndex(const VectorExpression< E > &e)
Definition: VectorExpression.hpp:546
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
VectorInnerProduct< E1, E2 >::ResultType innerProd(const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
Definition: VectorExpression.hpp:504
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
GridUnaryTraits< E, ScalarReal< typename E::ValueType > >::ResultType real(const GridExpression< E > &e)
Definition: GridExpression.hpp:378
QuaternionNorm2< E >::ResultType norm2(const QuaternionExpression< E > &e)
Definition: QuaternionExpression.hpp:804
GridEquality< E1, E2 >::ResultType operator!=(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Definition: GridExpression.hpp:346
VectorAngleCosine< E1, E2, T >::ResultType angleCos(const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2, const T &sd, bool clamp=true)
Definition: VectorExpression.hpp:511
VectorNorm2< E >::ResultType length(const VectorExpression< E > &e)
Definition: VectorExpression.hpp:553
GridEquality< E1, E2 >::ResultType operator==(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Definition: GridExpression.hpp:339
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
GridBinary1Traits< E1, E2, ScalarDivision< typename E1::ValueType, typename E2::ValueType > >::ResultType elemDiv(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Definition: GridExpression.hpp:396
GridUnaryTraits< E, ScalarImaginary< typename E::ValueType > >::ResultType imag(const GridExpression< E > &e)
Definition: GridExpression.hpp:387
MatrixNormInfinity< E >::ResultType normInf(const MatrixExpression< E > &e)
Definition: MatrixExpression.hpp:917
QuaternionVectorBinaryTraits< E1, E2, QuaternionVectorRotation< E1, E2 > >::ResultType rotate(const QuaternionExpression< E1 > &e1, const VectorExpression< E2 > &e2)
Definition: VectorExpression.hpp:574
GridUnaryTraits< E, ScalarNegation< typename E::ValueType > >::ResultType operator-(const GridExpression< E > &e)
Definition: GridExpression.hpp:272
GridElementSum< E >::ResultType sum(const GridExpression< E > &e)
Definition: GridExpression.hpp:416
MatrixNorm1< E >::ResultType norm1(const MatrixExpression< E > &e)
Definition: MatrixExpression.hpp:903
const E & operator+(const GridExpression< E > &e)
Definition: GridExpression.hpp:282
The namespace of the Chemical Data Processing Library.
std::common_type< T1, T2 >::type Type
Definition: CommonType.hpp:43
Definition: VectorExpression.hpp:343
QuaternionVectorBinary< E1, E2, F > ExpressionType
Definition: VectorExpression.hpp:345
ExpressionType ResultType
Definition: VectorExpression.hpp:346
Definition: VectorExpression.hpp:241
ExpressionType ResultType
Definition: VectorExpression.hpp:244
Scalar1VectorBinary< E1, E2, F > ExpressionType
Definition: VectorExpression.hpp:243
Definition: VectorExpression.hpp:292
ExpressionType ResultType
Definition: VectorExpression.hpp:295
Scalar2VectorBinary< E1, E2, F > ExpressionType
Definition: VectorExpression.hpp:294
Definition: Functional.hpp:211
Definition: Functional.hpp:253
Definition: Functional.hpp:239
Definition: Functional.hpp:225
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2, const T &sd, bool clamp)
Definition: Functional.hpp:298
CommonType< typename VectorInnerProduct< V1, V2 >::ResultType, T >::Type ResultType
Definition: Functional.hpp:296
Definition: VectorExpression.hpp:139
ExpressionType ResultType
Definition: VectorExpression.hpp:142
VectorBinary1< E1, E2, F > ExpressionType
Definition: VectorExpression.hpp:141
Definition: VectorExpression.hpp:190
VectorBinary2< E1, E2, F > ExpressionType
Definition: VectorExpression.hpp:192
ExpressionType ResultType
Definition: VectorExpression.hpp:193
Definition: Functional.hpp:384
VectorScalarUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:423
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:425
VectorBooleanBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:324
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2)
Definition: Functional.hpp:326
VectorScalarBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:276
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2)
Definition: Functional.hpp:278
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:455
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:453
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:474
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:476
VectorScalarIndexUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:532
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:534
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:500
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:498
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::ResultType ResultType
Definition: Functional.hpp:355
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2, Argument3Type epsilon)
Definition: Functional.hpp:358
Definition: VectorExpression.hpp:88
ExpressionType ResultType
Definition: VectorExpression.hpp:91
VectorUnary< E, F > ExpressionType
Definition: VectorExpression.hpp:90