27 #ifndef CDPL_MATH_FUNCTIONAL_HPP
28 #define CDPL_MATH_FUNCTIONAL_HPP
30 #include <boost/algorithm/clamp.hpp>
45 class VectorExpression;
47 class MatrixExpression;
49 class QuaternionExpression;
63 template <
typename T1,
typename T2>
78 template <
typename T1,
typename T2>
101 template <
typename T1,
typename T2>
124 template <
typename T1,
typename T2>
147 template <
typename T1,
typename T2>
170 template <
typename T1,
typename T2>
196 template <
typename T>
212 template <
typename T>
235 template <
typename T>
258 template <
typename T>
274 template <
typename T>
297 template <
typename T>
325 template <
typename T1,
typename T2>
342 template <
typename T1,
typename T2>
367 template <
typename T1,
typename T2>
392 template <
typename T1,
typename T2>
417 template <
typename T1,
typename T2>
442 template <
typename V1,
typename V2>
455 template <
typename V1,
typename V2>
475 for (SizeType i = 0; i < size; i++)
476 res += e1()(i) * e2()(i);
488 template <
typename V1,
typename V2,
typename T>
518 template <
typename V1,
typename V2>
535 template <
typename V1,
typename V2>
554 for (
SizeType i = 0, size = e1().getSize(); i < size; i++)
568 template <
typename V1,
typename V2,
typename T>
588 template <
typename V1,
typename V2,
typename T>
611 ComparisonType norm_inf_max(epsilon);
613 for (
SizeType i = 0, size = e1().getSize(); i < size; i++)
626 template <
typename V1,
typename V2>
639 template <
typename V1,
typename V2>
656 template <
typename E1,
typename E2,
typename SizeType>
665 return (e1()(1) * e2()(2) - e1()(2) * e2()(1));
668 return (e1()(2) * e2()(0) - e1()(0) * e2()(2));
671 return (e1()(0) * e2()(1) - e1()(1) * e2()(0));
683 template <
typename V>
697 template <
typename V>
710 typedef typename V::SizeType
SizeType;
714 for (
SizeType i = 0, size = e().getSize(); i < size; i++)
721 template <
typename V>
741 template <
typename V>
756 typedef typename V::SizeType SizeType;
760 for (SizeType i = 0, size = e().getSize(); i < size; i++)
771 template <
typename V>
786 typedef typename V::SizeType SizeType;
790 for (SizeType i = 0, size = e().getSize(); i < size; i++) {
804 template <
typename V>
819 typedef typename V::SizeType SizeType;
823 for (SizeType i = 0, size = e().getSize(); i < size; i++) {
838 template <
typename V>
854 template <
typename V>
869 typedef typename V::SizeType SizeType;
874 for (SizeType i = 0, size = e().getSize(); i < size; i++) {
892 template <
typename M1,
typename M2>
909 template <
typename M1,
typename M2>
931 for (
SizeType i = 0, size1 = e1().getSize1(); i < size1; i++)
932 for (
SizeType j = 0, size2 = e1().getSize2(); j < size2; j++)
946 template <
typename M1,
typename M2,
typename T>
966 template <
typename M1,
typename M2,
typename T>
992 ComparisonType norm_inf_max(epsilon);
994 for (
SizeType i = 0, size1 = e1().getSize1(); i < size1; i++)
995 for (
SizeType j = 0, size2 = e1().getSize2(); j < size2; j++)
1007 template <
typename M>
1019 template <
typename M>
1032 typedef typename M::SizeType SizeType;
1035 SizeType size1 = e().getSize1();
1036 SizeType size2 = e().getSize2();
1038 for (SizeType i = 0; i < size1; i++)
1039 for (SizeType j = 0; j < size2; j++)
1050 template <
typename M>
1064 typedef typename M::SizeType SizeType;
1069 for (SizeType i = 0; i < size; i++)
1080 template <
typename M>
1096 template <
typename M>
1111 typedef typename M::SizeType SizeType;
1114 SizeType size1 = e().getSize1();
1115 SizeType size2 = e().getSize2();
1117 for (SizeType j = 0; j < size2; j++) {
1120 for (SizeType i = 0; i < size1; i++)
1135 template <
typename M>
1150 typedef typename M::SizeType SizeType;
1153 SizeType size1 = e().getSize1();
1154 SizeType size2 = e().getSize2();
1156 for (SizeType i = 0; i < size1; i++) {
1157 for (SizeType j = 0; j < size2; j++) {
1172 template <
typename M>
1187 typedef typename M::SizeType SizeType;
1190 SizeType size1 = e().getSize1();
1191 SizeType size2 = e().getSize2();
1193 for (SizeType i = 0; i < size1; i++) {
1196 for (SizeType j = 0; j < size2; j++)
1211 template <
typename V>
1225 template <
typename V>
1240 template <
typename E>
1254 template <
typename V>
1270 template <
typename E>
1330 template <
typename M,
typename V>
1347 template <
typename M,
typename V>
1365 template <
typename E1,
typename E2>
1371 for (
SizeType j = 0; j < size; j++)
1372 res += e1()(i, j) * e2()(j);
1383 template <
typename V,
typename M>
1401 template <
typename E1,
typename E2>
1407 for (
SizeType j = 0; j < size; j++)
1408 res += e1()(j) * e2()(j, i);
1419 template <
typename M1,
typename M2>
1436 template <
typename M1,
typename M2>
1455 template <
typename E1,
typename E2>
1461 for (
SizeType k = 0; k < size; k++)
1462 res += e1()(i, k) * e2()(k, j);
1473 template <
typename Q1,
typename Q2>
1488 template <
typename Q1,
typename Q2>
1513 template <
typename Q1,
typename Q2,
typename T>
1531 template <
typename Q1,
typename Q2,
typename T>
1550 ComparisonType norm_inf_max(epsilon);
1560 template <
typename Q>
1572 template <
typename Q>
1585 return (e().getC1() + e().getC2() + e().getC3() + e().getC4());
1593 template <
typename Q>
1609 template <
typename Q>
1624 RealType t = e().getC1() * e().getC1() +
1625 e().getC2() * e().getC2() +
1626 e().getC3() * e().getC3() +
1627 e().getC4() * e().getC4();
1637 template <
typename Q>
1652 RealType t = e().getC1() * e().getC1() +
1653 e().getC2() * e().getC2() +
1654 e().getC3() * e().getC3() +
1655 e().getC4() * e().getC4();
1665 template <
typename Q>
1677 template <
typename Q>
1689 template <
typename E>
1701 template <
typename E>
1713 template <
typename E>
1725 template <
typename E>
1736 template <
typename Q>
1748 template <
typename E>
1760 template <
typename E>
1763 return -e().getC2();
1772 template <
typename E>
1775 return -e().getC3();
1784 template <
typename E>
1787 return -e().getC4();
1796 template <
typename T,
typename Q>
1811 template <
typename T,
typename Q>
1825 template <
typename E>
1828 return (t + e().getC1());
1837 template <
typename E>
1849 template <
typename E>
1861 template <
typename E>
1873 template <
typename T,
typename Q>
1887 template <
typename E>
1890 return (t - e().getC1());
1899 template <
typename E>
1902 return -e().getC2();
1911 template <
typename E>
1914 return -e().getC3();
1923 template <
typename E>
1926 return -e().getC4();
1935 template <
typename Q,
typename T>
1950 template <
typename Q,
typename T>
1964 template <
typename E>
1967 return (e().getC1() + t);
1976 template <
typename E>
1988 template <
typename E>
2000 template <
typename E>
2012 template <
typename Q,
typename T>
2026 template <
typename E>
2029 return (e().getC1() - t);
2038 template <
typename E>
2050 template <
typename E>
2062 template <
typename E>
2074 template <
typename Q,
typename T>
2088 template <
typename E>
2091 return (e().getC1() / n2);
2101 template <
typename E>
2104 return (-e().getC2() / n2);
2114 template <
typename E>
2117 return (-e().getC3() / n2);
2127 template <
typename E>
2130 return (-e().getC4() / n2);
2139 template <
typename Q1,
typename Q2>
2152 template <
typename Q1,
typename Q2>
2166 template <
typename E1,
typename E2>
2170 return (e1().getC1() * e2().getC1() - e1().getC2() * e2().getC2() - e1().getC3() * e2().getC3() - e1().getC4() * e2().getC4());
2181 template <
typename E1,
typename E2>
2185 return (e1().getC1() * e2().getC2() + e1().getC2() * e2().getC1() + e1().getC3() * e2().getC4() - e1().getC4() * e2().getC3());
2196 template <
typename E1,
typename E2>
2200 return (e1().getC1() * e2().getC3() - e1().getC2() * e2().getC4() + e1().getC3() * e2().getC1() + e1().getC4() * e2().getC2());
2211 template <
typename E1,
typename E2>
2215 return (e1().getC1() * e2().getC4() + e1().getC2() * e2().getC3() - e1().getC3() * e2().getC2() + e1().getC4() * e2().getC1());
2225 template <
typename Q1,
typename Q2,
typename T>
2241 template <
typename Q1,
typename Q2,
typename T>
2257 template <
typename E1,
typename E2>
2261 return ((e1().getC1() * e2().getC1() + e1().getC2() * e2().getC2() + e1().getC3() * e2().getC3() + e1().getC4() * e2().getC4()) / n2);
2273 template <
typename E1,
typename E2>
2277 return ((-e1().getC1() * e2().getC2() + e1().getC2() * e2().getC1() - e1().getC3() * e2().getC4() + e1().getC4() * e2().getC3()) / n2);
2289 template <
typename E1,
typename E2>
2293 return ((-e1().getC1() * e2().getC3() + e1().getC2() * e2().getC4() + e1().getC3() * e2().getC1() - e1().getC4() * e2().getC2()) / n2);
2305 template <
typename E1,
typename E2>
2309 return ((-e1().getC1() * e2().getC4() - e1().getC2() * e2().getC3() + e1().getC3() * e2().getC2() + e1().getC4() * e2().getC1()) / n2);
2319 template <
typename T1,
typename Q,
typename T2>
2337 template <
typename T1,
typename Q,
typename T2>
2353 template <
typename E>
2356 return (t * e().getC1() / n2);
2367 template <
typename E>
2370 return (t * -e().getC2() / n2);
2381 template <
typename E>
2384 return (t * -e().getC3() / n2);
2395 template <
typename E>
2398 return (t * -e().getC4() / n2);
2407 template <
typename Q,
typename V>
2425 template <
typename Q,
typename V>
2443 template <
typename E1,
typename E2>
2452 ValueType t1 = e1().getC1() * e1().getC1() + e1().getC2() * e1().getC2() - e1().getC3() * e1().getC3() - e1().getC4() * e1().getC4();
2453 ValueType t2 =
ValueType(2) * (e1().getC2() * e1().getC3() - e1().getC1() * e1().getC4());
2454 ValueType t3 =
ValueType(2) * (e1().getC2() * e1().getC4() + e1().getC1() * e1().getC3());
2456 return (t1 * e2()(0) + t2 * e2()(1) + t3 * e2()(2));
2461 ValueType t1 =
ValueType(2) * (e1().getC2() * e1().getC3() + e1().getC1() * e1().getC4());
2462 ValueType t2 = e1().getC1() * e1().getC1() - e1().getC2() * e1().getC2() + e1().getC3() * e1().getC3() - e1().getC4() * e1().getC4();
2463 ValueType t3 =
ValueType(2) * (e1().getC3() * e1().getC4() - e1().getC1() * e1().getC2());
2465 return (t1 * e2()(0) + t2 * e2()(1) + t3 * e2()(2));
2470 ValueType t1 =
ValueType(2) * (e1().getC2() * e1().getC4() - e1().getC1() * e1().getC3());
2471 ValueType t2 =
ValueType(2) * (e1().getC3() * e1().getC4() + e1().getC1() * e1().getC2());
2472 ValueType t3 = e1().getC1() * e1().getC1() - e1().getC2() * e1().getC2() - e1().getC3() * e1().getC3() + e1().getC4() * e1().getC4();
2474 return (t1 * e2()(0) + t2 * e2()(1) + t3 * e2()(2));
2488 template <
typename G1,
typename G2>
2505 template <
typename G1,
typename G2>
2530 for (
SizeType i = 0, size1 = e1().getSize1(); i < size1; i++)
2531 for (
SizeType j = 0, size2 = e1().getSize2(); j < size2; j++)
2532 for (
SizeType k = 0, size3 = e1().getSize3(); k < size3; k++)
2546 template <
typename G1,
typename G2,
typename T>
2566 template <
typename G1,
typename G2,
typename T>
2595 ComparisonType norm_inf_max(epsilon);
2597 for (
SizeType i = 0, size1 = e1().getSize1(); i < size1; i++)
2598 for (
SizeType j = 0, size2 = e1().getSize2(); j < size2; j++)
2599 for (
SizeType k = 0, size3 = e1().getSize3(); k < size3; k++)
2611 template <
typename M>
2623 template <
typename G>
2636 typedef typename G::SizeType SizeType;
2639 SizeType size1 = e().getSize1();
2640 SizeType size2 = e().getSize2();
2641 SizeType size3 = e().getSize3();
2643 for (SizeType i = 0; i < size1; i++)
2644 for (SizeType j = 0; j < size2; j++)
2645 for (SizeType k = 0; k < size3; k++)
2646 res += e()(i, j, k);
Definition of exception classes.
Definition of various preprocessor macros for error checking.
#define CDPL_MATH_CHECK(expr, msg, e)
Throws the exception e with message msg when the boolean expression expr evaluates to false.
Definition: Check.hpp:47
#define CDPL_MATH_CHECK_SIZE_EQUALITY(size1, size2, e)
Throws the exception e if size1 differs from size2, otherwise returns std::min(size1,...
Definition: Check.hpp:84
Definition of type traits.
Thrown to indicate that the size of a (multidimensional) array is not correct.
Definition: Base/Exceptions.hpp:133
CRTP base class for all grid expression types.
Definition: Expression.hpp:180
CRTP base class for all matrix expression types.
Definition: Expression.hpp:104
CRTP base class for all quaternion expression types.
Definition: Expression.hpp:142
CRTP base class for all vector expression types.
Definition: Expression.hpp:66
constexpr unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
QuaternionNorm< E >::ResultType norm(const QuaternionExpression< E > &e)
Returns the norm (Euclidean length) of the quaternion expression e.
Definition: QuaternionExpression.hpp:1384
The namespace of the Chemical Data Processing Library.
Trait that resolves the common arithmetic type of T1 and T2 via std::common_type.
Definition: CommonType.hpp:46
std::common_type< T1, T2 >::type Type
The common type.
Definition: CommonType.hpp:49
Functor producing the cross-product (skew-symmetric) matrix entry at (i, j) for a 3-vector expression...
Definition: Functional.hpp:1256
VectorScalarUnaryFunctor< V >::SizeType SizeType
Definition: Functional.hpp:1259
static ResultType apply(const VectorExpression< E > &e, SizeType i, SizeType j)
Returns the (i, j) entry of the skew-symmetric matrix corresponding to the 3-vector e.
Definition: Functional.hpp:1271
VectorScalarUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:1258
Functor producing the diagonal-matrix entry at (i, j) from a vector expression ( on the diagonal,...
Definition: Functional.hpp:1227
VectorScalarUnaryFunctor< V >::SizeType SizeType
Definition: Functional.hpp:1230
static ResultType apply(const VectorExpression< E > &e, SizeType i, SizeType j)
Returns if i equals j, otherwise 0.
Definition: Functional.hpp:1241
VectorScalarUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:1229
Base class for binary functors that take two grid expressions and return a bool result (Math::GridEqu...
Definition: Functional.hpp:2490
CommonType< typename G1::SizeType, typename G2::SizeType >::Type SizeType
The unsigned size type (common type of the two grid size types).
Definition: Functional.hpp:2495
bool ResultType
The boolean result type.
Definition: Functional.hpp:2493
CommonType< typename G1::ValueType, typename G2::ValueType >::Type ValueType
The cell value type (common type of the two grid cell types).
Definition: Functional.hpp:2497
Functor returning the sum of all cells of a grid expression.
Definition: Functional.hpp:2625
GridScalarUnaryFunctor< G >::ResultType ResultType
Definition: Functional.hpp:2627
static ResultType apply(const GridExpression< G > &e)
Returns the cell sum of e.
Definition: Functional.hpp:2634
Functor checking cell-wise equality of two grid expressions.
Definition: Functional.hpp:2507
static ResultType apply(const GridExpression< G1 > &e1, const GridExpression< G2 > &e2)
Tells whether e1 and e2 have the same dimensions and equal cell values.
Definition: Functional.hpp:2519
GridBooleanBinaryFunctor< G1, G2 >::ResultType ResultType
Definition: Functional.hpp:2511
GridBooleanBinaryFunctor< G1, G2 >::SizeType SizeType
Definition: Functional.hpp:2509
GridBooleanBinaryFunctor< G1, G2 >::ValueType ValueType
Definition: Functional.hpp:2510
Base class for unary functors that take a grid expression and return a scalar result (Math::GridEleme...
Definition: Functional.hpp:2613
M::ValueType ResultType
The scalar result type (the grid's cell value type).
Definition: Functional.hpp:2616
Functor checking cell-wise approximate equality of two grid expressions within an absolute tolerance.
Definition: Functional.hpp:2568
Scalar3GridBooleanTernaryFunctor< G1, G2, T >::ValueType ValueType
Definition: Functional.hpp:2571
Scalar3GridBooleanTernaryFunctor< G1, G2, T >::ResultType ResultType
Definition: Functional.hpp:2572
Scalar3GridBooleanTernaryFunctor< G1, G2, T >::SizeType SizeType
Definition: Functional.hpp:2570
Scalar3GridBooleanTernaryFunctor< G1, G2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:2573
static ResultType apply(const GridExpression< G1 > &e1, const GridExpression< G2 > &e2, Argument3Type epsilon)
Tells whether e1 and e2 agree cell-wise within the absolute tolerance epsilon.
Definition: Functional.hpp:2582
Base class for binary functors that take two matrix expressions and return a matrix-element scalar re...
Definition: Functional.hpp:1421
ValueType ResultType
The scalar result type (alias for ValueType).
Definition: Functional.hpp:1428
CommonType< typename M1::ValueType, typename M2::ValueType >::Type ValueType
The element value type (common type of the two matrix element types).
Definition: Functional.hpp:1424
CommonType< typename M1::SizeType, typename M2::SizeType >::Type SizeType
The unsigned size type (common type of the two matrix size types).
Definition: Functional.hpp:1426
Base class for binary functors that take two matrix expressions and return a bool result (Math::Matri...
Definition: Functional.hpp:894
CommonType< typename M1::SizeType, typename M2::SizeType >::Type SizeType
The unsigned size type (common type of the two matrix size types).
Definition: Functional.hpp:899
CommonType< typename M1::ValueType, typename M2::ValueType >::Type ValueType
The element value type (common type of the two matrix element types).
Definition: Functional.hpp:901
bool ResultType
The boolean result type.
Definition: Functional.hpp:897
Functor returning the sum of all elements of a matrix expression.
Definition: Functional.hpp:1021
MatrixScalarUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1023
static ResultType apply(const MatrixExpression< M > &e)
Returns the element sum of e.
Definition: Functional.hpp:1030
Functor checking element-wise equality of two matrix expressions.
Definition: Functional.hpp:911
MatrixBooleanBinaryFunctor< M1, M2 >::SizeType SizeType
Definition: Functional.hpp:913
MatrixBooleanBinaryFunctor< M1, M2 >::ResultType ResultType
Definition: Functional.hpp:915
static ResultType apply(const MatrixExpression< M1 > &e1, const MatrixExpression< M2 > &e2)
Tells whether e1 and e2 have the same dimensions and equal element values.
Definition: Functional.hpp:923
MatrixBooleanBinaryFunctor< M1, M2 >::ValueType ValueType
Definition: Functional.hpp:914
Functor returning the L1 (maximum absolute column sum) norm of a matrix expression.
Definition: Functional.hpp:1098
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1102
MatrixScalarRealUnaryFunctor< M >::RealType RealType
Definition: Functional.hpp:1101
MatrixScalarRealUnaryFunctor< M >::ValueType ValueType
Definition: Functional.hpp:1100
static ResultType apply(const MatrixExpression< M > &e)
Returns the L1 norm of e.
Definition: Functional.hpp:1109
Functor returning the Frobenius norm of a matrix expression.
Definition: Functional.hpp:1137
static ResultType apply(const MatrixExpression< M > &e)
Returns the Frobenius norm of e.
Definition: Functional.hpp:1148
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1141
MatrixScalarRealUnaryFunctor< M >::RealType RealType
Definition: Functional.hpp:1140
MatrixScalarRealUnaryFunctor< M >::ValueType ValueType
Definition: Functional.hpp:1139
Functor returning the L∞ (maximum absolute row sum) norm of a matrix expression.
Definition: Functional.hpp:1174
static ResultType apply(const MatrixExpression< M > &e)
Returns the L∞ norm of e.
Definition: Functional.hpp:1185
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1178
MatrixScalarRealUnaryFunctor< M >::ValueType ValueType
Definition: Functional.hpp:1176
MatrixScalarRealUnaryFunctor< M >::RealType RealType
Definition: Functional.hpp:1177
Functor returning entry (i, j) of the matrix product .
Definition: Functional.hpp:1438
MatrixVectorBinaryFunctor< M1, M2 >::ValueType ValueType
Definition: Functional.hpp:1440
MatrixVectorBinaryFunctor< M1, M2 >::SizeType SizeType
Definition: Functional.hpp:1441
MatrixVectorBinaryFunctor< M1, M2 >::ResultType ResultType
Definition: Functional.hpp:1442
static ResultType apply(const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2, SizeType i, SizeType j)
Returns entry (i, j) of the matrix product .
Definition: Functional.hpp:1456
Base class for unary functors that take a matrix expression and return a real-valued scalar (Math::Ma...
Definition: Functional.hpp:1082
M::ValueType ValueType
The matrix's element value type.
Definition: Functional.hpp:1085
RealType ResultType
The real-valued result type.
Definition: Functional.hpp:1089
TypeTraits< ValueType >::RealType RealType
The real-valued type derived from ValueType via Math::TypeTraits.
Definition: Functional.hpp:1087
Base class for unary functors that take a matrix expression and return a scalar result (Math::MatrixE...
Definition: Functional.hpp:1009
M::ValueType ResultType
The scalar result type (the matrix's element value type).
Definition: Functional.hpp:1012
Functor checking element-wise approximate equality of two matrix expressions within an absolute toler...
Definition: Functional.hpp:968
static ResultType apply(const MatrixExpression< M1 > &e1, const MatrixExpression< M2 > &e2, Argument3Type epsilon)
Tells whether e1 and e2 agree element-wise within the absolute tolerance epsilon.
Definition: Functional.hpp:982
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::ValueType ValueType
Definition: Functional.hpp:971
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:973
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::ResultType ResultType
Definition: Functional.hpp:972
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::SizeType SizeType
Definition: Functional.hpp:970
Functor returning the trace (sum of diagonal entries) of a matrix expression.
Definition: Functional.hpp:1052
MatrixScalarUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1054
static ResultType apply(const MatrixExpression< M > &e)
Returns the trace of e.
Definition: Functional.hpp:1062
Base class for binary functors that take a matrix expression and a vector expression and return a vec...
Definition: Functional.hpp:1332
ValueType ResultType
The scalar result type (alias for ValueType).
Definition: Functional.hpp:1339
CommonType< typename M::ValueType, typename V::ValueType >::Type ValueType
The element value type (common type of the matrix and vector element types).
Definition: Functional.hpp:1335
CommonType< typename M::SizeType, typename V::SizeType >::Type SizeType
The unsigned size type (common type of the matrix and vector size types).
Definition: Functional.hpp:1337
Functor returning element i of the matrix-vector product .
Definition: Functional.hpp:1349
MatrixVectorBinaryFunctor< M, V >::ValueType ValueType
Definition: Functional.hpp:1351
MatrixVectorBinaryFunctor< M, V >::ResultType ResultType
Definition: Functional.hpp:1353
MatrixVectorBinaryFunctor< M, V >::SizeType SizeType
Definition: Functional.hpp:1352
static ResultType apply(const MatrixExpression< E1 > &e1, const VectorExpression< E2 > &e2, SizeType i)
Returns element i of the matrix-vector product .
Definition: Functional.hpp:1366
Base class for per-component binary functors that take two quaternion expressions and produce a quate...
Definition: Functional.hpp:2141
CommonType< typename Q1::ValueType, typename Q2::ValueType >::Type ResultType
The component result type (common type of the two quaternion element types).
Definition: Functional.hpp:2144
Base class for binary functors that take two quaternion expressions and return a bool result (Math::Q...
Definition: Functional.hpp:1475
CommonType< typename Q1::ValueType, typename Q2::ValueType >::Type ValueType
The component value type (common type of the two quaternion element types).
Definition: Functional.hpp:1480
bool ResultType
The boolean result type.
Definition: Functional.hpp:1478
Per-component functor returning the quaternion conjugate (keeps C1, negates C2/C3/C4).
Definition: Functional.hpp:1738
static ResultType applyC4(const QuaternionExpression< E > &e)
Returns the C4 component of the conjugate (equals -e.getC4()).
Definition: Functional.hpp:1785
static ResultType applyC2(const QuaternionExpression< E > &e)
Returns the C2 component of the conjugate (equals -e.getC2()).
Definition: Functional.hpp:1761
static ResultType applyC3(const QuaternionExpression< E > &e)
Returns the C3 component of the conjugate (equals -e.getC3()).
Definition: Functional.hpp:1773
static ResultType applyC1(const QuaternionExpression< E > &e)
Returns the C1 component of the conjugate (equals e.getC1()).
Definition: Functional.hpp:1749
QuaternionUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1740
Per-component functor returning the quaternion division (n2 is the precomputed squared norm of e_2).
Definition: Functional.hpp:2243
static ResultType applyC3(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, Argument3Type n2)
Returns the C3 component of the quaternion division .
Definition: Functional.hpp:2290
static ResultType applyC1(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, Argument3Type n2)
Returns the C1 component of the quaternion division .
Definition: Functional.hpp:2258
Scalar3QuaternionTernaryFunctor< Q1, Q2, T >::ResultType ResultType
Definition: Functional.hpp:2246
static ResultType applyC4(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, Argument3Type n2)
Returns the C4 component of the quaternion division .
Definition: Functional.hpp:2306
static ResultType applyC2(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, Argument3Type n2)
Returns the C2 component of the quaternion division .
Definition: Functional.hpp:2274
Scalar3QuaternionTernaryFunctor< Q1, Q2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:2245
Functor returning the sum of the four components of a quaternion expression.
Definition: Functional.hpp:1574
QuaternionScalarUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1576
static ResultType apply(const QuaternionExpression< Q > &e)
Returns the component sum of e.
Definition: Functional.hpp:1583
Functor checking component-wise equality of two quaternion expressions.
Definition: Functional.hpp:1490
static ResultType apply(const QuaternionExpression< Q1 > &e1, const QuaternionExpression< Q2 > &e2)
Tells whether e1 and e2 have equal components.
Definition: Functional.hpp:1501
QuaternionBooleanBinaryFunctor< Q1, Q2 >::ResultType ResultType
Definition: Functional.hpp:1493
QuaternionBooleanBinaryFunctor< Q1, Q2 >::ValueType ValueType
Definition: Functional.hpp:1492
Per-component functor returning the multiplicative inverse of a quaternion expression (n2 is the pre...
Definition: Functional.hpp:2076
static ResultType applyC3(const QuaternionExpression< E > &e, Argument2Type n2)
Returns the C3 component of the multiplicative inverse .
Definition: Functional.hpp:2115
Scalar2QuaternionBinaryFunctor< Q, T >::ResultType ResultType
Definition: Functional.hpp:2079
static ResultType applyC1(const QuaternionExpression< E > &e, Argument2Type n2)
Returns the C1 (real) component of the multiplicative inverse .
Definition: Functional.hpp:2089
Scalar2QuaternionBinaryFunctor< Q, T >::Argument2Type Argument2Type
Definition: Functional.hpp:2078
static ResultType applyC2(const QuaternionExpression< E > &e, Argument2Type n2)
Returns the C2 component of the multiplicative inverse .
Definition: Functional.hpp:2102
static ResultType applyC4(const QuaternionExpression< E > &e, Argument2Type n2)
Returns the C4 component of the multiplicative inverse .
Definition: Functional.hpp:2128
Functor returning the squared norm of a quaternion expression.
Definition: Functional.hpp:1639
QuaternionScalarRealUnaryFunctor< Q >::RealType RealType
Definition: Functional.hpp:1642
static ResultType apply(const QuaternionExpression< Q > &e)
Returns .
Definition: Functional.hpp:1650
QuaternionScalarRealUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1643
QuaternionScalarRealUnaryFunctor< Q >::ValueType ValueType
Definition: Functional.hpp:1641
Functor returning the (Euclidean) norm of a quaternion expression.
Definition: Functional.hpp:1611
QuaternionScalarRealUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1615
static ResultType apply(const QuaternionExpression< Q > &e)
Returns .
Definition: Functional.hpp:1622
QuaternionScalarRealUnaryFunctor< Q >::ValueType ValueType
Definition: Functional.hpp:1613
QuaternionScalarRealUnaryFunctor< Q >::RealType RealType
Definition: Functional.hpp:1614
Per-component functor returning the Hamilton product of two quaternion expressions.
Definition: Functional.hpp:2154
QuaternionBinaryFunctor< Q1, Q2 >::ResultType ResultType
Definition: Functional.hpp:2156
static ResultType applyC3(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
Returns the C3 component of the Hamilton product .
Definition: Functional.hpp:2197
static ResultType applyC2(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
Returns the C2 component of the Hamilton product .
Definition: Functional.hpp:2182
static ResultType applyC4(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
Returns the C4 component of the Hamilton product .
Definition: Functional.hpp:2212
static ResultType applyC1(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
Returns the C1 component of the Hamilton product .
Definition: Functional.hpp:2167
Base class for unary functors that take a quaternion expression and return a real-valued scalar (Math...
Definition: Functional.hpp:1595
RealType ResultType
The real-valued result type.
Definition: Functional.hpp:1602
Q::ValueType ValueType
The quaternion's component value type.
Definition: Functional.hpp:1598
ValueType RealType
The real-valued type (alias for ValueType).
Definition: Functional.hpp:1600
Base class for unary functors that take a quaternion expression and return a scalar result (Math::Qua...
Definition: Functional.hpp:1562
Q::ValueType ResultType
The scalar result type (the quaternion's element value type).
Definition: Functional.hpp:1565
Functor checking component-wise approximate equality of two quaternion expressions within an absolute...
Definition: Functional.hpp:1533
Scalar3QuaternionBooleanTernaryFunctor< Q1, Q2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:1537
Scalar3QuaternionBooleanTernaryFunctor< Q1, Q2, T >::ValueType ValueType
Definition: Functional.hpp:1535
Scalar3QuaternionBooleanTernaryFunctor< Q1, Q2, T >::ResultType ResultType
Definition: Functional.hpp:1536
static ResultType apply(const QuaternionExpression< Q1 > &e1, const QuaternionExpression< Q2 > &e2, Argument3Type epsilon)
Tells whether e1 and e2 agree component-wise within the absolute tolerance epsilon.
Definition: Functional.hpp:1546
Base class for per-component unary functors that take a quaternion expression and produce a quaternio...
Definition: Functional.hpp:1667
Q::ValueType ResultType
The component result type (the quaternion's element value type).
Definition: Functional.hpp:1670
Per-component functor returning the unreal (pure-quaternion) part of a quaternion expression (zeros C...
Definition: Functional.hpp:1679
QuaternionUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1681
static ResultType applyC1(const QuaternionExpression< E > &e)
Returns the C1 component of the unreal part (always zero).
Definition: Functional.hpp:1690
static ResultType applyC2(const QuaternionExpression< E > &e)
Returns the C2 component of the unreal part (equals e.getC2()).
Definition: Functional.hpp:1702
static ResultType applyC3(const QuaternionExpression< E > &e)
Returns the C3 component of the unreal part (equals e.getC3()).
Definition: Functional.hpp:1714
static ResultType applyC4(const QuaternionExpression< E > &e)
Returns the C4 component of the unreal part (equals e.getC4()).
Definition: Functional.hpp:1726
Base class for binary functors that take a quaternion expression and a vector expression and return a...
Definition: Functional.hpp:2409
ValueType ResultType
The scalar result type (alias for ValueType).
Definition: Functional.hpp:2416
V::SizeType SizeType
The unsigned size type used by the vector.
Definition: Functional.hpp:2414
CommonType< typename Q::ValueType, typename V::ValueType >::Type ValueType
The element value type (common type of the quaternion and vector element types).
Definition: Functional.hpp:2412
Functor returning element i of the rotated 3-dimensional vector (quaternion rotation of by ).
Definition: Functional.hpp:2427
QuaternionVectorBinaryFunctor< Q, V >::SizeType SizeType
Definition: Functional.hpp:2430
QuaternionVectorBinaryFunctor< Q, V >::ResultType ResultType
Definition: Functional.hpp:2431
QuaternionVectorBinaryFunctor< Q, V >::ValueType ValueType
Definition: Functional.hpp:2429
static ResultType apply(const QuaternionExpression< E1 > &e1, const VectorExpression< E2 > &e2, SizeType i)
Returns element i ( ) of the rotated 3-vector .
Definition: Functional.hpp:2444
Base class for per-component ternary functors that take a scalar T1 (lhs), a quaternion expression,...
Definition: Functional.hpp:2321
const T1 & Argument1Type
The first (scalar) argument type.
Definition: Functional.hpp:2326
const T2 & Argument3Type
The third (scalar) argument type.
Definition: Functional.hpp:2328
CommonType< typename CommonType< T1, typename Q::ValueType >::Type, T2 >::Type ResultType
The component result type (common type of T1, the quaternion's element value type,...
Definition: Functional.hpp:2324
Per-component functor returning (scalar t added to the real component of e).
Definition: Functional.hpp:1813
static ResultType applyC4(Argument1Type, const QuaternionExpression< E > &e)
Returns the C4 component of .
Definition: Functional.hpp:1862
static ResultType applyC1(Argument1Type t, const QuaternionExpression< E > &e)
Returns the C1 component of .
Definition: Functional.hpp:1826
Scalar1QuaternionBinaryFunctor< T, Q >::Argument1Type Argument1Type
Definition: Functional.hpp:1815
static ResultType applyC3(Argument1Type, const QuaternionExpression< E > &e)
Returns the C3 component of .
Definition: Functional.hpp:1850
static ResultType applyC2(Argument1Type, const QuaternionExpression< E > &e)
Returns the C2 component of .
Definition: Functional.hpp:1838
Scalar1QuaternionBinaryFunctor< T, Q >::ResultType ResultType
Definition: Functional.hpp:1816
Base class for per-component binary functors that take a scalar T (lhs) and a quaternion expression (...
Definition: Functional.hpp:1798
CommonType< T, typename Q::ValueType >::Type ResultType
The component result type (common type of the scalar and the quaternion's element value type).
Definition: Functional.hpp:1801
const T & Argument1Type
The first (scalar) argument type.
Definition: Functional.hpp:1803
Per-component functor returning (scalar t with the quaternion e subtracted).
Definition: Functional.hpp:1875
Scalar1QuaternionBinaryFunctor< T, Q >::Argument1Type Argument1Type
Definition: Functional.hpp:1877
Scalar1QuaternionBinaryFunctor< T, Q >::ResultType ResultType
Definition: Functional.hpp:1878
static ResultType applyC2(Argument1Type, const QuaternionExpression< E > &e)
Returns the C2 component of .
Definition: Functional.hpp:1900
static ResultType applyC3(Argument1Type, const QuaternionExpression< E > &e)
Returns the C3 component of .
Definition: Functional.hpp:1912
static ResultType applyC1(Argument1Type t, const QuaternionExpression< E > &e)
Returns the C1 component of .
Definition: Functional.hpp:1888
static ResultType applyC4(Argument1Type, const QuaternionExpression< E > &e)
Returns the C4 component of .
Definition: Functional.hpp:1924
Per-component functor returning (scalar t added to the real component of e).
Definition: Functional.hpp:1952
static ResultType applyC4(const QuaternionExpression< E > &e, Argument2Type)
Returns the C4 component of .
Definition: Functional.hpp:2001
static ResultType applyC3(const QuaternionExpression< E > &e, Argument2Type)
Returns the C3 component of .
Definition: Functional.hpp:1989
Scalar2QuaternionBinaryFunctor< Q, T >::Argument2Type Argument2Type
Definition: Functional.hpp:1954
Scalar2QuaternionBinaryFunctor< Q, T >::ResultType ResultType
Definition: Functional.hpp:1955
static ResultType applyC1(const QuaternionExpression< E > &e, Argument2Type t)
Returns the C1 component of .
Definition: Functional.hpp:1965
static ResultType applyC2(const QuaternionExpression< E > &e, Argument2Type)
Returns the C2 component of .
Definition: Functional.hpp:1977
Base class for per-component binary functors that take a quaternion expression (lhs) and a scalar T (...
Definition: Functional.hpp:1937
CommonType< typename Q::ValueType, T >::Type ResultType
The component result type (common type of the quaternion's element value type and the scalar).
Definition: Functional.hpp:1940
const T & Argument2Type
The second (scalar) argument type.
Definition: Functional.hpp:1942
Per-component functor returning (scalar t subtracted from the real component of e).
Definition: Functional.hpp:2014
static ResultType applyC2(const QuaternionExpression< E > &e, Argument2Type)
Returns the C2 component of .
Definition: Functional.hpp:2039
static ResultType applyC1(const QuaternionExpression< E > &e, Argument2Type t)
Returns the C1 component of .
Definition: Functional.hpp:2027
static ResultType applyC4(const QuaternionExpression< E > &e, Argument2Type)
Returns the C4 component of .
Definition: Functional.hpp:2063
Scalar2QuaternionBinaryFunctor< Q, T >::ResultType ResultType
Definition: Functional.hpp:2017
static ResultType applyC3(const QuaternionExpression< E > &e, Argument2Type)
Returns the C3 component of .
Definition: Functional.hpp:2051
Scalar2QuaternionBinaryFunctor< Q, T >::Argument2Type Argument2Type
Definition: Functional.hpp:2016
Base class for ternary functors that take two grid expressions plus a tolerance scalar and return a b...
Definition: Functional.hpp:2548
bool ResultType
The boolean result type.
Definition: Functional.hpp:2551
const T & Argument3Type
The third (scalar) argument type.
Definition: Functional.hpp:2553
CommonType< typename G1::ValueType, typename G2::ValueType >::Type ValueType
The cell value type (common type of the two grid cell types).
Definition: Functional.hpp:2557
CommonType< typename G1::SizeType, typename G2::SizeType >::Type SizeType
The unsigned size type (common type of the two grid size types).
Definition: Functional.hpp:2555
Base class for ternary functors that take two matrix expressions plus a tolerance scalar and return a...
Definition: Functional.hpp:948
CommonType< typename M1::ValueType, typename M2::ValueType >::Type ValueType
The element value type (common type of the two matrix element types).
Definition: Functional.hpp:957
CommonType< typename M1::SizeType, typename M2::SizeType >::Type SizeType
The unsigned size type (common type of the two matrix size types).
Definition: Functional.hpp:955
const T & Argument3Type
The third (scalar) argument type.
Definition: Functional.hpp:953
bool ResultType
The boolean result type.
Definition: Functional.hpp:951
Base class for ternary functors that take two quaternion expressions plus a tolerance scalar and retu...
Definition: Functional.hpp:1515
CommonType< typename Q1::ValueType, typename Q2::ValueType >::Type ValueType
The component value type (common type of the two quaternion element types).
Definition: Functional.hpp:1522
const T & Argument3Type
The third (scalar) argument type.
Definition: Functional.hpp:1520
bool ResultType
The boolean result type.
Definition: Functional.hpp:1518
Base class for per-component ternary functors that take two quaternion expressions plus a scalar (Mat...
Definition: Functional.hpp:2227
CommonType< typename CommonType< typename Q1::ValueType, typename Q2::ValueType >::Type, T >::Type ResultType
The component result type (common type of the two quaternion element types and the scalar).
Definition: Functional.hpp:2230
const T & Argument3Type
The third (scalar) argument type.
Definition: Functional.hpp:2232
Base class for ternary functors that take two vectors and a scalar tolerance and return a boolean (Ma...
Definition: Functional.hpp:570
bool ResultType
The boolean result type.
Definition: Functional.hpp:573
const T & Argument3Type
The third (scalar) argument type.
Definition: Functional.hpp:575
CommonType< typename V1::ValueType, typename V2::ValueType >::Type ValueType
The element value type (common type of the two vector element types).
Definition: Functional.hpp:579
CommonType< typename V1::SizeType, typename V2::SizeType >::Type SizeType
The unsigned size type (common type of the two vector size types).
Definition: Functional.hpp:577
Scalar in-place addition functor: apply(t1, t2) performs t1 += t2.
Definition: Functional.hpp:103
static void apply(Argument1Type t1, Argument2Type t2)
Performs t1 += t2.
Definition: Functional.hpp:113
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:106
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:105
Scalar binary addition functor: apply(t1, t2) returns t1 + t2.
Definition: Functional.hpp:344
ScalarBinaryFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:346
static ResultType apply(Argument1Type t1, Argument2Type t2)
Returns t1 + t2.
Definition: Functional.hpp:356
ScalarBinaryFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:347
ScalarBinaryFunctor< T1, T2 >::ResultType ResultType
Definition: Functional.hpp:348
Scalar plain-assignment functor: apply(t1, t2) performs t1 = t2.
Definition: Functional.hpp:80
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:83
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:82
static void apply(Argument1Type t1, Argument2Type t2)
Performs t1 = t2.
Definition: Functional.hpp:90
Base class for binary in-place assignment functors of the form F::apply(T1, const T2&).
Definition: Functional.hpp:65
const T2 & Argument2Type
The second (source) argument type.
Definition: Functional.hpp:70
T1 Argument1Type
The (modifiable) first argument type.
Definition: Functional.hpp:68
Base class for binary scalar functors of the form F::apply(const T1&, const T2&) returning a Math::Co...
Definition: Functional.hpp:327
const T2 & Argument2Type
The second argument type.
Definition: Functional.hpp:332
const T1 & Argument1Type
The first argument type.
Definition: Functional.hpp:330
CommonType< T1, T2 >::Type ResultType
The result type (common type of T1 and T2).
Definition: Functional.hpp:334
Scalar complex-conjugation functor: apply(v) returns (identity for real types).
Definition: Functional.hpp:237
ScalarUnaryFunctor< T >::ArgumentType ArgumentType
Definition: Functional.hpp:240
static ResultType apply(ArgumentType v)
Returns the complex conjugate of v.
Definition: Functional.hpp:248
ScalarUnaryFunctor< T >::ResultType ResultType
Definition: Functional.hpp:241
ScalarUnaryFunctor< T >::ValueType ValueType
Definition: Functional.hpp:239
Scalar in-place division functor: apply(t1, t2) performs t1 /= t2.
Definition: Functional.hpp:172
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:174
static void apply(Argument1Type t1, Argument2Type t2)
Performs t1 /= t2.
Definition: Functional.hpp:182
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:175
Scalar binary division functor: apply(t1, t2) returns t1 / t2.
Definition: Functional.hpp:419
ScalarBinaryFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:421
static ResultType apply(Argument1Type t1, Argument2Type t2)
Returns t1 / t2.
Definition: Functional.hpp:431
ScalarBinaryFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:422
ScalarBinaryFunctor< T1, T2 >::ResultType ResultType
Definition: Functional.hpp:423
Scalar imaginary-part functor: apply(v) returns (zero for real types).
Definition: Functional.hpp:299
ScalarUnaryFunctor< T >::ResultType ResultType
Definition: Functional.hpp:303
static ResultType apply(ArgumentType v)
Returns the imaginary part of v.
Definition: Functional.hpp:310
ScalarUnaryFunctor< T >::ValueType ValueType
Definition: Functional.hpp:301
ScalarUnaryFunctor< T >::ArgumentType ArgumentType
Definition: Functional.hpp:302
Scalar in-place multiplication functor: apply(t1, t2) performs t1 *= t2.
Definition: Functional.hpp:149
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:151
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:152
static void apply(Argument1Type t1, Argument2Type t2)
Performs t1 *= t2.
Definition: Functional.hpp:159
Scalar binary multiplication functor: apply(t1, t2) returns t1 * t2.
Definition: Functional.hpp:394
ScalarBinaryFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:397
ScalarBinaryFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:396
static ResultType apply(Argument1Type t1, Argument2Type t2)
Returns t1 * t2.
Definition: Functional.hpp:406
ScalarBinaryFunctor< T1, T2 >::ResultType ResultType
Definition: Functional.hpp:398
Scalar negation functor: apply(v) returns -v.
Definition: Functional.hpp:214
ScalarUnaryFunctor< T >::ValueType ValueType
Definition: Functional.hpp:216
ScalarUnaryFunctor< T >::ResultType ResultType
Definition: Functional.hpp:218
static ResultType apply(ArgumentType v)
Returns -v.
Definition: Functional.hpp:225
ScalarUnaryFunctor< T >::ArgumentType ArgumentType
Definition: Functional.hpp:217
Per-component functor returning the scalar/quaternion division (n2 is the precomputed squared norm o...
Definition: Functional.hpp:2339
static ResultType applyC1(Argument1Type t, const QuaternionExpression< E > &e, Argument3Type n2)
Returns the C1 component of using the precomputed squared norm n2 of e.
Definition: Functional.hpp:2354
static ResultType applyC4(Argument1Type t, const QuaternionExpression< E > &e, Argument3Type n2)
Returns the C4 component of using the precomputed squared norm n2 of e.
Definition: Functional.hpp:2396
static ResultType applyC2(Argument1Type t, const QuaternionExpression< E > &e, Argument3Type n2)
Returns the C2 component of using the precomputed squared norm n2 of e.
Definition: Functional.hpp:2368
Scalar13QuaternionTernaryFunctor< T1, Q, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:2341
Scalar13QuaternionTernaryFunctor< T1, Q, T2 >::ResultType ResultType
Definition: Functional.hpp:2343
static ResultType applyC3(Argument1Type t, const QuaternionExpression< E > &e, Argument3Type n2)
Returns the C3 component of using the precomputed squared norm n2 of e.
Definition: Functional.hpp:2382
Scalar13QuaternionTernaryFunctor< T1, Q, T2 >::Argument3Type Argument3Type
Definition: Functional.hpp:2342
Base class for unary scalar functors that return the real part of T (Math::ScalarReal,...
Definition: Functional.hpp:260
TypeTraits< T >::RealType ResultType
The real-valued result type derived from ValueType via Math::TypeTraits.
Definition: Functional.hpp:267
const T & ArgumentType
The argument type (a const reference to ValueType).
Definition: Functional.hpp:265
T ValueType
The scalar value type.
Definition: Functional.hpp:263
Scalar real-part functor: apply(v) returns (identity for real types).
Definition: Functional.hpp:276
ScalarUnaryFunctor< T >::ArgumentType ArgumentType
Definition: Functional.hpp:279
ScalarUnaryFunctor< T >::ValueType ValueType
Definition: Functional.hpp:278
static ResultType apply(ArgumentType v)
Returns the real part of v.
Definition: Functional.hpp:287
ScalarUnaryFunctor< T >::ResultType ResultType
Definition: Functional.hpp:280
Scalar in-place subtraction functor: apply(t1, t2) performs t1 -= t2.
Definition: Functional.hpp:126
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:129
static void apply(Argument1Type t1, Argument2Type t2)
Performs t1 -= t2.
Definition: Functional.hpp:136
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:128
Scalar binary subtraction functor: apply(t1, t2) returns t1 - t2.
Definition: Functional.hpp:369
ScalarBinaryFunctor< T1, T2 >::ResultType ResultType
Definition: Functional.hpp:373
ScalarBinaryFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:372
ScalarBinaryFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:371
static ResultType apply(Argument1Type t1, Argument2Type t2)
Returns t1 - t2.
Definition: Functional.hpp:381
static RealType real(ConstReference t)
Returns the real part of t (identical to t for non-complex scalars).
Definition: TypeTraits.hpp:102
static RealType conj(ConstReference t)
Returns the complex conjugate of t (identical to t for non-complex scalars).
Definition: TypeTraits.hpp:121
static RealType normInf(ConstReference t)
Returns the L∞ norm of t (identical to the absolute value for scalar values).
Definition: TypeTraits.hpp:171
static RealType imag(ConstReference)
Returns the imaginary part (always zero for non-complex scalars).
Definition: TypeTraits.hpp:111
static ValueType sqrt(ConstReference t)
Returns the square root of t.
Definition: TypeTraits.hpp:141
static RealType norm2(ConstReference t)
Returns the L2 (Euclidean) norm of t (identical to the absolute value for scalar values).
Definition: TypeTraits.hpp:161
T RealType
The real-valued type (identical to ValueType for scalar traits).
Definition: TypeTraits.hpp:91
Base class for unary scalar functors of the form F::apply(const T&) returning a T result.
Definition: Functional.hpp:198
T ValueType
The scalar value type.
Definition: Functional.hpp:201
const T & ArgumentType
The argument type (a const reference to ValueType).
Definition: Functional.hpp:203
ValueType ResultType
The result type of apply().
Definition: Functional.hpp:205
Primary traits template for scalar arithmetic value types.
Definition: TypeTraits.hpp:285
Functor returning the cosine of the angle between two vectors (optionally clamped to [-1,...
Definition: Functional.hpp:490
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2, const T &sd, bool clamp)
Returns the cosine of the angle between e1 and e2.
Definition: Functional.hpp:502
CommonType< typename VectorInnerProduct< V1, V2 >::ResultType, T >::Type ResultType
Definition: Functional.hpp:492
Base class for binary functors that take two vectors and return a vector (Math::VectorCrossProduct).
Definition: Functional.hpp:628
CommonType< typename V1::ValueType, typename V2::ValueType >::Type ResultType
The element result type (common type of the two vector element types).
Definition: Functional.hpp:631
Base class for binary functors that take two vectors and return a boolean (Math::VectorEquality and s...
Definition: Functional.hpp:520
CommonType< typename V1::ValueType, typename V2::ValueType >::Type ValueType
The element value type (common type of the two vector element types).
Definition: Functional.hpp:527
bool ResultType
The boolean result type.
Definition: Functional.hpp:523
CommonType< typename V1::SizeType, typename V2::SizeType >::Type SizeType
The unsigned size type (common type of the two vector size types).
Definition: Functional.hpp:525
Vector cross-product functor: apply(e1, e2, i) returns the i-th component of the 3-vector cross produ...
Definition: Functional.hpp:641
static ResultType apply(const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2, SizeType i)
Returns the i-th component of the cross product .
Definition: Functional.hpp:657
VectorScalarBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:643
Functor returning the sum of all elements of a vector expression.
Definition: Functional.hpp:699
VectorScalarUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:701
static ResultType apply(const VectorExpression< V > &e)
Returns the sum of all elements of e.
Definition: Functional.hpp:708
Vector equality functor: apply(e1, e2) tests element-wise equality of two vector expressions.
Definition: Functional.hpp:537
VectorBooleanBinaryFunctor< V1, V2 >::ValueType ValueType
Definition: Functional.hpp:540
VectorBooleanBinaryFunctor< V1, V2 >::SizeType SizeType
Definition: Functional.hpp:539
VectorBooleanBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:541
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2)
Tells whether the vector expressions e1 and e2 are element-wise equal.
Definition: Functional.hpp:549
Vector inner-product functor: apply(e1, e2) returns .
Definition: Functional.hpp:457
VectorScalarBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:459
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2)
Returns the inner product of e1 and e2.
Definition: Functional.hpp:468
Functor returning element i of the vector-matrix product .
Definition: Functional.hpp:1385
MatrixVectorBinaryFunctor< M, V >::ResultType ResultType
Definition: Functional.hpp:1389
MatrixVectorBinaryFunctor< M, V >::SizeType SizeType
Definition: Functional.hpp:1388
static ResultType apply(const VectorExpression< E1 > &e1, const MatrixExpression< E2 > &e2, SizeType i)
Returns element i of the vector-matrix product .
Definition: Functional.hpp:1402
MatrixVectorBinaryFunctor< M, V >::ValueType ValueType
Definition: Functional.hpp:1387
Base class for unary functors that produce a matrix element from a vector expression and (i,...
Definition: Functional.hpp:1213
V::ValueType ResultType
The matrix-entry result type (the vector's element value type).
Definition: Functional.hpp:1216
V::SizeType SizeType
The unsigned size type used by the vector.
Definition: Functional.hpp:1218
Functor returning the L1 norm of a vector expression.
Definition: Functional.hpp:743
static ResultType apply(const VectorExpression< V > &e)
Returns the L1 norm of e.
Definition: Functional.hpp:754
VectorScalarRealUnaryFunctor< V >::RealType RealType
Definition: Functional.hpp:746
VectorScalarRealUnaryFunctor< V >::ValueType ValueType
Definition: Functional.hpp:745
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:747
Functor returning the L2 (Euclidean) norm of a vector expression.
Definition: Functional.hpp:773
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:777
VectorScalarRealUnaryFunctor< V >::RealType RealType
Definition: Functional.hpp:776
static ResultType apply(const VectorExpression< V > &e)
Returns the L2 norm of e.
Definition: Functional.hpp:784
VectorScalarRealUnaryFunctor< V >::ValueType ValueType
Definition: Functional.hpp:775
Functor returning the index of the vector element with the largest L∞ norm.
Definition: Functional.hpp:856
VectorScalarIndexUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:860
VectorScalarIndexUnaryFunctor< V >::ValueType ValueType
Definition: Functional.hpp:858
VectorScalarIndexUnaryFunctor< V >::RealType RealType
Definition: Functional.hpp:859
static ResultType apply(const VectorExpression< V > &e)
Returns the index of the element of e with the largest L∞ norm.
Definition: Functional.hpp:867
Functor returning the L∞ (maximum-magnitude) norm of a vector expression.
Definition: Functional.hpp:806
static ResultType apply(const VectorExpression< V > &e)
Returns the L∞ norm of e.
Definition: Functional.hpp:817
VectorScalarRealUnaryFunctor< V >::ValueType ValueType
Definition: Functional.hpp:808
VectorScalarRealUnaryFunctor< V >::RealType RealType
Definition: Functional.hpp:809
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:810
Base class for binary functors that take two vectors and return a scalar (Math::VectorInnerProduct,...
Definition: Functional.hpp:444
CommonType< typename V1::ValueType, typename V2::ValueType >::Type ResultType
The scalar result type (common type of the two vector element types).
Definition: Functional.hpp:447
Base class for unary functors that take a vector and return a vector-element index (Math::VectorNormI...
Definition: Functional.hpp:840
TypeTraits< ValueType >::RealType RealType
The real-valued type derived from ValueType via Math::TypeTraits.
Definition: Functional.hpp:845
V::ValueType ValueType
The vector's element value type.
Definition: Functional.hpp:843
V::SizeType ResultType
The result type (the vector's size type, used for element indices).
Definition: Functional.hpp:847
Base class for unary functors that take a vector and return a real-valued scalar (Math::VectorNorm1,...
Definition: Functional.hpp:727
RealType ResultType
The real-valued result type.
Definition: Functional.hpp:734
TypeTraits< ValueType >::RealType RealType
The real-valued type derived from ValueType via Math::TypeTraits.
Definition: Functional.hpp:732
V::ValueType ValueType
The vector's element value type.
Definition: Functional.hpp:730
Base class for unary functors that take a vector and return a scalar (Math::VectorElementSum).
Definition: Functional.hpp:685
V::ValueType ResultType
The scalar result type (the vector's element value type).
Definition: Functional.hpp:688
V::SizeType SizeType
The unsigned size type used by the vector.
Definition: Functional.hpp:690
Vector tolerance-equality functor: apply(e1, e2, eps) tests element-wise equality within an absolute ...
Definition: Functional.hpp:590
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::ValueType ValueType
Definition: Functional.hpp:593
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::SizeType SizeType
Definition: Functional.hpp:592
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:595
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::ResultType ResultType
Definition: Functional.hpp:594
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2, Argument3Type epsilon)
Tells whether the vector expressions e1 and e2 are element-wise equal within an absolute tolerance ep...
Definition: Functional.hpp:604