Chemical Data Processing Library C++ API - Version 1.1.1
Functional.hpp
Go to the documentation of this file.
1 /*
2  * Functional.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_FUNCTIONAL_HPP
28 #define CDPL_MATH_FUNCTIONAL_HPP
29 
30 #include <boost/algorithm/clamp.hpp>
31 
32 #include "CDPL/Math/Check.hpp"
33 #include "CDPL/Math/CommonType.hpp"
34 #include "CDPL/Math/TypeTraits.hpp"
35 #include "CDPL/Base/Exceptions.hpp"
36 
37 
38 namespace CDPL
39 {
40 
41  namespace Math
42  {
43 
44  template <typename E>
45  class VectorExpression;
46  template <typename E>
47  class MatrixExpression;
48  template <typename E>
49  class QuaternionExpression;
50  template <typename E>
51  class GridExpression;
52 
53  template <typename T1, typename T2>
55  {
56 
57  typedef T1 Argument1Type;
58  typedef const T2& Argument2Type;
59  };
60 
61  template <typename T1, typename T2>
63  {
64 
67 
68  static void apply(Argument1Type t1, Argument2Type t2)
69  {
70  t1 = t2;
71  }
72  };
73 
74  template <typename T1, typename T2>
76  {
77 
80 
81  static void apply(Argument1Type t1, Argument2Type t2)
82  {
83  t1 += t2;
84  }
85  };
86 
87  template <typename T1, typename T2>
89  {
90 
93 
94  static void apply(Argument1Type t1, Argument2Type t2)
95  {
96  t1 -= t2;
97  }
98  };
99 
100  template <typename T1, typename T2>
102  {
103 
106 
107  static void apply(Argument1Type t1, Argument2Type t2)
108  {
109  t1 *= t2;
110  }
111  };
112 
113  template <typename T1, typename T2>
115  {
116 
119 
120  static void apply(Argument1Type t1, Argument2Type t2)
121  {
122  t1 /= t2;
123  }
124  };
125 
126  template <typename T>
128  {
129 
130  typedef T ValueType;
131  typedef const T& ArgumentType;
133  };
134 
135  template <typename T>
137  {
138 
142 
144  {
145  return -v;
146  }
147  };
148 
149  template <typename T>
151  {
152 
156 
158  {
159  return TypeTraits<ValueType>::conj(v);
160  }
161  };
162 
163  template <typename T>
165  {
166 
167  typedef T ValueType;
168  typedef const T& ArgumentType;
170  };
171 
172  template <typename T>
174  {
175 
179 
181  {
182  return TypeTraits<ValueType>::real(v);
183  }
184  };
185 
186  template <typename T>
188  {
189 
193 
195  {
196  return TypeTraits<ValueType>::imag(v);
197  }
198  };
199 
200  template <typename T1, typename T2>
202  {
203 
204  typedef const T1& Argument1Type;
205  typedef const T2& Argument2Type;
207  };
208 
209  template <typename T1, typename T2>
210  struct ScalarAddition : public ScalarBinaryFunctor<T1, T2>
211  {
212 
216 
218  {
219  return (t1 + t2);
220  }
221  };
222 
223  template <typename T1, typename T2>
224  struct ScalarSubtraction : public ScalarBinaryFunctor<T1, T2>
225  {
226 
230 
232  {
233  return (t1 - t2);
234  }
235  };
236 
237  template <typename T1, typename T2>
239  {
240 
244 
246  {
247  return (t1 * t2);
248  }
249  };
250 
251  template <typename T1, typename T2>
252  struct ScalarDivision : public ScalarBinaryFunctor<T1, T2>
253  {
254 
258 
260  {
261  return (t1 / t2);
262  }
263  };
264 
265  template <typename V1, typename V2>
267  {
268 
270  };
271 
272  template <typename V1, typename V2>
274  {
275 
277 
279  {
281 
282  SizeType size = CDPL_MATH_CHECK_SIZE_EQUALITY(SizeType(e1().getSize()), SizeType(e2().getSize()), Base::SizeError);
283  ResultType res = ResultType();
284 
285  for (SizeType i = 0; i < size; i++)
286  res += e1()(i) * e2()(i);
287 
288  return res;
289  }
290  };
291 
292  template <typename V1, typename V2, typename T>
294  {
295 
297 
298  static ResultType apply(const VectorExpression<V1>& e1, const VectorExpression<V2>& e2, const T& sd, bool clamp)
299  {
301 
302  if (!clamp)
303  return res;
304 
305  return boost::algorithm::clamp(res, ResultType(-1), ResultType(1));
306  }
307  };
308 
309  template <typename V1, typename V2>
311  {
312 
313  typedef bool ResultType;
316  };
317 
318  template <typename V1, typename V2>
320  {
321 
325 
327  {
328  if (SizeType(e1().getSize()) != SizeType(e2().getSize()))
329  return false;
330 
331  for (SizeType i = 0, size = e1().getSize(); i < size; i++)
332  if (ValueType(e1()(i)) != ValueType(e2()(i)))
333  return false;
334 
335  return true;
336  }
337  };
338 
339  template <typename V1, typename V2, typename T>
341  {
342 
343  typedef bool ResultType;
344  typedef const T& Argument3Type;
347  };
348 
349  template <typename V1, typename V2, typename T>
351  {
352 
357 
359  {
360  typedef typename CommonType<typename TypeTraits<ValueType>::RealType, T>::Type ComparisonType;
361 
362  if (SizeType(e1().getSize()) != SizeType(e2().getSize()))
363  return false;
364 
365  ComparisonType norm_inf_max(epsilon);
366 
367  for (SizeType i = 0, size = e1().getSize(); i < size; i++)
368  if (ComparisonType(TypeTraits<ValueType>::normInf(e2()(i) - e1()(i))) > norm_inf_max)
369  return false;
370 
371  return true;
372  }
373  };
374 
375  template <typename V1, typename V2>
377  {
378 
380  };
381 
382  template <typename V1, typename V2>
383  struct VectorCrossProduct : public VectorBinaryFunctor<V1, V2>
384  {
385 
387 
388  template <typename E1, typename E2, typename SizeType>
389  static ResultType apply(const VectorExpression<E1>& e1, const VectorExpression<E2>& e2, SizeType i)
390  {
391  CDPL_MATH_CHECK(e1().getSize() == 3, "Invalid vector size", Base::SizeError);
392  CDPL_MATH_CHECK(e2().getSize() == 3, "Invalid vector size", Base::SizeError);
393 
394  switch (i) {
395 
396  case 0:
397  return (e1()(1) * e2()(2) - e1()(2) * e2()(1)); // c1 = a2 * b3 - a3 * b2;
398 
399  case 1:
400  return (e1()(2) * e2()(0) - e1()(0) * e2()(2)); // c2 = a3 * b1 - a1 * b3;
401 
402  case 2:
403  return (e1()(0) * e2()(1) - e1()(1) * e2()(0)); // c3 = a1 * b2 - a2 * b1;
404 
405  default:
406  return ResultType();
407  }
408  }
409  };
410 
411  template <typename V>
413  {
414 
415  typedef typename V::ValueType ResultType;
416  typedef typename V::SizeType SizeType;
417  };
418 
419  template <typename V>
421  {
422 
424 
426  {
427  typedef typename V::SizeType SizeType;
428 
429  ResultType res = ResultType();
430 
431  for (SizeType i = 0, size = e().getSize(); i < size; i++)
432  res += e()(i);
433 
434  return res;
435  }
436  };
437 
438  template <typename V>
440  {
441 
442  typedef typename V::ValueType ValueType;
445  };
446 
447  template <typename V>
449  {
450 
454 
456  {
457  typedef typename V::SizeType SizeType;
458 
459  RealType res = RealType();
460 
461  for (SizeType i = 0, size = e().getSize(); i < size; i++)
462  res += TypeTraits<ValueType>::norm1(e()(i));
463 
464  return res;
465  }
466  };
467 
468  template <typename V>
470  {
471 
475 
477  {
478  typedef typename V::SizeType SizeType;
479 
480  RealType res2 = RealType();
481 
482  for (SizeType i = 0, size = e().getSize(); i < size; i++) {
484 
485  res2 += t * t;
486  }
487 
488  return TypeTraits<RealType>::sqrt(res2);
489  }
490  };
491 
492  template <typename V>
494  {
495 
499 
501  {
502  typedef typename V::SizeType SizeType;
503 
504  RealType res = RealType();
505 
506  for (SizeType i = 0, size = e().getSize(); i < size; i++) {
508 
509  if (t > res)
510  res = t;
511  }
512 
513  return res;
514  }
515  };
516 
517  template <typename V>
519  {
520 
521  typedef typename V::ValueType ValueType;
523  typedef typename V::SizeType ResultType;
524  };
525 
526  template <typename V>
528  {
529 
533 
535  {
536  typedef typename V::SizeType SizeType;
537 
538  RealType norm = RealType();
539  ResultType res = ResultType(0);
540 
541  for (SizeType i = 0, size = e().getSize(); i < size; i++) {
543 
544  if (t > norm) {
545  norm = t;
546  res = ResultType(i);
547  }
548  }
549 
550  return res;
551  }
552  };
553 
554  template <typename M1, typename M2>
556  {
557 
558  typedef bool ResultType;
561  };
562 
563  template <typename M1, typename M2>
565  {
566 
570 
572  {
573  if (SizeType(e1().getSize1()) != SizeType(e2().getSize1()))
574  return false;
575 
576  if (SizeType(e1().getSize2()) != SizeType(e2().getSize2()))
577  return false;
578 
579  for (SizeType i = 0, size1 = e1().getSize1(); i < size1; i++)
580  for (SizeType j = 0, size2 = e1().getSize2(); j < size2; j++)
581  if (ValueType(e1()(i, j)) != ValueType(e2()(i, j)))
582  return false;
583 
584  return true;
585  }
586  };
587 
588  template <typename M1, typename M2, typename T>
590  {
591 
592  typedef bool ResultType;
593  typedef const T& Argument3Type;
596  };
597 
598  template <typename M1, typename M2, typename T>
600  {
601 
606 
608  {
609  typedef typename CommonType<typename TypeTraits<ValueType>::RealType, T>::Type ComparisonType;
610 
611  if (SizeType(e1().getSize1()) != SizeType(e2().getSize1()))
612  return false;
613 
614  if (SizeType(e1().getSize2()) != SizeType(e2().getSize2()))
615  return false;
616 
617  ComparisonType norm_inf_max(epsilon);
618 
619  for (SizeType i = 0, size1 = e1().getSize1(); i < size1; i++)
620  for (SizeType j = 0, size2 = e1().getSize2(); j < size2; j++)
621  if (ComparisonType(TypeTraits<ValueType>::normInf(e2()(i, j) - e1()(i, j))) > norm_inf_max)
622  return false;
623 
624  return true;
625  }
626  };
627 
628  template <typename M>
630  {
631 
632  typedef typename M::ValueType ResultType;
633  };
634 
635  template <typename M>
637  {
638 
640 
642  {
643  typedef typename M::SizeType SizeType;
644 
645  ResultType res = ResultType();
646  SizeType size1 = e().getSize1();
647  SizeType size2 = e().getSize2();
648 
649  for (SizeType i = 0; i < size1; i++)
650  for (SizeType j = 0; j < size2; j++)
651  res += e()(i, j);
652 
653  return res;
654  }
655  };
656 
657  template <typename M>
659  {
660 
662 
664  {
665  typedef typename M::SizeType SizeType;
666 
667  SizeType size = CDPL_MATH_CHECK_SIZE_EQUALITY(e().getSize1(), e().getSize2(), Base::SizeError);
668  ResultType res = ResultType();
669 
670  for (SizeType i = 0; i < size; i++)
671  res += e()(i, i);
672 
673  return res;
674  }
675  };
676 
677  template <typename M>
679  {
680 
681  typedef typename M::ValueType ValueType;
684  };
685 
686  template <typename M>
688  {
689 
693 
695  {
696  typedef typename M::SizeType SizeType;
697 
698  RealType res = RealType();
699  SizeType size1 = e().getSize1();
700  SizeType size2 = e().getSize2();
701 
702  for (SizeType j = 0; j < size2; j++) {
703  RealType t = RealType();
704 
705  for (SizeType i = 0; i < size1; i++)
706  t += TypeTraits<ValueType>::norm1(e()(i, j));
707 
708  if (t > res)
709  res = t;
710  }
711 
712  return res;
713  }
714  };
715 
716  template <typename M>
718  {
719 
723 
725  {
726  typedef typename M::SizeType SizeType;
727 
728  RealType res2 = RealType();
729  SizeType size1 = e().getSize1();
730  SizeType size2 = e().getSize2();
731 
732  for (SizeType i = 0; i < size1; i++) {
733  for (SizeType j = 0; j < size2; j++) {
734  RealType t = TypeTraits<ValueType>::norm2(e()(i, j));
735 
736  res2 += t * t;
737  }
738  }
739 
740  return TypeTraits<RealType>::sqrt(res2);
741  }
742  };
743 
744  template <typename M>
746  {
747 
751 
753  {
754  typedef typename M::SizeType SizeType;
755 
756  RealType res = RealType();
757  SizeType size1 = e().getSize1();
758  SizeType size2 = e().getSize2();
759 
760  for (SizeType i = 0; i < size1; i++) {
761  RealType t = RealType();
762 
763  for (SizeType j = 0; j < size2; j++)
764  t += TypeTraits<ValueType>::normInf(e()(i, j));
765 
766  if (t > res)
767  res = t;
768  }
769 
770  return res;
771  }
772  };
773 
774  template <typename V>
776  {
777 
778  typedef typename V::ValueType ResultType;
779  typedef typename V::SizeType SizeType;
780  };
781 
782  template <typename V>
784  {
785 
788 
789  template <typename E>
791  {
792  if (i == j)
793  return e()(i);
794 
795  return ResultType();
796  }
797  };
798 
799  template <typename V>
801  {
802 
805 
806  template <typename E>
808  {
809  CDPL_MATH_CHECK(e().getSize() == 3, "Invalid vector size", Base::SizeError);
810 
811  // | 0 -a3 a2 |
812  // cross([a1, a2, a3]) = | a3 0 -a1 |
813  // | -a2 a1 0 |
814  switch (i) {
815 
816  case 0:
817  switch (j) {
818 
819  case 1:
820  return -e()(2);
821 
822  case 2:
823  return e()(1);
824 
825  default:
826  return ResultType();
827  }
828 
829  case 1:
830  switch (j) {
831 
832  case 0:
833  return e()(2);
834 
835  case 2:
836  return -e()(0);
837 
838  default:
839  return ResultType();
840  }
841 
842  case 2:
843  switch (j) {
844 
845  case 0:
846  return -e()(1);
847 
848  case 1:
849  return e()(0);
850 
851  default:
852  return ResultType();
853  }
854 
855  default:
856  return ResultType();
857  }
858  }
859  };
860 
861  template <typename M, typename V>
863  {
864 
868  };
869 
870  template <typename M, typename V>
872  {
873 
877 
878  template <typename E1, typename E2>
880  {
881  SizeType size = CDPL_MATH_CHECK_SIZE_EQUALITY(SizeType(e1().getSize2()), SizeType(e2().getSize()), Base::SizeError);
882  ResultType res = ResultType();
883 
884  for (SizeType j = 0; j < size; j++)
885  res += e1()(i, j) * e2()(j);
886 
887  return res;
888  }
889  };
890 
891  template <typename V, typename M>
893  {
894 
898 
899  template <typename E1, typename E2>
901  {
902  SizeType size = CDPL_MATH_CHECK_SIZE_EQUALITY(SizeType(e1().getSize()), SizeType(e2().getSize1()), Base::SizeError);
903  ResultType res = ResultType();
904 
905  for (SizeType j = 0; j < size; j++)
906  res += e1()(j) * e2()(j, i);
907 
908  return res;
909  }
910  };
911 
912  template <typename M1, typename M2>
914  {
915 
919  };
920 
921  template <typename M1, typename M2>
922  struct MatrixProduct : public MatrixBinaryFunctor<M1, M2>
923  {
924 
928 
929  template <typename E1, typename E2>
931  {
932  SizeType size = CDPL_MATH_CHECK_SIZE_EQUALITY(SizeType(e1().getSize2()), SizeType(e2().getSize1()), Base::SizeError);
933  ResultType res = ResultType();
934 
935  for (SizeType k = 0; k < size; k++)
936  res += e1()(i, k) * e2()(k, j);
937 
938  return res;
939  }
940  };
941 
942  template <typename Q1, typename Q2>
944  {
945 
946  typedef bool ResultType;
948  };
949 
950  template <typename Q1, typename Q2>
952  {
953 
956 
958  {
959  return (ValueType(e1().getC1()) == ValueType(e2().getC1()) && ValueType(e1().getC2()) == ValueType(e2().getC2()) && ValueType(e1().getC3()) == ValueType(e2().getC3()) && ValueType(e1().getC4()) == ValueType(e2().getC4()));
960  }
961  };
962 
963  template <typename Q1, typename Q2, typename T>
965  {
966 
967  typedef bool ResultType;
968  typedef const T& Argument3Type;
970  };
971 
972  template <typename Q1, typename Q2, typename T>
974  {
975 
979 
981  {
982  typedef typename CommonType<typename TypeTraits<ValueType>::RealType, T>::Type ComparisonType;
983 
984  ComparisonType norm_inf_max(epsilon);
985 
986  return (ComparisonType(TypeTraits<ValueType>::normInf(e2().getC1() - e1().getC1())) <= norm_inf_max && ComparisonType(TypeTraits<ValueType>::normInf(e2().getC2() - e1().getC2())) <= norm_inf_max && ComparisonType(TypeTraits<ValueType>::normInf(e2().getC3() - e1().getC3())) <= norm_inf_max && ComparisonType(TypeTraits<ValueType>::normInf(e2().getC4() - e1().getC4())) <= norm_inf_max);
987  }
988  };
989 
990  template <typename Q>
992  {
993 
994  typedef typename Q::ValueType ResultType;
995  };
996 
997  template <typename Q>
999  {
1000 
1002 
1004  {
1005  return (e().getC1() + e().getC2() + e().getC3() + e().getC4());
1006  }
1007  };
1008 
1009  template <typename Q>
1011  {
1012 
1013  typedef typename Q::ValueType ValueType;
1016  };
1017 
1018  template <typename Q>
1020  {
1021 
1025 
1027  {
1028  RealType t = e().getC1() * e().getC1() +
1029  e().getC2() * e().getC2() +
1030  e().getC3() * e().getC3() +
1031  e().getC4() * e().getC4();
1032 
1033  return TypeTraits<RealType>::sqrt(t);
1034  }
1035  };
1036 
1037  template <typename Q>
1039  {
1040 
1044 
1046  {
1047  RealType t = e().getC1() * e().getC1() +
1048  e().getC2() * e().getC2() +
1049  e().getC3() * e().getC3() +
1050  e().getC4() * e().getC4();
1051 
1052  return t;
1053  }
1054  };
1055 
1056  template <typename Q>
1058  {
1059 
1060  typedef typename Q::ValueType ResultType;
1061  };
1062 
1063  template <typename Q>
1065  {
1066 
1068 
1069  template <typename E>
1071  {
1072  return ResultType();
1073  }
1074 
1075  template <typename E>
1077  {
1078  return e().getC2();
1079  }
1080 
1081  template <typename E>
1083  {
1084  return e().getC3();
1085  }
1086 
1087  template <typename E>
1089  {
1090  return e().getC4();
1091  }
1092  };
1093 
1094  template <typename Q>
1096  {
1097 
1099 
1100  template <typename E>
1102  {
1103  return e().getC1();
1104  }
1105 
1106  template <typename E>
1108  {
1109  return -e().getC2();
1110  }
1111 
1112  template <typename E>
1114  {
1115  return -e().getC3();
1116  }
1117 
1118  template <typename E>
1120  {
1121  return -e().getC4();
1122  }
1123  };
1124 
1125  template <typename T, typename Q>
1127  {
1128 
1130  typedef const T& Argument1Type;
1131  };
1132 
1133  template <typename T, typename Q>
1135  {
1136 
1139 
1140  template <typename E>
1142  {
1143  return (t + e().getC1());
1144  }
1145 
1146  template <typename E>
1148  {
1149  return e().getC2();
1150  }
1151 
1152  template <typename E>
1154  {
1155  return e().getC3();
1156  }
1157 
1158  template <typename E>
1160  {
1161  return e().getC4();
1162  }
1163  };
1164 
1165  template <typename T, typename Q>
1167  {
1168 
1171 
1172  template <typename E>
1174  {
1175  return (t - e().getC1());
1176  }
1177 
1178  template <typename E>
1180  {
1181  return -e().getC2();
1182  }
1183 
1184  template <typename E>
1186  {
1187  return -e().getC3();
1188  }
1189 
1190  template <typename E>
1192  {
1193  return -e().getC4();
1194  }
1195  };
1196 
1197  template <typename Q, typename T>
1199  {
1200 
1202  typedef const T& Argument2Type;
1203  };
1204 
1205  template <typename Q, typename T>
1207  {
1208 
1211 
1212  template <typename E>
1214  {
1215  return (e().getC1() + t);
1216  }
1217 
1218  template <typename E>
1220  {
1221  return e().getC2();
1222  }
1223 
1224  template <typename E>
1226  {
1227  return e().getC3();
1228  }
1229 
1230  template <typename E>
1232  {
1233  return e().getC4();
1234  }
1235  };
1236 
1237  template <typename Q, typename T>
1239  {
1240 
1243 
1244  template <typename E>
1246  {
1247  return (e().getC1() - t);
1248  }
1249 
1250  template <typename E>
1252  {
1253  return e().getC2();
1254  }
1255 
1256  template <typename E>
1258  {
1259  return e().getC3();
1260  }
1261 
1262  template <typename E>
1264  {
1265  return e().getC4();
1266  }
1267  };
1268 
1269  template <typename Q, typename T>
1271  {
1272 
1275 
1276  template <typename E>
1278  {
1279  return (e().getC1() / n2);
1280  }
1281 
1282  template <typename E>
1284  {
1285  return (-e().getC2() / n2);
1286  }
1287 
1288  template <typename E>
1290  {
1291  return (-e().getC3() / n2);
1292  }
1293 
1294  template <typename E>
1296  {
1297  return (-e().getC4() / n2);
1298  }
1299  };
1300 
1301  template <typename Q1, typename Q2>
1303  {
1304 
1306  };
1307 
1308  template <typename Q1, typename Q2>
1310  {
1311 
1313 
1314  template <typename E1, typename E2>
1316  {
1317  // a = a1 * a2 - b1 * b2 - c1 * c2 - d1 * d2
1318  return (e1().getC1() * e2().getC1() - e1().getC2() * e2().getC2() - e1().getC3() * e2().getC3() - e1().getC4() * e2().getC4());
1319  }
1320 
1321  template <typename E1, typename E2>
1323  {
1324  // b = a1 * b2 + b1 * a2 + c1 * d2 - d1 * c2
1325  return (e1().getC1() * e2().getC2() + e1().getC2() * e2().getC1() + e1().getC3() * e2().getC4() - e1().getC4() * e2().getC3());
1326  }
1327 
1328  template <typename E1, typename E2>
1330  {
1331  // c = a1 * c2 - b1 * d2 + c1 * a2 + d1 * b2
1332  return (e1().getC1() * e2().getC3() - e1().getC2() * e2().getC4() + e1().getC3() * e2().getC1() + e1().getC4() * e2().getC2());
1333  }
1334 
1335  template <typename E1, typename E2>
1337  {
1338  // d = a1 * d2 + b1 * c2 - c1 * b2 + d1 * a2
1339  return (e1().getC1() * e2().getC4() + e1().getC2() * e2().getC3() - e1().getC3() * e2().getC2() + e1().getC4() * e2().getC1());
1340  }
1341  };
1342 
1343  template <typename Q1, typename Q2, typename T>
1345  {
1346 
1348  typedef const T& Argument3Type;
1349  };
1350 
1351  template <typename Q1, typename Q2, typename T>
1353  {
1354 
1357 
1358  template <typename E1, typename E2>
1360  {
1361  // a = (a1 * a2 + b1 * b2 + c1 * c2 + d1 * d2) / n2
1362  return ((e1().getC1() * e2().getC1() + e1().getC2() * e2().getC2() + e1().getC3() * e2().getC3() + e1().getC4() * e2().getC4()) / n2);
1363  }
1364 
1365  template <typename E1, typename E2>
1367  {
1368  // b = (-a1 * b2 + b1 * a2 - c1 * d2 + d1 * c2) / n2
1369  return ((-e1().getC1() * e2().getC2() + e1().getC2() * e2().getC1() - e1().getC3() * e2().getC4() + e1().getC4() * e2().getC3()) / n2);
1370  }
1371 
1372  template <typename E1, typename E2>
1374  {
1375  // c = (-a1 * c2 + b1 * d2 + c1 * a2 - d1 * b2) / n2
1376  return ((-e1().getC1() * e2().getC3() + e1().getC2() * e2().getC4() + e1().getC3() * e2().getC1() - e1().getC4() * e2().getC2()) / n2);
1377  }
1378 
1379  template <typename E1, typename E2>
1381  {
1382  // d = (-a1 * d2 - b1 * c2 + c1 * b2 + d1 * a2) / n2
1383  return ((-e1().getC1() * e2().getC4() - e1().getC2() * e2().getC3() + e1().getC3() * e2().getC2() + e1().getC4() * e2().getC1()) / n2);
1384  }
1385  };
1386 
1387  template <typename T1, typename Q, typename T2>
1389  {
1390 
1392  typedef const T1& Argument1Type;
1393  typedef const T2& Argument3Type;
1394  };
1395 
1396  template <typename T1, typename Q, typename T2>
1398  {
1399 
1403 
1404  template <typename E>
1406  {
1407  return (t * e().getC1() / n2);
1408  }
1409 
1410  template <typename E>
1412  {
1413  return (t * -e().getC2() / n2);
1414  }
1415 
1416  template <typename E>
1418  {
1419  return (t * -e().getC3() / n2);
1420  }
1421 
1422  template <typename E>
1424  {
1425  return (t * -e().getC4() / n2);
1426  }
1427  };
1428 
1429  template <typename Q, typename V>
1431  {
1432 
1434  typedef typename V::SizeType SizeType;
1436  };
1437 
1438  template <typename Q, typename V>
1440  {
1441 
1445 
1446  template <typename E1, typename E2>
1448  {
1449  CDPL_MATH_CHECK(e2().getSize() >= 3, "Invalid vector size", Base::SizeError);
1450 
1451  switch (i) {
1452 
1453  case 0: {
1454  // vr1 = (a2 + b2 - c2 - d2) * v1 + (2bc - 2ad) * v2 + (2bd + 2ac) * v3
1455  ValueType t1 = e1().getC1() * e1().getC1() + e1().getC2() * e1().getC2() - e1().getC3() * e1().getC3() - e1().getC4() * e1().getC4();
1456  ValueType t2 = ValueType(2) * (e1().getC2() * e1().getC3() - e1().getC1() * e1().getC4());
1457  ValueType t3 = ValueType(2) * (e1().getC2() * e1().getC4() + e1().getC1() * e1().getC3());
1458 
1459  return (t1 * e2()(0) + t2 * e2()(1) + t3 * e2()(2));
1460  }
1461 
1462  case 1: {
1463  // vr2 = (2bc + 2ad) * v1 + (a2 - b2 + c2 - d2) * v2 + (2cd - 2ab) * v3
1464  ValueType t1 = ValueType(2) * (e1().getC2() * e1().getC3() + e1().getC1() * e1().getC4());
1465  ValueType t2 = e1().getC1() * e1().getC1() - e1().getC2() * e1().getC2() + e1().getC3() * e1().getC3() - e1().getC4() * e1().getC4();
1466  ValueType t3 = ValueType(2) * (e1().getC3() * e1().getC4() - e1().getC1() * e1().getC2());
1467 
1468  return (t1 * e2()(0) + t2 * e2()(1) + t3 * e2()(2));
1469  }
1470 
1471  case 2: {
1472  // vr3 = (2bd - 2ac) * v1 + (2cd + 2ab) * v2 + (a2 - b2 - c2 + d2) * v3
1473  ValueType t1 = ValueType(2) * (e1().getC2() * e1().getC4() - e1().getC1() * e1().getC3());
1474  ValueType t2 = ValueType(2) * (e1().getC3() * e1().getC4() + e1().getC1() * e1().getC2());
1475  ValueType t3 = e1().getC1() * e1().getC1() - e1().getC2() * e1().getC2() - e1().getC3() * e1().getC3() + e1().getC4() * e1().getC4();
1476 
1477  return (t1 * e2()(0) + t2 * e2()(1) + t3 * e2()(2));
1478  }
1479 
1480  default:
1481  return ResultType();
1482  }
1483  }
1484  };
1485 
1486  template <typename G1, typename G2>
1488  {
1489 
1490  typedef bool ResultType;
1493  };
1494 
1495  template <typename G1, typename G2>
1496  struct GridEquality : public GridBooleanBinaryFunctor<G1, G2>
1497  {
1498 
1502 
1504  {
1505  if (SizeType(e1().getSize1()) != SizeType(e2().getSize1()))
1506  return false;
1507 
1508  if (SizeType(e1().getSize2()) != SizeType(e2().getSize2()))
1509  return false;
1510 
1511  if (SizeType(e1().getSize3()) != SizeType(e2().getSize3()))
1512  return false;
1513 
1514  for (SizeType i = 0, size1 = e1().getSize1(); i < size1; i++)
1515  for (SizeType j = 0, size2 = e1().getSize2(); j < size2; j++)
1516  for (SizeType k = 0, size3 = e1().getSize3(); k < size3; k++)
1517  if (ValueType(e1()(i, j, k)) != ValueType(e2()(i, j, k)))
1518  return false;
1519 
1520  return true;
1521  }
1522  };
1523 
1524  template <typename G1, typename G2, typename T>
1526  {
1527 
1528  typedef bool ResultType;
1529  typedef const T& Argument3Type;
1532  };
1533 
1534  template <typename G1, typename G2, typename T>
1536  {
1537 
1542 
1544  {
1545  typedef typename CommonType<typename TypeTraits<ValueType>::RealType, T>::Type ComparisonType;
1546 
1547  if (SizeType(e1().getSize1()) != SizeType(e2().getSize1()))
1548  return false;
1549 
1550  if (SizeType(e1().getSize2()) != SizeType(e2().getSize2()))
1551  return false;
1552 
1553  if (SizeType(e1().getSize3()) != SizeType(e2().getSize3()))
1554  return false;
1555 
1556  ComparisonType norm_inf_max(epsilon);
1557 
1558  for (SizeType i = 0, size1 = e1().getSize1(); i < size1; i++)
1559  for (SizeType j = 0, size2 = e1().getSize2(); j < size2; j++)
1560  for (SizeType k = 0, size3 = e1().getSize3(); k < size3; k++)
1561  if (ComparisonType(TypeTraits<ValueType>::normInf(e2()(i, j, k) - e1()(i, j, k))) > norm_inf_max)
1562  return false;
1563 
1564  return true;
1565  }
1566  };
1567 
1568  template <typename M>
1570  {
1571 
1572  typedef typename M::ValueType ResultType;
1573  };
1574 
1575  template <typename G>
1577  {
1578 
1580 
1582  {
1583  typedef typename G::SizeType SizeType;
1584 
1585  ResultType res = ResultType();
1586  SizeType size1 = e().getSize1();
1587  SizeType size2 = e().getSize2();
1588  SizeType size3 = e().getSize3();
1589 
1590  for (SizeType i = 0; i < size1; i++)
1591  for (SizeType j = 0; j < size2; j++)
1592  for (SizeType k = 0; k < size3; k++)
1593  res += e()(i, j, k);
1594 
1595  return res;
1596  }
1597  };
1598  } // namespace Math
1599 } // namespace CDPL
1600 
1601 #endif // CDPL_MATH_FUNCTIONAL_HPP
CDPL::Math::QuaternionVectorRotation::SizeType
QuaternionVectorBinaryFunctor< Q, V >::SizeType SizeType
Definition: Functional.hpp:1443
CDPL::Math::MatrixScalarRealUnaryFunctor::ResultType
RealType ResultType
Definition: Functional.hpp:683
CDPL::Math::QuaternionNorm::ValueType
QuaternionScalarRealUnaryFunctor< Q >::ValueType ValueType
Definition: Functional.hpp:1022
CDPL::Math::ScalarAddition::ResultType
ScalarBinaryFunctor< T1, T2 >::ResultType ResultType
Definition: Functional.hpp:215
CDPL::Math::ScalarMultiplication::Argument1Type
ScalarBinaryFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:241
CDPL::Math::VectorAngleCosine::ResultType
CommonType< typename VectorInnerProduct< V1, V2 >::ResultType, T >::Type ResultType
Definition: Functional.hpp:296
CDPL::Math::MatrixNormInfinity::apply
static ResultType apply(const MatrixExpression< M > &e)
Definition: Functional.hpp:752
CDPL::Math::GridToleranceEquality::apply
static ResultType apply(const GridExpression< G1 > &e1, const GridExpression< G2 > &e2, Argument3Type epsilon)
Definition: Functional.hpp:1543
CDPL::Math::MatrixBinaryFunctor::ResultType
ValueType ResultType
Definition: Functional.hpp:918
CDPL::Math::MatrixEquality
Definition: Functional.hpp:565
CDPL::Math::TypeTraits
Definition: TypeTraits.hpp:171
CDPL::Math::VectorScalarIndexUnaryFunctor
Definition: Functional.hpp:519
CDPL::Math::ScalarSubtractionAssignment::Argument2Type
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:92
CDPL::Math::VectorNorm2::ResultType
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:474
CDPL::Math::GridEquality::SizeType
GridBooleanBinaryFunctor< G1, G2 >::SizeType SizeType
Definition: Functional.hpp:1499
CDPL::Math::Scalar2QuaternionAddition::applyC2
static ResultType applyC2(const QuaternionExpression< E > &e, Argument2Type)
Definition: Functional.hpp:1219
CDPL::Math::Scalar1QuaternionAddition
Definition: Functional.hpp:1135
CDPL_MATH_CHECK_SIZE_EQUALITY
#define CDPL_MATH_CHECK_SIZE_EQUALITY(size1, size2, e)
Definition: Check.hpp:62
CDPL::Math::VectorBooleanBinaryFunctor::SizeType
CommonType< typename V1::SizeType, typename V2::SizeType >::Type SizeType
Definition: Functional.hpp:314
CDPL::Math::GridBooleanBinaryFunctor::ResultType
bool ResultType
Definition: Functional.hpp:1490
CDPL::Math::MatrixNorm1::RealType
MatrixScalarRealUnaryFunctor< M >::RealType RealType
Definition: Functional.hpp:691
CDPL::Math::Scalar2QuaternionAddition::Argument2Type
Scalar2QuaternionBinaryFunctor< Q, T >::Argument2Type Argument2Type
Definition: Functional.hpp:1209
CDPL::Math::CommonType::Type
std::common_type< T1, T2 >::type Type
Definition: CommonType.hpp:43
CDPL::Math::QuaternionBinaryFunctor
Definition: Functional.hpp:1303
CDPL::Math::MatrixScalarRealUnaryFunctor::ValueType
M::ValueType ValueType
Definition: Functional.hpp:681
CDPL::Math::Scalar1QuaternionSubtraction::Argument1Type
Scalar1QuaternionBinaryFunctor< T, Q >::Argument1Type Argument1Type
Definition: Functional.hpp:1169
CDPL::Math::Scalar2QuaternionAddition::ResultType
Scalar2QuaternionBinaryFunctor< Q, T >::ResultType ResultType
Definition: Functional.hpp:1210
CDPL::Math::VectorNorm2::RealType
VectorScalarRealUnaryFunctor< V >::RealType RealType
Definition: Functional.hpp:473
CDPL::Math::VectorScalarBinaryFunctor::ResultType
CommonType< typename V1::ValueType, typename V2::ValueType >::Type ResultType
Definition: Functional.hpp:269
CDPL::Math::VectorInnerProduct::apply
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2)
Definition: Functional.hpp:278
CDPL::Math::Scalar1QuaternionSubtraction
Definition: Functional.hpp:1167
CDPL::Math::QuaternionInverse::ResultType
Scalar2QuaternionBinaryFunctor< Q, T >::ResultType ResultType
Definition: Functional.hpp:1274
CDPL::Math::VectorNorm1::ResultType
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:453
CommonType.hpp
Common type deduction.
CDPL::Math::Scalar3MatrixBooleanTernaryFunctor
Definition: Functional.hpp:590
CDPL::Math::MatrixNorm1
Definition: Functional.hpp:688
CDPL::Math::ScalarAddition::Argument2Type
ScalarBinaryFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:214
CDPL::Math::VectorNorm2::apply
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:476
CDPL::Math::Scalar3GridBooleanTernaryFunctor
Definition: Functional.hpp:1526
CDPL::Math::MatrixEquality::apply
static ResultType apply(const MatrixExpression< M1 > &e1, const MatrixExpression< M2 > &e2)
Definition: Functional.hpp:571
CDPL::Math::norm2
QuaternionNorm2< E >::ResultType norm2(const QuaternionExpression< E > &e)
Definition: QuaternionExpression.hpp:804
CDPL::Math::GridToleranceEquality::Argument3Type
Scalar3GridBooleanTernaryFunctor< G1, G2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:1541
CDPL::Math::Scalar1QuaternionSubtraction::applyC3
static ResultType applyC3(Argument1Type, const QuaternionExpression< E > &e)
Definition: Functional.hpp:1185
CDPL::Math::MatrixBinaryFunctor::SizeType
CommonType< typename M1::SizeType, typename M2::SizeType >::Type SizeType
Definition: Functional.hpp:917
CDPL::Math::ScalarMultiplication::ResultType
ScalarBinaryFunctor< T1, T2 >::ResultType ResultType
Definition: Functional.hpp:243
CDPL::Math::VectorEquality::SizeType
VectorBooleanBinaryFunctor< V1, V2 >::SizeType SizeType
Definition: Functional.hpp:322
CDPL::Math::ScalarAddition::Argument1Type
ScalarBinaryFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:213
CDPL::Math::MatrixTrace::ResultType
MatrixScalarUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:661
CDPL::Math::Scalar2QuaternionSubtraction::applyC2
static ResultType applyC2(const QuaternionExpression< E > &e, Argument2Type)
Definition: Functional.hpp:1251
CDPL::Math::ScalarBinaryAssignmentFunctor::Argument1Type
T1 Argument1Type
Definition: Functional.hpp:57
CDPL::Math::VectorElementSum::ResultType
VectorScalarUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:423
CDPL::Math::MatrixTrace::apply
static ResultType apply(const MatrixExpression< M > &e)
Definition: Functional.hpp:663
CDPL::Math::QuaternionVectorBinaryFunctor::ValueType
CommonType< typename Q::ValueType, typename V::ValueType >::Type ValueType
Definition: Functional.hpp:1433
CDPL::Math::VectorNorm1::apply
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:455
CDPL::Math::ScalarAssignment
Definition: Functional.hpp:63
CDPL::Math::ScalarSubtraction::Argument1Type
ScalarBinaryFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:227
CDPL::Math::Scalar3QuaternionTernaryFunctor
Definition: Functional.hpp:1345
CDPL::Math::ScalarAssignment::Argument2Type
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:66
CDPL::Math::VectorEquality
Definition: Functional.hpp:320
CDPL::Math::Scalar3GridBooleanTernaryFunctor::Argument3Type
const T & Argument3Type
Definition: Functional.hpp:1529
CDPL::Math::ScalarQuaternionDivision::Argument3Type
Scalar13QuaternionTernaryFunctor< T1, Q, T2 >::Argument3Type Argument3Type
Definition: Functional.hpp:1401
CDPL::Math::QuaternionProduct::applyC2
static ResultType applyC2(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
Definition: Functional.hpp:1322
CDPL::Math::VectorNorm1::RealType
VectorScalarRealUnaryFunctor< V >::RealType RealType
Definition: Functional.hpp:452
CDPL::Math::ScalarQuaternionDivision::Argument1Type
Scalar13QuaternionTernaryFunctor< T1, Q, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:1400
CDPL::Math::VectorExpression
Definition: Expression.hpp:54
CDPL::Math::ScalarReal
Definition: Functional.hpp:174
CDPL::Math::ScalarNegation::ResultType
ScalarUnaryFunctor< T >::ResultType ResultType
Definition: Functional.hpp:141
CDPL::Math::VectorToleranceEquality::ResultType
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::ResultType ResultType
Definition: Functional.hpp:355
CDPL::Math::ScalarConjugation::ArgumentType
ScalarUnaryFunctor< T >::ArgumentType ArgumentType
Definition: Functional.hpp:154
CDPL::Math::VectorScalarIndexUnaryFunctor::ResultType
V::SizeType ResultType
Definition: Functional.hpp:523
CDPL::Math::QuaternionVectorRotation
Definition: Functional.hpp:1440
CDPL::Math::Scalar1QuaternionAddition::applyC3
static ResultType applyC3(Argument1Type, const QuaternionExpression< E > &e)
Definition: Functional.hpp:1153
CDPL::Math::MatrixBooleanBinaryFunctor
Definition: Functional.hpp:556
CDPL::Math::GridBooleanBinaryFunctor
Definition: Functional.hpp:1488
CDPL::Math::Scalar3QuaternionBooleanTernaryFunctor::ResultType
bool ResultType
Definition: Functional.hpp:967
CDPL::Math::VectorBooleanBinaryFunctor
Definition: Functional.hpp:311
CDPL::Math::ScalarBinaryAssignmentFunctor::Argument2Type
const T2 & Argument2Type
Definition: Functional.hpp:58
CDPL::Math::Scalar13QuaternionTernaryFunctor::Argument1Type
const T1 & Argument1Type
Definition: Functional.hpp:1392
CDPL::Math::ScalarAssignment::Argument1Type
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:65
CDPL::Math::VectorMatrixUnaryFunctor::SizeType
V::SizeType SizeType
Definition: Functional.hpp:779
CDPL::Math::Scalar1QuaternionSubtraction::applyC4
static ResultType applyC4(Argument1Type, const QuaternionExpression< E > &e)
Definition: Functional.hpp:1191
CDPL::Math::VectorNormInfinityIndex
Definition: Functional.hpp:528
CDPL::Math::Scalar2QuaternionSubtraction::ResultType
Scalar2QuaternionBinaryFunctor< Q, T >::ResultType ResultType
Definition: Functional.hpp:1242
CDPL::Math::VectorCrossProduct::ResultType
VectorScalarBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:386
CDPL::Math::QuaternionNorm::RealType
QuaternionScalarRealUnaryFunctor< Q >::RealType RealType
Definition: Functional.hpp:1023
CDPL::Math::Scalar1QuaternionAddition::ResultType
Scalar1QuaternionBinaryFunctor< T, Q >::ResultType ResultType
Definition: Functional.hpp:1138
CDPL::Math::ScalarImaginary::ArgumentType
ScalarUnaryFunctor< T >::ArgumentType ArgumentType
Definition: Functional.hpp:191
CDPL::Math::QuaternionScalarUnaryFunctor
Definition: Functional.hpp:992
CDPL::Math::Scalar3VectorBooleanTernaryFunctor
Definition: Functional.hpp:341
CDPL::Math::QuaternionVectorBinaryFunctor
Definition: Functional.hpp:1431
CDPL::Math::MatrixToleranceEquality::ValueType
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::ValueType ValueType
Definition: Functional.hpp:603
CDPL::Math::MatrixScalarUnaryFunctor
Definition: Functional.hpp:630
CDPL::Math::GridToleranceEquality::SizeType
Scalar3GridBooleanTernaryFunctor< G1, G2, T >::SizeType SizeType
Definition: Functional.hpp:1538
CDPL::Math::QuaternionToleranceEquality::Argument3Type
Scalar3QuaternionBooleanTernaryFunctor< Q1, Q2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:978
CDPL::Math::real
GridUnaryTraits< E, ScalarReal< typename E::ValueType > >::ResultType real(const GridExpression< E > &e)
Definition: GridExpression.hpp:378
CDPL::Math::ScalarUnaryFunctor::ArgumentType
const T & ArgumentType
Definition: Functional.hpp:131
CDPL::Math::Scalar2QuaternionSubtraction::Argument2Type
Scalar2QuaternionBinaryFunctor< Q, T >::Argument2Type Argument2Type
Definition: Functional.hpp:1241
CDPL::Math::QuaternionToleranceEquality::ResultType
Scalar3QuaternionBooleanTernaryFunctor< Q1, Q2, T >::ResultType ResultType
Definition: Functional.hpp:977
CDPL::Math::MatrixEquality::SizeType
MatrixBooleanBinaryFunctor< M1, M2 >::SizeType SizeType
Definition: Functional.hpp:567
CDPL::Math::QuaternionBooleanBinaryFunctor::ResultType
bool ResultType
Definition: Functional.hpp:946
CDPL::Math::Scalar2QuaternionSubtraction::applyC3
static ResultType applyC3(const QuaternionExpression< E > &e, Argument2Type)
Definition: Functional.hpp:1257
CDPL::Math::GridScalarUnaryFunctor::ResultType
M::ValueType ResultType
Definition: Functional.hpp:1572
CDPL::Math::QuaternionInverse::applyC4
static ResultType applyC4(const QuaternionExpression< E > &e, Argument2Type n2)
Definition: Functional.hpp:1295
CDPL::Math::QuaternionNorm::apply
static ResultType apply(const QuaternionExpression< Q > &e)
Definition: Functional.hpp:1026
CDPL::Math::ScalarBinaryFunctor::Argument1Type
const T1 & Argument1Type
Definition: Functional.hpp:204
CDPL::Math::MatrixVectorProduct::ResultType
MatrixVectorBinaryFunctor< M, V >::ResultType ResultType
Definition: Functional.hpp:876
CDPL::Math::MatrixVectorProduct
Definition: Functional.hpp:872
CDPL::Math::ScalarMultiplication
Definition: Functional.hpp:239
CDPL::Math::ScalarQuaternionDivision::applyC3
static ResultType applyC3(Argument1Type t, const QuaternionExpression< E > &e, Argument3Type n2)
Definition: Functional.hpp:1417
CDPL::Math::VectorNormInfinityIndex::RealType
VectorScalarIndexUnaryFunctor< V >::RealType RealType
Definition: Functional.hpp:531
CDPL::Math::ScalarConjugation
Definition: Functional.hpp:151
CDPL::Math::GridElementSum::apply
static ResultType apply(const GridExpression< G > &e)
Definition: Functional.hpp:1581
CDPL::Math::VectorEquality::ValueType
VectorBooleanBinaryFunctor< V1, V2 >::ValueType ValueType
Definition: Functional.hpp:323
CDPL::Math::ScalarSubtractionAssignment::Argument1Type
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:91
CDPL::Math::Scalar2QuaternionBinaryFunctor
Definition: Functional.hpp:1199
CDPL::Math::Scalar3GridBooleanTernaryFunctor::ValueType
CommonType< typename G1::ValueType, typename G2::ValueType >::Type ValueType
Definition: Functional.hpp:1531
CDPL::Math::ScalarAdditionAssignment::Argument1Type
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:78
CDPL::Math::QuaternionToleranceEquality
Definition: Functional.hpp:974
CDPL::Math::ScalarAddition::apply
static ResultType apply(Argument1Type t1, Argument2Type t2)
Definition: Functional.hpp:217
CDPL::Math::QuaternionElementSum::apply
static ResultType apply(const QuaternionExpression< Q > &e)
Definition: Functional.hpp:1003
CDPL::Math::ScalarAddition
Definition: Functional.hpp:211
CDPL::Math::Scalar3MatrixBooleanTernaryFunctor::SizeType
CommonType< typename M1::SizeType, typename M2::SizeType >::Type SizeType
Definition: Functional.hpp:594
CDPL::Math::VectorNorm1::ValueType
VectorScalarRealUnaryFunctor< V >::ValueType ValueType
Definition: Functional.hpp:451
CDPL::Math::ScalarImaginary
Definition: Functional.hpp:188
CDPL::Math::VectorElementSum
Definition: Functional.hpp:421
CDPL::Math::Scalar2QuaternionAddition::applyC1
static ResultType applyC1(const QuaternionExpression< E > &e, Argument2Type t)
Definition: Functional.hpp:1213
CDPL::Math::MatrixExpression
Definition: Expression.hpp:76
CDPL::Math::VectorBooleanBinaryFunctor::ResultType
bool ResultType
Definition: Functional.hpp:313
CDPL_MATH_CHECK
#define CDPL_MATH_CHECK(expr, msg, e)
Definition: Check.hpp:36
CDPL::Math::QuaternionConjugate::applyC4
static ResultType applyC4(const QuaternionExpression< E > &e)
Definition: Functional.hpp:1119
CDPL::Math::Scalar3MatrixBooleanTernaryFunctor::Argument3Type
const T & Argument3Type
Definition: Functional.hpp:593
CDPL::Math::Scalar1QuaternionBinaryFunctor
Definition: Functional.hpp:1127
CDPL::Math::ScalarReal::ArgumentType
ScalarUnaryFunctor< T >::ArgumentType ArgumentType
Definition: Functional.hpp:177
CDPL::Math::Scalar1QuaternionAddition::applyC4
static ResultType applyC4(Argument1Type, const QuaternionExpression< E > &e)
Definition: Functional.hpp:1159
CDPL::Math::MatrixBooleanBinaryFunctor::ValueType
CommonType< typename M1::ValueType, typename M2::ValueType >::Type ValueType
Definition: Functional.hpp:560
CDPL::Math::Scalar3GridBooleanTernaryFunctor::ResultType
bool ResultType
Definition: Functional.hpp:1528
CDPL::Math::Scalar3MatrixBooleanTernaryFunctor::ValueType
CommonType< typename M1::ValueType, typename M2::ValueType >::Type ValueType
Definition: Functional.hpp:595
CDPL::Math::CommonType
Definition: CommonType.hpp:41
CDPL::Math::QuaternionExpression
Definition: Expression.hpp:98
CDPL::Math::MatrixElementSum::ResultType
MatrixScalarUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:639
CDPL::Math::QuaternionConjugate::applyC1
static ResultType applyC1(const QuaternionExpression< E > &e)
Definition: Functional.hpp:1101
CDPL::Math::ScalarDivision
Definition: Functional.hpp:253
CDPL::Math::QuaternionEquality
Definition: Functional.hpp:952
CDPL::Math::Scalar2QuaternionSubtraction::applyC1
static ResultType applyC1(const QuaternionExpression< E > &e, Argument2Type t)
Definition: Functional.hpp:1245
CDPL::Math::Scalar1QuaternionAddition::applyC1
static ResultType applyC1(Argument1Type t, const QuaternionExpression< E > &e)
Definition: Functional.hpp:1141
CDPL::Math::QuaternionDivision::ResultType
Scalar3QuaternionTernaryFunctor< Q1, Q2, T >::ResultType ResultType
Definition: Functional.hpp:1356
CDPL::Math::MatrixToleranceEquality::apply
static ResultType apply(const MatrixExpression< M1 > &e1, const MatrixExpression< M2 > &e2, Argument3Type epsilon)
Definition: Functional.hpp:607
bool
CDPL::Math::QuaternionUnreal::applyC3
static ResultType applyC3(const QuaternionExpression< E > &e)
Definition: Functional.hpp:1082
CDPL::Math::VectorNormInfinityIndex::apply
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:534
CDPL::Math::ScalarReal::apply
static ResultType apply(ArgumentType v)
Definition: Functional.hpp:180
CDPL::Math::VectorElementSum::apply
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:425
CDPL::Math::MatrixScalarRealUnaryFunctor::RealType
TypeTraits< ValueType >::RealType RealType
Definition: Functional.hpp:682
CDPL::Math::VectorNormInfinity::RealType
VectorScalarRealUnaryFunctor< V >::RealType RealType
Definition: Functional.hpp:497
CDPL::Math::MatrixNorm1::ResultType
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:692
CDPL::Math::ScalarMultiplicationAssignment::apply
static void apply(Argument1Type t1, Argument2Type t2)
Definition: Functional.hpp:107
CDPL::Math::ScalarMultiplication::apply
static ResultType apply(Argument1Type t1, Argument2Type t2)
Definition: Functional.hpp:245
CDPL::Math::ScalarBinaryFunctor
Definition: Functional.hpp:202
CDPL::Math::ScalarDivisionAssignment::Argument1Type
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:117
CDPL::Math::QuaternionEquality::ResultType
QuaternionBooleanBinaryFunctor< Q1, Q2 >::ResultType ResultType
Definition: Functional.hpp:955
CDPL::Math::QuaternionProduct::ResultType
QuaternionBinaryFunctor< Q1, Q2 >::ResultType ResultType
Definition: Functional.hpp:1312
CDPL::Math::VectorMatrixProduct::ValueType
MatrixVectorBinaryFunctor< M, V >::ValueType ValueType
Definition: Functional.hpp:895
CDPL::Math::CrossProductMatrixFromVector::SizeType
VectorScalarUnaryFunctor< V >::SizeType SizeType
Definition: Functional.hpp:804
CDPL::Math::VectorMatrixProduct
Definition: Functional.hpp:893
CDPL::Math::MatrixNormFrobenius
Definition: Functional.hpp:718
CDPL::Math::ScalarMultiplication::Argument2Type
ScalarBinaryFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:242
CDPL::Math::Scalar3QuaternionBooleanTernaryFunctor
Definition: Functional.hpp:965
CDPL::Math::VectorBinaryFunctor
Definition: Functional.hpp:377
CDPL::Math::VectorNormInfinity
Definition: Functional.hpp:494
CDPL::Math::MatrixVectorBinaryFunctor::ResultType
ValueType ResultType
Definition: Functional.hpp:867
CDPL::Math::ScalarConjugation::apply
static ResultType apply(ArgumentType v)
Definition: Functional.hpp:157
CDPL::Math::QuaternionVectorRotation::ResultType
QuaternionVectorBinaryFunctor< Q, V >::ResultType ResultType
Definition: Functional.hpp:1444
CDPL::Math::ScalarDivisionAssignment
Definition: Functional.hpp:115
CDPL::Math::ScalarSubtractionAssignment::apply
static void apply(Argument1Type t1, Argument2Type t2)
Definition: Functional.hpp:94
CDPL::Math::Scalar3MatrixBooleanTernaryFunctor::ResultType
bool ResultType
Definition: Functional.hpp:592
CDPL::Math::VectorNormInfinity::apply
static ResultType apply(const VectorExpression< V > &e)
Definition: Functional.hpp:500
CDPL::Math::ScalarQuaternionDivision::applyC4
static ResultType applyC4(Argument1Type t, const QuaternionExpression< E > &e, Argument3Type n2)
Definition: Functional.hpp:1423
CDPL::Math::QuaternionUnaryFunctor
Definition: Functional.hpp:1058
CDPL::Math::Scalar3QuaternionTernaryFunctor::Argument3Type
const T & Argument3Type
Definition: Functional.hpp:1348
CDPL::Base::SizeError
Thrown to indicate that the size of a (multidimensional) array is not correct.
Definition: Base/Exceptions.hpp:133
CDPL::Math::ScalarDivisionAssignment::Argument2Type
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:118
CDPL::Math::Scalar2QuaternionAddition::applyC3
static ResultType applyC3(const QuaternionExpression< E > &e, Argument2Type)
Definition: Functional.hpp:1225
CDPL::Math::ScalarConjugation::ResultType
ScalarUnaryFunctor< T >::ResultType ResultType
Definition: Functional.hpp:155
CDPL::Math::QuaternionScalarRealUnaryFunctor::ResultType
RealType ResultType
Definition: Functional.hpp:1015
CDPL::Math::GridToleranceEquality::ValueType
Scalar3GridBooleanTernaryFunctor< G1, G2, T >::ValueType ValueType
Definition: Functional.hpp:1539
CDPL::Math::ScalarRealUnaryFunctor::ResultType
TypeTraits< T >::RealType ResultType
Definition: Functional.hpp:169
CDPL::Math::Scalar3QuaternionBooleanTernaryFunctor::Argument3Type
const T & Argument3Type
Definition: Functional.hpp:968
CDPL::Math::ScalarDivision::ResultType
ScalarBinaryFunctor< T1, T2 >::ResultType ResultType
Definition: Functional.hpp:257
CDPL::Math::MatrixNorm1::apply
static ResultType apply(const MatrixExpression< M > &e)
Definition: Functional.hpp:694
CDPL::Math::VectorToleranceEquality::Argument3Type
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:356
CDPL::Math::ScalarReal::ResultType
ScalarUnaryFunctor< T >::ResultType ResultType
Definition: Functional.hpp:178
CDPL::Math::ScalarConjugation::ValueType
ScalarUnaryFunctor< T >::ValueType ValueType
Definition: Functional.hpp:153
CDPL::Math::GridEquality::apply
static ResultType apply(const GridExpression< G1 > &e1, const GridExpression< G2 > &e2)
Definition: Functional.hpp:1503
CDPL::Math::ScalarAssignment::apply
static void apply(Argument1Type t1, Argument2Type t2)
Definition: Functional.hpp:68
CDPL::Math::VectorScalarRealUnaryFunctor
Definition: Functional.hpp:440
CDPL::Math::QuaternionNorm2::RealType
QuaternionScalarRealUnaryFunctor< Q >::RealType RealType
Definition: Functional.hpp:1042
CDPL::Math::ScalarUnaryFunctor
Definition: Functional.hpp:128
CDPL::Math::ScalarQuaternionDivision::applyC2
static ResultType applyC2(Argument1Type t, const QuaternionExpression< E > &e, Argument3Type n2)
Definition: Functional.hpp:1411
TypeTraits.hpp
Definition of type traits.
CDPL::Math::ScalarAdditionAssignment::Argument2Type
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:79
CDPL::Math::QuaternionBinaryFunctor::ResultType
CommonType< typename Q1::ValueType, typename Q2::ValueType >::Type ResultType
Definition: Functional.hpp:1305
CDPL::Math::ScalarImaginary::apply
static ResultType apply(ArgumentType v)
Definition: Functional.hpp:194
CDPL::Math::QuaternionConjugate
Definition: Functional.hpp:1096
CDPL::Math::CrossProductMatrixFromVector::apply
static ResultType apply(const VectorExpression< E > &e, SizeType i, SizeType j)
Definition: Functional.hpp:807
CDPL::Math::ScalarSubtraction
Definition: Functional.hpp:225
CDPL::Math::VectorNormInfinityIndex::ResultType
VectorScalarIndexUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:532
CDPL::Math::ScalarSubtraction::apply
static ResultType apply(Argument1Type t1, Argument2Type t2)
Definition: Functional.hpp:231
CDPL::Math::QuaternionNorm2::apply
static ResultType apply(const QuaternionExpression< Q > &e)
Definition: Functional.hpp:1045
CDPL::Math::QuaternionBooleanBinaryFunctor
Definition: Functional.hpp:944
CDPL::Math::VectorMatrixUnaryFunctor::ResultType
V::ValueType ResultType
Definition: Functional.hpp:778
CDPL::Math::GridBooleanBinaryFunctor::ValueType
CommonType< typename G1::ValueType, typename G2::ValueType >::Type ValueType
Definition: Functional.hpp:1492
CDPL::Math::QuaternionVectorBinaryFunctor::SizeType
V::SizeType SizeType
Definition: Functional.hpp:1434
CDPL::Math::QuaternionInverse::applyC1
static ResultType applyC1(const QuaternionExpression< E > &e, Argument2Type n2)
Definition: Functional.hpp:1277
CDPL::Math::VectorCrossProduct::apply
static ResultType apply(const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2, SizeType i)
Definition: Functional.hpp:389
CDPL::Math::Scalar2QuaternionAddition::applyC4
static ResultType applyC4(const QuaternionExpression< E > &e, Argument2Type)
Definition: Functional.hpp:1231
CDPL::Math::VectorScalarUnaryFunctor::SizeType
V::SizeType SizeType
Definition: Functional.hpp:416
CDPL::Math::GridEquality::ResultType
GridBooleanBinaryFunctor< G1, G2 >::ResultType ResultType
Definition: Functional.hpp:1501
CDPL::Math::MatrixBinaryFunctor
Definition: Functional.hpp:914
CDPL::Math::MatrixBooleanBinaryFunctor::ResultType
bool ResultType
Definition: Functional.hpp:558
CDPL::Math::MatrixNormFrobenius::ResultType
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:722
CDPL::Math::QuaternionUnreal::applyC1
static ResultType applyC1(const QuaternionExpression< E > &e)
Definition: Functional.hpp:1070
CDPL::Math::VectorScalarRealUnaryFunctor::ValueType
V::ValueType ValueType
Definition: Functional.hpp:442
CDPL::Math::MatrixToleranceEquality::SizeType
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::SizeType SizeType
Definition: Functional.hpp:602
CDPL::Math::VectorNormInfinity::ValueType
VectorScalarRealUnaryFunctor< V >::ValueType ValueType
Definition: Functional.hpp:496
CDPL::Math::VectorAngleCosine::apply
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2, const T &sd, bool clamp)
Definition: Functional.hpp:298
CDPL::Math::CrossProductMatrixFromVector::ResultType
VectorScalarUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:803
CDPL::Math::VectorAngleCosine
Definition: Functional.hpp:294
CDPL::Math::conj
GridUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType conj(const GridExpression< E > &e)
Definition: GridExpression.hpp:360
CDPL::Math::VectorNorm1
Definition: Functional.hpp:449
CDPL::Math::VectorScalarIndexUnaryFunctor::ValueType
V::ValueType ValueType
Definition: Functional.hpp:521
CDPL::Math::ScalarRealUnaryFunctor
Definition: Functional.hpp:165
CDPL::Math::QuaternionScalarRealUnaryFunctor
Definition: Functional.hpp:1011
CDPL::Math::QuaternionNorm2
Definition: Functional.hpp:1039
CDPL::Math::Scalar3QuaternionTernaryFunctor::ResultType
CommonType< typename CommonType< typename Q1::ValueType, typename Q2::ValueType >::Type, T >::Type ResultType
Definition: Functional.hpp:1347
CDPL::Math::CrossProductMatrixFromVector
Definition: Functional.hpp:801
CDPL::Math::QuaternionProduct::applyC1
static ResultType applyC1(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
Definition: Functional.hpp:1315
CDPL::Math::VectorInnerProduct
Definition: Functional.hpp:274
CDPL::Math::GridElementSum
Definition: Functional.hpp:1577
CDPL::Math::MatrixToleranceEquality::Argument3Type
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:605
CDPL::Math::Scalar13QuaternionTernaryFunctor::ResultType
CommonType< typename CommonType< T1, typename Q::ValueType >::Type, T2 >::Type ResultType
Definition: Functional.hpp:1391
CDPL::Math::QuaternionProduct::applyC4
static ResultType applyC4(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
Definition: Functional.hpp:1336
CDPL::Chem::AtomType::T
const unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
CDPL::Math::ScalarDivision::Argument2Type
ScalarBinaryFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:256
CDPL::Math::QuaternionNorm
Definition: Functional.hpp:1020
Exceptions.hpp
Definition of exception classes.
CDPL::Math::QuaternionScalarRealUnaryFunctor::RealType
ValueType RealType
Definition: Functional.hpp:1014
CDPL::Math::MatrixEquality::ResultType
MatrixBooleanBinaryFunctor< M1, M2 >::ResultType ResultType
Definition: Functional.hpp:569
CDPL::Math::GridBooleanBinaryFunctor::SizeType
CommonType< typename G1::SizeType, typename G2::SizeType >::Type SizeType
Definition: Functional.hpp:1491
CDPL::Math::VectorBooleanBinaryFunctor::ValueType
CommonType< typename V1::ValueType, typename V2::ValueType >::Type ValueType
Definition: Functional.hpp:315
CDPL::Math::Scalar13QuaternionTernaryFunctor::Argument3Type
const T2 & Argument3Type
Definition: Functional.hpp:1393
CDPL::Math::QuaternionUnaryFunctor::ResultType
Q::ValueType ResultType
Definition: Functional.hpp:1060
CDPL::Math::ScalarSubtraction::ResultType
ScalarBinaryFunctor< T1, T2 >::ResultType ResultType
Definition: Functional.hpp:229
CDPL::Math::ScalarImaginary::ResultType
ScalarUnaryFunctor< T >::ResultType ResultType
Definition: Functional.hpp:192
CDPL::Math::GridElementSum::ResultType
GridScalarUnaryFunctor< G >::ResultType ResultType
Definition: Functional.hpp:1579
CDPL::Math::MatrixNormFrobenius::RealType
MatrixScalarRealUnaryFunctor< M >::RealType RealType
Definition: Functional.hpp:721
CDPL::Math::VectorScalarUnaryFunctor::ResultType
V::ValueType ResultType
Definition: Functional.hpp:415
CDPL::Math::QuaternionProduct::applyC3
static ResultType applyC3(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
Definition: Functional.hpp:1329
CDPL::Math::QuaternionScalarUnaryFunctor::ResultType
Q::ValueType ResultType
Definition: Functional.hpp:994
CDPL::Math::MatrixScalarUnaryFunctor::ResultType
M::ValueType ResultType
Definition: Functional.hpp:632
CDPL::Math::GridExpression
Definition: Expression.hpp:120
CDPL::Math::MatrixProduct::apply
static ResultType apply(const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2, SizeType i, SizeType j)
Definition: Functional.hpp:930
CDPL::Math::VectorScalarRealUnaryFunctor::RealType
TypeTraits< ValueType >::RealType RealType
Definition: Functional.hpp:443
CDPL::Math::QuaternionVectorBinaryFunctor::ResultType
ValueType ResultType
Definition: Functional.hpp:1435
CDPL::Math::QuaternionUnreal
Definition: Functional.hpp:1065
CDPL::Math::VectorMatrixProduct::SizeType
MatrixVectorBinaryFunctor< M, V >::SizeType SizeType
Definition: Functional.hpp:896
CDPL::Math::DiagonalMatrixFromVector::ResultType
VectorScalarUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:786
CDPL::Math::VectorNorm2::ValueType
VectorScalarRealUnaryFunctor< V >::ValueType ValueType
Definition: Functional.hpp:472
CDPL::Math::VectorToleranceEquality
Definition: Functional.hpp:351
CDPL::Math::DiagonalMatrixFromVector::SizeType
VectorScalarUnaryFunctor< V >::SizeType SizeType
Definition: Functional.hpp:787
CDPL::Math::MatrixNorm1::ValueType
MatrixScalarRealUnaryFunctor< M >::ValueType ValueType
Definition: Functional.hpp:690
CDPL::Math::QuaternionInverse::applyC2
static ResultType applyC2(const QuaternionExpression< E > &e, Argument2Type n2)
Definition: Functional.hpp:1283
CDPL::Math::ScalarImaginary::ValueType
ScalarUnaryFunctor< T >::ValueType ValueType
Definition: Functional.hpp:190
CDPL::Math::VectorMatrixProduct::apply
static ResultType apply(const VectorExpression< E1 > &e1, const MatrixExpression< E2 > &e2, SizeType i)
Definition: Functional.hpp:900
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Math::ScalarUnaryFunctor::ValueType
T ValueType
Definition: Functional.hpp:130
CDPL::Math::Scalar2QuaternionAddition
Definition: Functional.hpp:1207
CDPL::Math::VectorEquality::apply
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2)
Definition: Functional.hpp:326
CDPL::Math::ScalarBinaryFunctor::ResultType
CommonType< T1, T2 >::Type ResultType
Definition: Functional.hpp:206
CDPL::Math::MatrixNormInfinity::ValueType
MatrixScalarRealUnaryFunctor< M >::ValueType ValueType
Definition: Functional.hpp:748
CDPL::Math::QuaternionEquality::apply
static ResultType apply(const QuaternionExpression< Q1 > &e1, const QuaternionExpression< Q2 > &e2)
Definition: Functional.hpp:957
CDPL::Math::ScalarAdditionAssignment::apply
static void apply(Argument1Type t1, Argument2Type t2)
Definition: Functional.hpp:81
CDPL::Math::ScalarDivision::Argument1Type
ScalarBinaryFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:255
CDPL::Math::Scalar1QuaternionAddition::Argument1Type
Scalar1QuaternionBinaryFunctor< T, Q >::Argument1Type Argument1Type
Definition: Functional.hpp:1137
CDPL::Math::ScalarSubtractionAssignment
Definition: Functional.hpp:89
CDPL::Math::ScalarRealUnaryFunctor::ArgumentType
const T & ArgumentType
Definition: Functional.hpp:168
CDPL::Math::normInf
MatrixNormInfinity< E >::ResultType normInf(const MatrixExpression< E > &e)
Definition: MatrixExpression.hpp:917
CDPL::Math::QuaternionVectorRotation::apply
static ResultType apply(const QuaternionExpression< E1 > &e1, const VectorExpression< E2 > &e2, SizeType i)
Definition: Functional.hpp:1447
CDPL::Math::QuaternionBooleanBinaryFunctor::ValueType
CommonType< typename Q1::ValueType, typename Q2::ValueType >::Type ValueType
Definition: Functional.hpp:947
CDPL::Math::ScalarNegation
Definition: Functional.hpp:137
CDPL::Math::DiagonalMatrixFromVector::apply
static ResultType apply(const VectorExpression< E > &e, SizeType i, SizeType j)
Definition: Functional.hpp:790
CDPL::Math::Scalar1QuaternionBinaryFunctor::ResultType
CommonType< T, typename Q::ValueType >::Type ResultType
Definition: Functional.hpp:1129
CDPL::Math::GridToleranceEquality
Definition: Functional.hpp:1536
CDPL::Math::norm
QuaternionNorm< E >::ResultType norm(const QuaternionExpression< E > &e)
Definition: QuaternionExpression.hpp:797
CDPL::Math::Scalar2QuaternionBinaryFunctor::Argument2Type
const T & Argument2Type
Definition: Functional.hpp:1202
CDPL::Math::ScalarQuaternionDivision::applyC1
static ResultType applyC1(Argument1Type t, const QuaternionExpression< E > &e, Argument3Type n2)
Definition: Functional.hpp:1405
CDPL::Math::MatrixProduct::ValueType
MatrixVectorBinaryFunctor< M1, M2 >::ValueType ValueType
Definition: Functional.hpp:925
CDPL::Math::Scalar1QuaternionBinaryFunctor::Argument1Type
const T & Argument1Type
Definition: Functional.hpp:1130
CDPL::Math::MatrixVectorBinaryFunctor::SizeType
CommonType< typename M::SizeType, typename V::SizeType >::Type SizeType
Definition: Functional.hpp:866
CDPL::Math::VectorScalarRealUnaryFunctor::ResultType
RealType ResultType
Definition: Functional.hpp:444
CDPL::Math::QuaternionNorm2::ResultType
QuaternionScalarRealUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1043
CDPL::Math::Scalar13QuaternionTernaryFunctor
Definition: Functional.hpp:1389
CDPL::Math::QuaternionNorm2::ValueType
QuaternionScalarRealUnaryFunctor< Q >::ValueType ValueType
Definition: Functional.hpp:1041
CDPL::Math::QuaternionConjugate::applyC2
static ResultType applyC2(const QuaternionExpression< E > &e)
Definition: Functional.hpp:1107
CDPL::Math::VectorEquality::ResultType
VectorBooleanBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:324
CDPL::Math::ScalarReal::ValueType
ScalarUnaryFunctor< T >::ValueType ValueType
Definition: Functional.hpp:176
CDPL::Math::MatrixNormFrobenius::apply
static ResultType apply(const MatrixExpression< M > &e)
Definition: Functional.hpp:724
CDPL::Math::QuaternionDivision::applyC3
static ResultType applyC3(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, Argument3Type n2)
Definition: Functional.hpp:1373
CDPL::Math::VectorNormInfinity::ResultType
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:498
CDPL::Math::ScalarAdditionAssignment
Definition: Functional.hpp:76
CDPL::Math::GridEquality
Definition: Functional.hpp:1497
CDPL::Math::MatrixTrace
Definition: Functional.hpp:659
CDPL::Math::Scalar3VectorBooleanTernaryFunctor::ValueType
CommonType< typename V1::ValueType, typename V2::ValueType >::Type ValueType
Definition: Functional.hpp:346
CDPL::Math::MatrixNormInfinity::RealType
MatrixScalarRealUnaryFunctor< M >::RealType RealType
Definition: Functional.hpp:749
CDPL::Math::MatrixVectorBinaryFunctor
Definition: Functional.hpp:863
CDPL::Math::ScalarNegation::ValueType
ScalarUnaryFunctor< T >::ValueType ValueType
Definition: Functional.hpp:139
CDPL::Math::VectorNorm2
Definition: Functional.hpp:470
CDPL::Math::ScalarMultiplicationAssignment
Definition: Functional.hpp:102
CDPL::Math::ScalarSubtraction::Argument2Type
ScalarBinaryFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:228
CDPL::Math::GridScalarUnaryFunctor
Definition: Functional.hpp:1570
CDPL::Math::VectorToleranceEquality::ValueType
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::ValueType ValueType
Definition: Functional.hpp:354
CDPL::Math::MatrixNormFrobenius::ValueType
MatrixScalarRealUnaryFunctor< M >::ValueType ValueType
Definition: Functional.hpp:720
CDPL::Math::VectorInnerProduct::ResultType
VectorScalarBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:276
CDPL::Math::VectorScalarIndexUnaryFunctor::RealType
TypeTraits< ValueType >::RealType RealType
Definition: Functional.hpp:522
CDPL::Math::QuaternionElementSum
Definition: Functional.hpp:999
CDPL::Math::Scalar3QuaternionBooleanTernaryFunctor::ValueType
CommonType< typename Q1::ValueType, typename Q2::ValueType >::Type ValueType
Definition: Functional.hpp:969
CDPL::Math::Scalar3VectorBooleanTernaryFunctor::SizeType
CommonType< typename V1::SizeType, typename V2::SizeType >::Type SizeType
Definition: Functional.hpp:345
CDPL::Math::imag
GridUnaryTraits< E, ScalarImaginary< typename E::ValueType > >::ResultType imag(const GridExpression< E > &e)
Definition: GridExpression.hpp:387
CDPL::Math::Scalar1QuaternionSubtraction::applyC2
static ResultType applyC2(Argument1Type, const QuaternionExpression< E > &e)
Definition: Functional.hpp:1179
CDPL::Math::VectorScalarBinaryFunctor
Definition: Functional.hpp:267
CDPL::Math::MatrixProduct::ResultType
MatrixVectorBinaryFunctor< M1, M2 >::ResultType ResultType
Definition: Functional.hpp:927
CDPL::Math::ScalarMultiplicationAssignment::Argument1Type
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:104
CDPL::Math::VectorToleranceEquality::SizeType
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::SizeType SizeType
Definition: Functional.hpp:353
CDPL::Math::QuaternionUnreal::applyC4
static ResultType applyC4(const QuaternionExpression< E > &e)
Definition: Functional.hpp:1088
CDPL::Math::QuaternionNorm::ResultType
QuaternionScalarRealUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1024
CDPL::Math::ScalarBinaryAssignmentFunctor
Definition: Functional.hpp:55
CDPL::Math::ScalarRealUnaryFunctor::ValueType
T ValueType
Definition: Functional.hpp:167
CDPL::Math::QuaternionDivision::Argument3Type
Scalar3QuaternionTernaryFunctor< Q1, Q2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:1355
CDPL::Math::QuaternionEquality::ValueType
QuaternionBooleanBinaryFunctor< Q1, Q2 >::ValueType ValueType
Definition: Functional.hpp:954
CDPL::Math::QuaternionInverse::Argument2Type
Scalar2QuaternionBinaryFunctor< Q, T >::Argument2Type Argument2Type
Definition: Functional.hpp:1273
CDPL::Math::QuaternionVectorRotation::ValueType
QuaternionVectorBinaryFunctor< Q, V >::ValueType ValueType
Definition: Functional.hpp:1442
CDPL::Math::MatrixVectorProduct::ValueType
MatrixVectorBinaryFunctor< M, V >::ValueType ValueType
Definition: Functional.hpp:874
CDPL::Math::VectorBinaryFunctor::ResultType
CommonType< typename V1::ValueType, typename V2::ValueType >::Type ResultType
Definition: Functional.hpp:379
CDPL::Math::Scalar1QuaternionSubtraction::applyC1
static ResultType applyC1(Argument1Type t, const QuaternionExpression< E > &e)
Definition: Functional.hpp:1173
CDPL::Math::MatrixToleranceEquality
Definition: Functional.hpp:600
CDPL::Math::QuaternionConjugate::applyC3
static ResultType applyC3(const QuaternionExpression< E > &e)
Definition: Functional.hpp:1113
CDPL::Math::Scalar3VectorBooleanTernaryFunctor::Argument3Type
const T & Argument3Type
Definition: Functional.hpp:344
CDPL::Math::Scalar2QuaternionSubtraction::applyC4
static ResultType applyC4(const QuaternionExpression< E > &e, Argument2Type)
Definition: Functional.hpp:1263
CDPL::Math::QuaternionDivision
Definition: Functional.hpp:1353
Check.hpp
Definition of various preprocessor macros for error checking.
CDPL::Math::Scalar3VectorBooleanTernaryFunctor::ResultType
bool ResultType
Definition: Functional.hpp:343
CDPL::Math::QuaternionUnreal::applyC2
static ResultType applyC2(const QuaternionExpression< E > &e)
Definition: Functional.hpp:1076
CDPL::Math::QuaternionDivision::applyC4
static ResultType applyC4(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, Argument3Type n2)
Definition: Functional.hpp:1380
CDPL::Math::ScalarDivisionAssignment::apply
static void apply(Argument1Type t1, Argument2Type t2)
Definition: Functional.hpp:120
CDPL::Math::QuaternionToleranceEquality::ValueType
Scalar3QuaternionBooleanTernaryFunctor< Q1, Q2, T >::ValueType ValueType
Definition: Functional.hpp:976
CDPL::Math::VectorToleranceEquality::apply
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2, Argument3Type epsilon)
Definition: Functional.hpp:358
CDPL::Math::DiagonalMatrixFromVector
Definition: Functional.hpp:784
CDPL::Math::MatrixVectorProduct::SizeType
MatrixVectorBinaryFunctor< M, V >::SizeType SizeType
Definition: Functional.hpp:875
CDPL::Math::MatrixVectorBinaryFunctor::ValueType
CommonType< typename M::ValueType, typename V::ValueType >::Type ValueType
Definition: Functional.hpp:865
CDPL::Math::ScalarQuaternionDivision::ResultType
Scalar13QuaternionTernaryFunctor< T1, Q, T2 >::ResultType ResultType
Definition: Functional.hpp:1402
CDPL::Math::MatrixProduct::SizeType
MatrixVectorBinaryFunctor< M1, M2 >::SizeType SizeType
Definition: Functional.hpp:926
CDPL::Math::ScalarMultiplicationAssignment::Argument2Type
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:105
CDPL::Math::Scalar1QuaternionSubtraction::ResultType
Scalar1QuaternionBinaryFunctor< T, Q >::ResultType ResultType
Definition: Functional.hpp:1170
CDPL::Math::MatrixToleranceEquality::ResultType
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::ResultType ResultType
Definition: Functional.hpp:604
CDPL::Math::ScalarQuaternionDivision
Definition: Functional.hpp:1398
CDPL::Math::Scalar2QuaternionBinaryFunctor::ResultType
CommonType< typename Q::ValueType, T >::Type ResultType
Definition: Functional.hpp:1201
CDPL::Math::QuaternionDivision::applyC2
static ResultType applyC2(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, Argument3Type n2)
Definition: Functional.hpp:1366
CDPL::Math::QuaternionUnreal::ResultType
QuaternionUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1067
CDPL::Math::Scalar2QuaternionSubtraction
Definition: Functional.hpp:1239
CDPL::Math::ScalarBinaryFunctor::Argument2Type
const T2 & Argument2Type
Definition: Functional.hpp:205
CDPL::Math::QuaternionConjugate::ResultType
QuaternionUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1098
CDPL::Math::ScalarNegation::ArgumentType
ScalarUnaryFunctor< T >::ArgumentType ArgumentType
Definition: Functional.hpp:140
CDPL::Math::MatrixVectorProduct::apply
static ResultType apply(const MatrixExpression< E1 > &e1, const VectorExpression< E2 > &e2, SizeType i)
Definition: Functional.hpp:879
CDPL::Math::QuaternionElementSum::ResultType
QuaternionScalarUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1001
CDPL::Math::QuaternionInverse
Definition: Functional.hpp:1271
CDPL::Math::MatrixElementSum::apply
static ResultType apply(const MatrixExpression< M > &e)
Definition: Functional.hpp:641
CDPL::Math::VectorMatrixUnaryFunctor
Definition: Functional.hpp:776
CDPL::Math::MatrixEquality::ValueType
MatrixBooleanBinaryFunctor< M1, M2 >::ValueType ValueType
Definition: Functional.hpp:568
CDPL::Math::MatrixElementSum
Definition: Functional.hpp:637
CDPL::Math::GridToleranceEquality::ResultType
Scalar3GridBooleanTernaryFunctor< G1, G2, T >::ResultType ResultType
Definition: Functional.hpp:1540
CDPL::Math::MatrixNormInfinity
Definition: Functional.hpp:746
CDPL::Math::MatrixBinaryFunctor::ValueType
CommonType< typename M1::ValueType, typename M2::ValueType >::Type ValueType
Definition: Functional.hpp:916
CDPL::Math::QuaternionInverse::applyC3
static ResultType applyC3(const QuaternionExpression< E > &e, Argument2Type n2)
Definition: Functional.hpp:1289
CDPL::Math::GridEquality::ValueType
GridBooleanBinaryFunctor< G1, G2 >::ValueType ValueType
Definition: Functional.hpp:1500
CDPL::Math::QuaternionProduct
Definition: Functional.hpp:1310
CDPL::Math::VectorMatrixProduct::ResultType
MatrixVectorBinaryFunctor< M, V >::ResultType ResultType
Definition: Functional.hpp:897
CDPL::Math::VectorScalarUnaryFunctor
Definition: Functional.hpp:413
CDPL::Math::VectorCrossProduct
Definition: Functional.hpp:384
CDPL::Math::MatrixProduct
Definition: Functional.hpp:923
CDPL::Math::ScalarUnaryFunctor::ResultType
ValueType ResultType
Definition: Functional.hpp:132
CDPL::Math::Scalar3GridBooleanTernaryFunctor::SizeType
CommonType< typename G1::SizeType, typename G2::SizeType >::Type SizeType
Definition: Functional.hpp:1530
CDPL::Math::MatrixBooleanBinaryFunctor::SizeType
CommonType< typename M1::SizeType, typename M2::SizeType >::Type SizeType
Definition: Functional.hpp:559
CDPL::Math::ScalarNegation::apply
static ResultType apply(ArgumentType v)
Definition: Functional.hpp:143
CDPL::Math::ScalarDivision::apply
static ResultType apply(Argument1Type t1, Argument2Type t2)
Definition: Functional.hpp:259
CDPL::Math::QuaternionScalarRealUnaryFunctor::ValueType
Q::ValueType ValueType
Definition: Functional.hpp:1013
CDPL::Math::VectorNormInfinityIndex::ValueType
VectorScalarIndexUnaryFunctor< V >::ValueType ValueType
Definition: Functional.hpp:530
CDPL::Math::MatrixNormInfinity::ResultType
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:750
CDPL::Math::QuaternionToleranceEquality::apply
static ResultType apply(const QuaternionExpression< Q1 > &e1, const QuaternionExpression< Q2 > &e2, Argument3Type epsilon)
Definition: Functional.hpp:980
CDPL::Math::MatrixScalarRealUnaryFunctor
Definition: Functional.hpp:679
CDPL::Math::QuaternionDivision::applyC1
static ResultType applyC1(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, Argument3Type n2)
Definition: Functional.hpp:1359
CDPL::Math::Scalar1QuaternionAddition::applyC2
static ResultType applyC2(Argument1Type, const QuaternionExpression< E > &e)
Definition: Functional.hpp:1147