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>
83 template <
typename T1,
typename T2>
106 template <
typename T1,
typename T2>
129 template <
typename T1,
typename T2>
152 template <
typename T1,
typename T2>
175 template <
typename T1,
typename T2>
201 template <
typename T>
225 template <
typename T>
248 template <
typename T>
271 template <
typename T>
295 template <
typename T>
318 template <
typename T>
346 template <
typename T1,
typename T2>
371 template <
typename T1,
typename T2>
396 template <
typename T1,
typename T2>
421 template <
typename T1,
typename T2>
446 template <
typename T1,
typename T2>
471 template <
typename V1,
typename V2>
486 template <
typename V1,
typename V2>
506 for (SizeType i = 0; i < size; i++)
507 res += e1()(i) * e2()(i);
519 template <
typename V1,
typename V2,
typename T>
549 template <
typename V1,
typename V2>
574 template <
typename V1,
typename V2>
593 for (
SizeType i = 0, size = e1().getSize(); i < size; i++)
607 template <
typename V1,
typename V2,
typename T>
638 template <
typename V1,
typename V2,
typename T>
661 ComparisonType norm_inf_max(epsilon);
663 for (
SizeType i = 0, size = e1().getSize(); i < size; i++)
676 template <
typename V1,
typename V2>
691 template <
typename V1,
typename V2>
708 template <
typename E1,
typename E2,
typename SizeType>
717 return (e1()(1) * e2()(2) - e1()(2) * e2()(1));
720 return (e1()(2) * e2()(0) - e1()(0) * e2()(2));
723 return (e1()(0) * e2()(1) - e1()(1) * e2()(0));
735 template <
typename V>
754 template <
typename V>
767 typedef typename V::SizeType
SizeType;
771 for (
SizeType i = 0, size = e().getSize(); i < size; i++)
778 template <
typename V>
806 template <
typename V>
821 typedef typename V::SizeType SizeType;
825 for (SizeType i = 0, size = e().getSize(); i < size; i++)
836 template <
typename V>
851 typedef typename V::SizeType SizeType;
855 for (SizeType i = 0, size = e().getSize(); i < size; i++) {
869 template <
typename V>
884 typedef typename V::SizeType SizeType;
888 for (SizeType i = 0, size = e().getSize(); i < size; i++) {
903 template <
typename V>
927 template <
typename V>
942 typedef typename V::SizeType SizeType;
947 for (SizeType i = 0, size = e().getSize(); i < size; i++) {
965 template <
typename M1,
typename M2>
990 template <
typename M1,
typename M2>
1012 for (
SizeType i = 0, size1 = e1().getSize1(); i < size1; i++)
1013 for (
SizeType j = 0, size2 = e1().getSize2(); j < size2; j++)
1027 template <
typename M1,
typename M2,
typename T>
1058 template <
typename M1,
typename M2,
typename T>
1084 ComparisonType norm_inf_max(epsilon);
1086 for (
SizeType i = 0, size1 = e1().getSize1(); i < size1; i++)
1087 for (
SizeType j = 0, size2 = e1().getSize2(); j < size2; j++)
1099 template <
typename M>
1113 template <
typename M>
1126 typedef typename M::SizeType SizeType;
1129 SizeType size1 = e().getSize1();
1130 SizeType size2 = e().getSize2();
1132 for (SizeType i = 0; i < size1; i++)
1133 for (SizeType j = 0; j < size2; j++)
1144 template <
typename M>
1158 typedef typename M::SizeType SizeType;
1163 for (SizeType i = 0; i < size; i++)
1174 template <
typename M>
1198 template <
typename M>
1213 typedef typename M::SizeType SizeType;
1216 SizeType size1 = e().getSize1();
1217 SizeType size2 = e().getSize2();
1219 for (SizeType j = 0; j < size2; j++) {
1222 for (SizeType i = 0; i < size1; i++)
1237 template <
typename M>
1252 typedef typename M::SizeType SizeType;
1255 SizeType size1 = e().getSize1();
1256 SizeType size2 = e().getSize2();
1258 for (SizeType i = 0; i < size1; i++) {
1259 for (SizeType j = 0; j < size2; j++) {
1274 template <
typename M>
1289 typedef typename M::SizeType SizeType;
1292 SizeType size1 = e().getSize1();
1293 SizeType size2 = e().getSize2();
1295 for (SizeType i = 0; i < size1; i++) {
1298 for (SizeType j = 0; j < size2; j++)
1313 template <
typename V>
1332 template <
typename V>
1347 template <
typename E>
1361 template <
typename V>
1377 template <
typename E>
1437 template <
typename M,
typename V>
1462 template <
typename M,
typename V>
1480 template <
typename E1,
typename E2>
1486 for (
SizeType j = 0; j < size; j++)
1487 res += e1()(i, j) * e2()(j);
1498 template <
typename V,
typename M>
1516 template <
typename E1,
typename E2>
1522 for (
SizeType j = 0; j < size; j++)
1523 res += e1()(j) * e2()(j, i);
1534 template <
typename M1,
typename M2>
1559 template <
typename M1,
typename M2>
1578 template <
typename E1,
typename E2>
1584 for (
SizeType k = 0; k < size; k++)
1585 res += e1()(i, k) * e2()(k, j);
1596 template <
typename Q1,
typename Q2>
1616 template <
typename Q1,
typename Q2>
1641 template <
typename Q1,
typename Q2,
typename T>
1667 template <
typename Q1,
typename Q2,
typename T>
1686 ComparisonType norm_inf_max(epsilon);
1696 template <
typename Q>
1710 template <
typename Q>
1723 return (e().getC1() + e().getC2() + e().getC3() + e().getC4());
1731 template <
typename Q>
1755 template <
typename Q>
1770 RealType t = e().getC1() * e().getC1() +
1771 e().getC2() * e().getC2() +
1772 e().getC3() * e().getC3() +
1773 e().getC4() * e().getC4();
1783 template <
typename Q>
1798 RealType t = e().getC1() * e().getC1() +
1799 e().getC2() * e().getC2() +
1800 e().getC3() * e().getC3() +
1801 e().getC4() * e().getC4();
1811 template <
typename Q>
1825 template <
typename Q>
1837 template <
typename E>
1849 template <
typename E>
1861 template <
typename E>
1873 template <
typename E>
1884 template <
typename Q>
1896 template <
typename E>
1908 template <
typename E>
1911 return -e().getC2();
1920 template <
typename E>
1923 return -e().getC3();
1932 template <
typename E>
1935 return -e().getC4();
1944 template <
typename T,
typename Q>
1964 template <
typename T,
typename Q>
1978 template <
typename E>
1981 return (t + e().getC1());
1990 template <
typename E>
2002 template <
typename E>
2014 template <
typename E>
2026 template <
typename T,
typename Q>
2040 template <
typename E>
2043 return (t - e().getC1());
2052 template <
typename E>
2055 return -e().getC2();
2064 template <
typename E>
2067 return -e().getC3();
2076 template <
typename E>
2079 return -e().getC4();
2088 template <
typename Q,
typename T>
2108 template <
typename Q,
typename T>
2122 template <
typename E>
2125 return (e().getC1() + t);
2134 template <
typename E>
2146 template <
typename E>
2158 template <
typename E>
2170 template <
typename Q,
typename T>
2184 template <
typename E>
2187 return (e().getC1() - t);
2196 template <
typename E>
2208 template <
typename E>
2220 template <
typename E>
2232 template <
typename Q,
typename T>
2246 template <
typename E>
2249 return (e().getC1() / n2);
2259 template <
typename E>
2262 return (-e().getC2() / n2);
2272 template <
typename E>
2275 return (-e().getC3() / n2);
2285 template <
typename E>
2288 return (-e().getC4() / n2);
2297 template <
typename Q1,
typename Q2>
2312 template <
typename Q1,
typename Q2>
2326 template <
typename E1,
typename E2>
2330 return (e1().getC1() * e2().getC1() - e1().getC2() * e2().getC2() - e1().getC3() * e2().getC3() - e1().getC4() * e2().getC4());
2341 template <
typename E1,
typename E2>
2345 return (e1().getC1() * e2().getC2() + e1().getC2() * e2().getC1() + e1().getC3() * e2().getC4() - e1().getC4() * e2().getC3());
2356 template <
typename E1,
typename E2>
2360 return (e1().getC1() * e2().getC3() - e1().getC2() * e2().getC4() + e1().getC3() * e2().getC1() + e1().getC4() * e2().getC2());
2371 template <
typename E1,
typename E2>
2375 return (e1().getC1() * e2().getC4() + e1().getC2() * e2().getC3() - e1().getC3() * e2().getC2() + e1().getC4() * e2().getC1());
2385 template <
typename Q1,
typename Q2,
typename T>
2406 template <
typename Q1,
typename Q2,
typename T>
2422 template <
typename E1,
typename E2>
2426 return ((e1().getC1() * e2().getC1() + e1().getC2() * e2().getC2() + e1().getC3() * e2().getC3() + e1().getC4() * e2().getC4()) / n2);
2438 template <
typename E1,
typename E2>
2442 return ((-e1().getC1() * e2().getC2() + e1().getC2() * e2().getC1() - e1().getC3() * e2().getC4() + e1().getC4() * e2().getC3()) / n2);
2454 template <
typename E1,
typename E2>
2458 return ((-e1().getC1() * e2().getC3() + e1().getC2() * e2().getC4() + e1().getC3() * e2().getC1() - e1().getC4() * e2().getC2()) / n2);
2470 template <
typename E1,
typename E2>
2474 return ((-e1().getC1() * e2().getC4() - e1().getC2() * e2().getC3() + e1().getC3() * e2().getC2() + e1().getC4() * e2().getC1()) / n2);
2484 template <
typename T1,
typename Q,
typename T2>
2510 template <
typename T1,
typename Q,
typename T2>
2526 template <
typename E>
2529 return (t * e().getC1() / n2);
2540 template <
typename E>
2543 return (t * -e().getC2() / n2);
2554 template <
typename E>
2557 return (t * -e().getC3() / n2);
2568 template <
typename E>
2571 return (t * -e().getC4() / n2);
2580 template <
typename Q,
typename V>
2606 template <
typename Q,
typename V>
2624 template <
typename E1,
typename E2>
2633 ValueType t1 = e1().getC1() * e1().getC1() + e1().getC2() * e1().getC2() - e1().getC3() * e1().getC3() - e1().getC4() * e1().getC4();
2634 ValueType t2 =
ValueType(2) * (e1().getC2() * e1().getC3() - e1().getC1() * e1().getC4());
2635 ValueType t3 =
ValueType(2) * (e1().getC2() * e1().getC4() + e1().getC1() * e1().getC3());
2637 return (t1 * e2()(0) + t2 * e2()(1) + t3 * e2()(2));
2642 ValueType t1 =
ValueType(2) * (e1().getC2() * e1().getC3() + e1().getC1() * e1().getC4());
2643 ValueType t2 = e1().getC1() * e1().getC1() - e1().getC2() * e1().getC2() + e1().getC3() * e1().getC3() - e1().getC4() * e1().getC4();
2644 ValueType t3 =
ValueType(2) * (e1().getC3() * e1().getC4() - e1().getC1() * e1().getC2());
2646 return (t1 * e2()(0) + t2 * e2()(1) + t3 * e2()(2));
2651 ValueType t1 =
ValueType(2) * (e1().getC2() * e1().getC4() - e1().getC1() * e1().getC3());
2652 ValueType t2 =
ValueType(2) * (e1().getC3() * e1().getC4() + e1().getC1() * e1().getC2());
2653 ValueType t3 = e1().getC1() * e1().getC1() - e1().getC2() * e1().getC2() - e1().getC3() * e1().getC3() + e1().getC4() * e1().getC4();
2655 return (t1 * e2()(0) + t2 * e2()(1) + t3 * e2()(2));
2669 template <
typename G1,
typename G2>
2694 template <
typename G1,
typename G2>
2719 for (
SizeType i = 0, size1 = e1().getSize1(); i < size1; i++)
2720 for (
SizeType j = 0, size2 = e1().getSize2(); j < size2; j++)
2721 for (
SizeType k = 0, size3 = e1().getSize3(); k < size3; k++)
2735 template <
typename G1,
typename G2,
typename T>
2766 template <
typename G1,
typename G2,
typename T>
2795 ComparisonType norm_inf_max(epsilon);
2797 for (
SizeType i = 0, size1 = e1().getSize1(); i < size1; i++)
2798 for (
SizeType j = 0, size2 = e1().getSize2(); j < size2; j++)
2799 for (
SizeType k = 0, size3 = e1().getSize3(); k < size3; k++)
2811 template <
typename M>
2825 template <
typename G>
2838 typedef typename G::SizeType SizeType;
2841 SizeType size1 = e().getSize1();
2842 SizeType size2 = e().getSize2();
2843 SizeType size3 = e().getSize3();
2845 for (SizeType i = 0; i < size1; i++)
2846 for (SizeType j = 0; j < size2; j++)
2847 for (SizeType k = 0; k < size3; k++)
2848 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 of all grid expression types.
Definition: Expression.hpp:188
CRTP base class of all matrix expression types.
Definition: Expression.hpp:108
CRTP base class of all quaternion expression types.
Definition: Expression.hpp:148
CRTP base class of all vector expression types.
Definition: Expression.hpp:68
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:1574
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:51
Functor producing the cross-product (skew-symmetric) matrix element at (i, j) for a 3D vector express...
Definition: Functional.hpp:1363
VectorScalarUnaryFunctor< V >::SizeType SizeType
Definition: Functional.hpp:1366
static ResultType apply(const VectorExpression< E > &e, SizeType i, SizeType j)
Returns the (i, j) element of the skew-symmetric matrix corresponding to the 3D vector e.
Definition: Functional.hpp:1378
VectorScalarUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:1365
Functor producing the diagonal matrix element at (i, j) from a vector expression ( on the diagonal,...
Definition: Functional.hpp:1334
VectorScalarUnaryFunctor< V >::SizeType SizeType
Definition: Functional.hpp:1337
static ResultType apply(const VectorExpression< E > &e, SizeType i, SizeType j)
Returns if i equals j, otherwise 0.
Definition: Functional.hpp:1348
VectorScalarUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:1336
Base class for binary functors that take two grid expressions and return a bool result (Math::GridEqu...
Definition: Functional.hpp:2671
CommonType< typename G1::SizeType, typename G2::SizeType >::Type SizeType
The unsigned size type (common type of the two grid size types).
Definition: Functional.hpp:2681
bool ResultType
The boolean result type.
Definition: Functional.hpp:2676
CommonType< typename G1::ValueType, typename G2::ValueType >::Type ValueType
The element value type (common type of the two grid element types).
Definition: Functional.hpp:2686
Functor returning the sum of all elements of a grid expression.
Definition: Functional.hpp:2827
GridScalarUnaryFunctor< G >::ResultType ResultType
Definition: Functional.hpp:2829
static ResultType apply(const GridExpression< G > &e)
Returns the element sum of e.
Definition: Functional.hpp:2836
Functor checking element-wise equality of two grid expressions.
Definition: Functional.hpp:2696
static ResultType apply(const GridExpression< G1 > &e1, const GridExpression< G2 > &e2)
Tells whether e1 and e2 have the same dimensions and equal element values.
Definition: Functional.hpp:2708
GridBooleanBinaryFunctor< G1, G2 >::ResultType ResultType
Definition: Functional.hpp:2700
GridBooleanBinaryFunctor< G1, G2 >::SizeType SizeType
Definition: Functional.hpp:2698
GridBooleanBinaryFunctor< G1, G2 >::ValueType ValueType
Definition: Functional.hpp:2699
Base class for unary functors that take a grid expression and return a scalar result (Math::GridEleme...
Definition: Functional.hpp:2813
M::ValueType ResultType
The scalar result type (the grid's element value type).
Definition: Functional.hpp:2818
Functor checking element-wise approximate equality of two grid expressions within an absolute toleran...
Definition: Functional.hpp:2768
Scalar3GridBooleanTernaryFunctor< G1, G2, T >::ValueType ValueType
Definition: Functional.hpp:2771
Scalar3GridBooleanTernaryFunctor< G1, G2, T >::ResultType ResultType
Definition: Functional.hpp:2772
Scalar3GridBooleanTernaryFunctor< G1, G2, T >::SizeType SizeType
Definition: Functional.hpp:2770
Scalar3GridBooleanTernaryFunctor< G1, G2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:2773
static ResultType apply(const GridExpression< G1 > &e1, const GridExpression< G2 > &e2, Argument3Type epsilon)
Tells whether e1 and e2 agree element-wise within the absolute tolerance epsilon.
Definition: Functional.hpp:2782
Base class for binary functors that take two matrix expressions and return a matrix element scalar re...
Definition: Functional.hpp:1536
ValueType ResultType
The scalar result type (alias for ValueType).
Definition: Functional.hpp:1551
CommonType< typename M1::ValueType, typename M2::ValueType >::Type ValueType
The element value type (common type of the two matrix element types).
Definition: Functional.hpp:1541
CommonType< typename M1::SizeType, typename M2::SizeType >::Type SizeType
The unsigned size type (common type of the two matrix size types).
Definition: Functional.hpp:1546
Base class for binary functors that take two matrix expressions and return a bool result (Math::Matri...
Definition: Functional.hpp:967
CommonType< typename M1::SizeType, typename M2::SizeType >::Type SizeType
The unsigned size type (common type of the two matrix size types).
Definition: Functional.hpp:977
CommonType< typename M1::ValueType, typename M2::ValueType >::Type ValueType
The element value type (common type of the two matrix element types).
Definition: Functional.hpp:982
bool ResultType
The boolean result type.
Definition: Functional.hpp:972
Functor returning the sum of all elements of a matrix expression.
Definition: Functional.hpp:1115
MatrixScalarUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1117
static ResultType apply(const MatrixExpression< M > &e)
Returns the element sum of e.
Definition: Functional.hpp:1124
Functor checking element-wise equality of two matrix expressions.
Definition: Functional.hpp:992
MatrixBooleanBinaryFunctor< M1, M2 >::SizeType SizeType
Definition: Functional.hpp:994
MatrixBooleanBinaryFunctor< M1, M2 >::ResultType ResultType
Definition: Functional.hpp:996
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:1004
MatrixBooleanBinaryFunctor< M1, M2 >::ValueType ValueType
Definition: Functional.hpp:995
Functor returning the L1 (maximum absolute column sum) norm of a matrix expression.
Definition: Functional.hpp:1200
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1204
MatrixScalarRealUnaryFunctor< M >::RealType RealType
Definition: Functional.hpp:1203
MatrixScalarRealUnaryFunctor< M >::ValueType ValueType
Definition: Functional.hpp:1202
static ResultType apply(const MatrixExpression< M > &e)
Returns the L1 norm of e.
Definition: Functional.hpp:1211
Functor returning the Frobenius norm of a matrix expression.
Definition: Functional.hpp:1239
static ResultType apply(const MatrixExpression< M > &e)
Returns the Frobenius norm of e.
Definition: Functional.hpp:1250
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1243
MatrixScalarRealUnaryFunctor< M >::RealType RealType
Definition: Functional.hpp:1242
MatrixScalarRealUnaryFunctor< M >::ValueType ValueType
Definition: Functional.hpp:1241
Functor returning the L∞ (maximum absolute row sum) norm of a matrix expression.
Definition: Functional.hpp:1276
static ResultType apply(const MatrixExpression< M > &e)
Returns the L∞ norm of e.
Definition: Functional.hpp:1287
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1280
MatrixScalarRealUnaryFunctor< M >::ValueType ValueType
Definition: Functional.hpp:1278
MatrixScalarRealUnaryFunctor< M >::RealType RealType
Definition: Functional.hpp:1279
Functor returning element (i, j) of the matrix product .
Definition: Functional.hpp:1561
MatrixVectorBinaryFunctor< M1, M2 >::ValueType ValueType
Definition: Functional.hpp:1563
MatrixVectorBinaryFunctor< M1, M2 >::SizeType SizeType
Definition: Functional.hpp:1564
MatrixVectorBinaryFunctor< M1, M2 >::ResultType ResultType
Definition: Functional.hpp:1565
static ResultType apply(const MatrixExpression< E1 > &e1, const MatrixExpression< E2 > &e2, SizeType i, SizeType j)
Returns element (i, j) of the matrix product .
Definition: Functional.hpp:1579
Base class for unary functors that take a matrix expression and return a real-valued scalar (Math::Ma...
Definition: Functional.hpp:1176
M::ValueType ValueType
The matrix's element value type.
Definition: Functional.hpp:1181
RealType ResultType
The real-valued result type.
Definition: Functional.hpp:1191
TypeTraits< ValueType >::RealType RealType
The real-valued type derived from ValueType via Math::TypeTraits.
Definition: Functional.hpp:1186
Base class for unary functors that take a matrix expression and return a scalar result (Math::MatrixE...
Definition: Functional.hpp:1101
M::ValueType ResultType
The scalar result type (the matrix's element value type).
Definition: Functional.hpp:1106
Functor checking element-wise approximate equality of two matrix expressions within an absolute toler...
Definition: Functional.hpp:1060
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:1074
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::ValueType ValueType
Definition: Functional.hpp:1063
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:1065
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::ResultType ResultType
Definition: Functional.hpp:1064
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::SizeType SizeType
Definition: Functional.hpp:1062
Functor returning the trace (sum of diagonal entries) of a matrix expression.
Definition: Functional.hpp:1146
MatrixScalarUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1148
static ResultType apply(const MatrixExpression< M > &e)
Returns the trace of e.
Definition: Functional.hpp:1156
Base class for binary functors that take a matrix expression and a vector expression and return a vec...
Definition: Functional.hpp:1439
ValueType ResultType
The scalar result type (alias for ValueType).
Definition: Functional.hpp:1454
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:1444
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:1449
Functor returning element i of the matrix-vector product .
Definition: Functional.hpp:1464
MatrixVectorBinaryFunctor< M, V >::ValueType ValueType
Definition: Functional.hpp:1466
MatrixVectorBinaryFunctor< M, V >::ResultType ResultType
Definition: Functional.hpp:1468
MatrixVectorBinaryFunctor< M, V >::SizeType SizeType
Definition: Functional.hpp:1467
static ResultType apply(const MatrixExpression< E1 > &e1, const VectorExpression< E2 > &e2, SizeType i)
Returns element i of the matrix-vector product .
Definition: Functional.hpp:1481
Base class for per-component binary functors that take two quaternion expressions and produce a quate...
Definition: Functional.hpp:2299
CommonType< typename Q1::ValueType, typename Q2::ValueType >::Type ResultType
The component result type (common type of the two quaternion element types).
Definition: Functional.hpp:2304
Base class for binary functors that take two quaternion expressions and return a bool result (Math::Q...
Definition: Functional.hpp:1598
CommonType< typename Q1::ValueType, typename Q2::ValueType >::Type ValueType
The component value type (common type of the two quaternion element types).
Definition: Functional.hpp:1608
bool ResultType
The boolean result type.
Definition: Functional.hpp:1603
Per-component functor returning the quaternion conjugate (keeps C1, negates C2/C3/C4).
Definition: Functional.hpp:1886
static ResultType applyC4(const QuaternionExpression< E > &e)
Returns the C4 component of the conjugate (equals -e.getC4()).
Definition: Functional.hpp:1933
static ResultType applyC2(const QuaternionExpression< E > &e)
Returns the C2 component of the conjugate (equals -e.getC2()).
Definition: Functional.hpp:1909
static ResultType applyC3(const QuaternionExpression< E > &e)
Returns the C3 component of the conjugate (equals -e.getC3()).
Definition: Functional.hpp:1921
static ResultType applyC1(const QuaternionExpression< E > &e)
Returns the C1 component of the conjugate (equals e.getC1()).
Definition: Functional.hpp:1897
QuaternionUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1888
Per-component functor returning the quaternion division (n2 is the precomputed squared norm of e_2).
Definition: Functional.hpp:2408
static ResultType applyC3(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, Argument3Type n2)
Returns the C3 component of the quaternion division .
Definition: Functional.hpp:2455
static ResultType applyC1(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, Argument3Type n2)
Returns the C1 component of the quaternion division .
Definition: Functional.hpp:2423
Scalar3QuaternionTernaryFunctor< Q1, Q2, T >::ResultType ResultType
Definition: Functional.hpp:2411
static ResultType applyC4(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, Argument3Type n2)
Returns the C4 component of the quaternion division .
Definition: Functional.hpp:2471
static ResultType applyC2(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2, Argument3Type n2)
Returns the C2 component of the quaternion division .
Definition: Functional.hpp:2439
Scalar3QuaternionTernaryFunctor< Q1, Q2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:2410
Functor returning the sum of the four components of a quaternion expression.
Definition: Functional.hpp:1712
QuaternionScalarUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1714
static ResultType apply(const QuaternionExpression< Q > &e)
Returns the component sum of e.
Definition: Functional.hpp:1721
Functor checking component-wise equality of two quaternion expressions.
Definition: Functional.hpp:1618
static ResultType apply(const QuaternionExpression< Q1 > &e1, const QuaternionExpression< Q2 > &e2)
Tells whether e1 and e2 have equal components.
Definition: Functional.hpp:1629
QuaternionBooleanBinaryFunctor< Q1, Q2 >::ResultType ResultType
Definition: Functional.hpp:1621
QuaternionBooleanBinaryFunctor< Q1, Q2 >::ValueType ValueType
Definition: Functional.hpp:1620
Per-component functor returning the multiplicative inverse of a quaternion expression (n2 is the pre...
Definition: Functional.hpp:2234
static ResultType applyC3(const QuaternionExpression< E > &e, Argument2Type n2)
Returns the C3 component of the multiplicative inverse .
Definition: Functional.hpp:2273
Scalar2QuaternionBinaryFunctor< Q, T >::ResultType ResultType
Definition: Functional.hpp:2237
static ResultType applyC1(const QuaternionExpression< E > &e, Argument2Type n2)
Returns the C1 (real) component of the multiplicative inverse .
Definition: Functional.hpp:2247
Scalar2QuaternionBinaryFunctor< Q, T >::Argument2Type Argument2Type
Definition: Functional.hpp:2236
static ResultType applyC2(const QuaternionExpression< E > &e, Argument2Type n2)
Returns the C2 component of the multiplicative inverse .
Definition: Functional.hpp:2260
static ResultType applyC4(const QuaternionExpression< E > &e, Argument2Type n2)
Returns the C4 component of the multiplicative inverse .
Definition: Functional.hpp:2286
Functor returning the squared norm of a quaternion expression.
Definition: Functional.hpp:1785
QuaternionScalarRealUnaryFunctor< Q >::RealType RealType
Definition: Functional.hpp:1788
static ResultType apply(const QuaternionExpression< Q > &e)
Returns .
Definition: Functional.hpp:1796
QuaternionScalarRealUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1789
QuaternionScalarRealUnaryFunctor< Q >::ValueType ValueType
Definition: Functional.hpp:1787
Functor returning the (Euclidean) norm of a quaternion expression.
Definition: Functional.hpp:1757
QuaternionScalarRealUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1761
static ResultType apply(const QuaternionExpression< Q > &e)
Returns .
Definition: Functional.hpp:1768
QuaternionScalarRealUnaryFunctor< Q >::ValueType ValueType
Definition: Functional.hpp:1759
QuaternionScalarRealUnaryFunctor< Q >::RealType RealType
Definition: Functional.hpp:1760
Per-component functor returning the Hamilton product of two quaternion expressions.
Definition: Functional.hpp:2314
QuaternionBinaryFunctor< Q1, Q2 >::ResultType ResultType
Definition: Functional.hpp:2316
static ResultType applyC3(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
Returns the C3 component of the Hamilton product .
Definition: Functional.hpp:2357
static ResultType applyC2(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
Returns the C2 component of the Hamilton product .
Definition: Functional.hpp:2342
static ResultType applyC4(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
Returns the C4 component of the Hamilton product .
Definition: Functional.hpp:2372
static ResultType applyC1(const QuaternionExpression< E1 > &e1, const QuaternionExpression< E2 > &e2)
Returns the C1 component of the Hamilton product .
Definition: Functional.hpp:2327
Base class for unary functors that take a quaternion expression and return a real-valued scalar (Math...
Definition: Functional.hpp:1733
RealType ResultType
The real-valued result type.
Definition: Functional.hpp:1748
Q::ValueType ValueType
The quaternion's component value type.
Definition: Functional.hpp:1738
ValueType RealType
The real-valued type (alias for ValueType).
Definition: Functional.hpp:1743
Base class for unary functors that take a quaternion expression and return a scalar result (Math::Qua...
Definition: Functional.hpp:1698
Q::ValueType ResultType
The scalar result type (the quaternion's element value type).
Definition: Functional.hpp:1703
Functor checking component-wise approximate equality of two quaternion expressions within an absolute...
Definition: Functional.hpp:1669
Scalar3QuaternionBooleanTernaryFunctor< Q1, Q2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:1673
Scalar3QuaternionBooleanTernaryFunctor< Q1, Q2, T >::ValueType ValueType
Definition: Functional.hpp:1671
Scalar3QuaternionBooleanTernaryFunctor< Q1, Q2, T >::ResultType ResultType
Definition: Functional.hpp:1672
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:1682
Base class for per-component unary functors that take a quaternion expression and produce a quaternio...
Definition: Functional.hpp:1813
Q::ValueType ResultType
The component result type (the quaternion's element value type).
Definition: Functional.hpp:1818
Per-component functor returning the unreal (pure-quaternion) part of a quaternion expression (zeros C...
Definition: Functional.hpp:1827
QuaternionUnaryFunctor< Q >::ResultType ResultType
Definition: Functional.hpp:1829
static ResultType applyC1(const QuaternionExpression< E > &e)
Returns the C1 component of the unreal part (always zero).
Definition: Functional.hpp:1838
static ResultType applyC2(const QuaternionExpression< E > &e)
Returns the C2 component of the unreal part (equals e.getC2()).
Definition: Functional.hpp:1850
static ResultType applyC3(const QuaternionExpression< E > &e)
Returns the C3 component of the unreal part (equals e.getC3()).
Definition: Functional.hpp:1862
static ResultType applyC4(const QuaternionExpression< E > &e)
Returns the C4 component of the unreal part (equals e.getC4()).
Definition: Functional.hpp:1874
Base class for binary functors that take a quaternion expression and a vector expression and return a...
Definition: Functional.hpp:2582
ValueType ResultType
The scalar result type (alias for ValueType).
Definition: Functional.hpp:2597
V::SizeType SizeType
The unsigned size type used by the vector.
Definition: Functional.hpp:2592
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:2587
Functor returning element i of the rotated 3-dimensional vector (quaternion rotation of by ).
Definition: Functional.hpp:2608
QuaternionVectorBinaryFunctor< Q, V >::SizeType SizeType
Definition: Functional.hpp:2611
QuaternionVectorBinaryFunctor< Q, V >::ResultType ResultType
Definition: Functional.hpp:2612
QuaternionVectorBinaryFunctor< Q, V >::ValueType ValueType
Definition: Functional.hpp:2610
static ResultType apply(const QuaternionExpression< E1 > &e1, const VectorExpression< E2 > &e2, SizeType i)
Returns element i ( ) of the rotated 3D vector .
Definition: Functional.hpp:2625
Base class for per-component ternary functors that take a scalar T1 (lhs), a quaternion expression,...
Definition: Functional.hpp:2486
const T1 & Argument1Type
The first (scalar) argument type.
Definition: Functional.hpp:2496
const T2 & Argument3Type
The third (scalar) argument type.
Definition: Functional.hpp:2501
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:2491
Per-component functor returning (scalar t added to the real component of e).
Definition: Functional.hpp:1966
static ResultType applyC4(Argument1Type, const QuaternionExpression< E > &e)
Returns the C4 component of .
Definition: Functional.hpp:2015
static ResultType applyC1(Argument1Type t, const QuaternionExpression< E > &e)
Returns the C1 component of .
Definition: Functional.hpp:1979
Scalar1QuaternionBinaryFunctor< T, Q >::Argument1Type Argument1Type
Definition: Functional.hpp:1968
static ResultType applyC3(Argument1Type, const QuaternionExpression< E > &e)
Returns the C3 component of .
Definition: Functional.hpp:2003
static ResultType applyC2(Argument1Type, const QuaternionExpression< E > &e)
Returns the C2 component of .
Definition: Functional.hpp:1991
Scalar1QuaternionBinaryFunctor< T, Q >::ResultType ResultType
Definition: Functional.hpp:1969
Base class for per-component binary functors that take a scalar T (lhs) and a quaternion expression (...
Definition: Functional.hpp:1946
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:1951
const T & Argument1Type
The first (scalar) argument type.
Definition: Functional.hpp:1956
Per-component functor returning (scalar t with the quaternion e subtracted).
Definition: Functional.hpp:2028
Scalar1QuaternionBinaryFunctor< T, Q >::Argument1Type Argument1Type
Definition: Functional.hpp:2030
Scalar1QuaternionBinaryFunctor< T, Q >::ResultType ResultType
Definition: Functional.hpp:2031
static ResultType applyC2(Argument1Type, const QuaternionExpression< E > &e)
Returns the C2 component of .
Definition: Functional.hpp:2053
static ResultType applyC3(Argument1Type, const QuaternionExpression< E > &e)
Returns the C3 component of .
Definition: Functional.hpp:2065
static ResultType applyC1(Argument1Type t, const QuaternionExpression< E > &e)
Returns the C1 component of .
Definition: Functional.hpp:2041
static ResultType applyC4(Argument1Type, const QuaternionExpression< E > &e)
Returns the C4 component of .
Definition: Functional.hpp:2077
Per-component functor returning (scalar t added to the real component of e).
Definition: Functional.hpp:2110
static ResultType applyC4(const QuaternionExpression< E > &e, Argument2Type)
Returns the C4 component of .
Definition: Functional.hpp:2159
static ResultType applyC3(const QuaternionExpression< E > &e, Argument2Type)
Returns the C3 component of .
Definition: Functional.hpp:2147
Scalar2QuaternionBinaryFunctor< Q, T >::Argument2Type Argument2Type
Definition: Functional.hpp:2112
Scalar2QuaternionBinaryFunctor< Q, T >::ResultType ResultType
Definition: Functional.hpp:2113
static ResultType applyC1(const QuaternionExpression< E > &e, Argument2Type t)
Returns the C1 component of .
Definition: Functional.hpp:2123
static ResultType applyC2(const QuaternionExpression< E > &e, Argument2Type)
Returns the C2 component of .
Definition: Functional.hpp:2135
Base class for per-component binary functors that take a quaternion expression (lhs) and a scalar T (...
Definition: Functional.hpp:2090
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:2095
const T & Argument2Type
The second (scalar) argument type.
Definition: Functional.hpp:2100
Per-component functor returning (scalar t subtracted from the real component of e).
Definition: Functional.hpp:2172
static ResultType applyC2(const QuaternionExpression< E > &e, Argument2Type)
Returns the C2 component of .
Definition: Functional.hpp:2197
static ResultType applyC1(const QuaternionExpression< E > &e, Argument2Type t)
Returns the C1 component of .
Definition: Functional.hpp:2185
static ResultType applyC4(const QuaternionExpression< E > &e, Argument2Type)
Returns the C4 component of .
Definition: Functional.hpp:2221
Scalar2QuaternionBinaryFunctor< Q, T >::ResultType ResultType
Definition: Functional.hpp:2175
static ResultType applyC3(const QuaternionExpression< E > &e, Argument2Type)
Returns the C3 component of .
Definition: Functional.hpp:2209
Scalar2QuaternionBinaryFunctor< Q, T >::Argument2Type Argument2Type
Definition: Functional.hpp:2174
Base class for ternary functors that take two grid expressions plus a tolerance scalar and return a b...
Definition: Functional.hpp:2737
bool ResultType
The boolean result type.
Definition: Functional.hpp:2742
const T & Argument3Type
The third (scalar) argument type.
Definition: Functional.hpp:2747
CommonType< typename G1::ValueType, typename G2::ValueType >::Type ValueType
The element value type (common type of the two grid element types).
Definition: Functional.hpp:2757
CommonType< typename G1::SizeType, typename G2::SizeType >::Type SizeType
The unsigned size type (common type of the two grid size types).
Definition: Functional.hpp:2752
Base class for ternary functors that take two matrix expressions plus a tolerance scalar and return a...
Definition: Functional.hpp:1029
CommonType< typename M1::ValueType, typename M2::ValueType >::Type ValueType
The element value type (common type of the two matrix element types).
Definition: Functional.hpp:1049
CommonType< typename M1::SizeType, typename M2::SizeType >::Type SizeType
The unsigned size type (common type of the two matrix size types).
Definition: Functional.hpp:1044
const T & Argument3Type
The third (scalar) argument type.
Definition: Functional.hpp:1039
bool ResultType
The boolean result type.
Definition: Functional.hpp:1034
Base class for ternary functors that take two quaternion expressions plus a tolerance scalar and retu...
Definition: Functional.hpp:1643
CommonType< typename Q1::ValueType, typename Q2::ValueType >::Type ValueType
The component value type (common type of the two quaternion element types).
Definition: Functional.hpp:1658
const T & Argument3Type
The third (scalar) argument type.
Definition: Functional.hpp:1653
bool ResultType
The boolean result type.
Definition: Functional.hpp:1648
Base class for per-component ternary functors that take two quaternion expressions plus a scalar (Mat...
Definition: Functional.hpp:2387
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:2392
const T & Argument3Type
The third (scalar) argument type.
Definition: Functional.hpp:2397
Base class for ternary functors that take two vectors and a scalar tolerance and return a boolean (Ma...
Definition: Functional.hpp:609
bool ResultType
The boolean result type.
Definition: Functional.hpp:614
const T & Argument3Type
The third (scalar) argument type.
Definition: Functional.hpp:619
CommonType< typename V1::ValueType, typename V2::ValueType >::Type ValueType
The element value type (common type of the two vector element types).
Definition: Functional.hpp:629
CommonType< typename V1::SizeType, typename V2::SizeType >::Type SizeType
The unsigned size type (common type of the two vector size types).
Definition: Functional.hpp:624
Scalar in-place addition functor: apply(t1, t2) performs t1 += t2.
Definition: Functional.hpp:108
static void apply(Argument1Type t1, Argument2Type t2)
Performs t1 += t2.
Definition: Functional.hpp:118
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:111
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:110
Scalar binary addition functor: apply(t1, t2) returns t1 + t2.
Definition: Functional.hpp:373
ScalarBinaryFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:375
static ResultType apply(Argument1Type t1, Argument2Type t2)
Returns t1 + t2.
Definition: Functional.hpp:385
ScalarBinaryFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:376
ScalarBinaryFunctor< T1, T2 >::ResultType ResultType
Definition: Functional.hpp:377
Scalar plain-assignment functor: apply(t1, t2) performs t1 = t2.
Definition: Functional.hpp:85
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:88
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:87
static void apply(Argument1Type t1, Argument2Type t2)
Performs t1 = t2.
Definition: Functional.hpp:95
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:75
T1 Argument1Type
The (modifiable) first argument type.
Definition: Functional.hpp:70
Base class for binary scalar functors of the form F::apply(const T1&, const T2&) returning a Math::Co...
Definition: Functional.hpp:348
const T2 & Argument2Type
The second argument type.
Definition: Functional.hpp:358
const T1 & Argument1Type
The first argument type.
Definition: Functional.hpp:353
CommonType< T1, T2 >::Type ResultType
The result type (common type of T1 and T2).
Definition: Functional.hpp:363
Scalar complex-conjugation functor: apply(v) returns (identity for real types).
Definition: Functional.hpp:250
ScalarUnaryFunctor< T >::ArgumentType ArgumentType
Definition: Functional.hpp:253
static ResultType apply(ArgumentType v)
Returns the complex conjugate of v.
Definition: Functional.hpp:261
ScalarUnaryFunctor< T >::ResultType ResultType
Definition: Functional.hpp:254
ScalarUnaryFunctor< T >::ValueType ValueType
Definition: Functional.hpp:252
Scalar in-place division functor: apply(t1, t2) performs t1 /= t2.
Definition: Functional.hpp:177
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:179
static void apply(Argument1Type t1, Argument2Type t2)
Performs t1 /= t2.
Definition: Functional.hpp:187
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:180
Scalar binary division functor: apply(t1, t2) returns t1 / t2.
Definition: Functional.hpp:448
ScalarBinaryFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:450
static ResultType apply(Argument1Type t1, Argument2Type t2)
Returns t1 / t2.
Definition: Functional.hpp:460
ScalarBinaryFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:451
ScalarBinaryFunctor< T1, T2 >::ResultType ResultType
Definition: Functional.hpp:452
Scalar imaginary-part functor: apply(v) returns (zero for real types).
Definition: Functional.hpp:320
ScalarUnaryFunctor< T >::ResultType ResultType
Definition: Functional.hpp:324
static ResultType apply(ArgumentType v)
Returns the imaginary part of v.
Definition: Functional.hpp:331
ScalarUnaryFunctor< T >::ValueType ValueType
Definition: Functional.hpp:322
ScalarUnaryFunctor< T >::ArgumentType ArgumentType
Definition: Functional.hpp:323
Scalar in-place multiplication functor: apply(t1, t2) performs t1 *= t2.
Definition: Functional.hpp:154
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:156
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:157
static void apply(Argument1Type t1, Argument2Type t2)
Performs t1 *= t2.
Definition: Functional.hpp:164
Scalar binary multiplication functor: apply(t1, t2) returns t1 * t2.
Definition: Functional.hpp:423
ScalarBinaryFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:426
ScalarBinaryFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:425
static ResultType apply(Argument1Type t1, Argument2Type t2)
Returns t1 * t2.
Definition: Functional.hpp:435
ScalarBinaryFunctor< T1, T2 >::ResultType ResultType
Definition: Functional.hpp:427
Scalar negation functor: apply(v) returns -v.
Definition: Functional.hpp:227
ScalarUnaryFunctor< T >::ValueType ValueType
Definition: Functional.hpp:229
ScalarUnaryFunctor< T >::ResultType ResultType
Definition: Functional.hpp:231
static ResultType apply(ArgumentType v)
Returns -v.
Definition: Functional.hpp:238
ScalarUnaryFunctor< T >::ArgumentType ArgumentType
Definition: Functional.hpp:230
Per-component functor returning the scalar/quaternion division (n2 is the precomputed squared norm o...
Definition: Functional.hpp:2512
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:2527
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:2569
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:2541
Scalar13QuaternionTernaryFunctor< T1, Q, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:2514
Scalar13QuaternionTernaryFunctor< T1, Q, T2 >::ResultType ResultType
Definition: Functional.hpp:2516
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:2555
Scalar13QuaternionTernaryFunctor< T1, Q, T2 >::Argument3Type Argument3Type
Definition: Functional.hpp:2515
Base class for unary scalar functors that return the real part of T (Math::ScalarReal,...
Definition: Functional.hpp:273
TypeTraits< T >::RealType ResultType
The real-valued result type derived from ValueType via Math::TypeTraits.
Definition: Functional.hpp:288
const T & ArgumentType
The argument type (a const reference to ValueType).
Definition: Functional.hpp:283
T ValueType
The scalar value type.
Definition: Functional.hpp:278
Scalar real-part functor: apply(v) returns (identity for real types).
Definition: Functional.hpp:297
ScalarUnaryFunctor< T >::ArgumentType ArgumentType
Definition: Functional.hpp:300
ScalarUnaryFunctor< T >::ValueType ValueType
Definition: Functional.hpp:299
static ResultType apply(ArgumentType v)
Returns the real part of v.
Definition: Functional.hpp:308
ScalarUnaryFunctor< T >::ResultType ResultType
Definition: Functional.hpp:301
Scalar in-place subtraction functor: apply(t1, t2) performs t1 -= t2.
Definition: Functional.hpp:131
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:134
static void apply(Argument1Type t1, Argument2Type t2)
Performs t1 -= t2.
Definition: Functional.hpp:141
ScalarBinaryAssignmentFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:133
Scalar binary subtraction functor: apply(t1, t2) returns t1 - t2.
Definition: Functional.hpp:398
ScalarBinaryFunctor< T1, T2 >::ResultType ResultType
Definition: Functional.hpp:402
ScalarBinaryFunctor< T1, T2 >::Argument2Type Argument2Type
Definition: Functional.hpp:401
ScalarBinaryFunctor< T1, T2 >::Argument1Type Argument1Type
Definition: Functional.hpp:400
static ResultType apply(Argument1Type t1, Argument2Type t2)
Returns t1 - t2.
Definition: Functional.hpp:410
static RealType real(ConstReference t)
Returns the real part of t (identical to t for non-complex scalars).
Definition: TypeTraits.hpp:113
static RealType conj(ConstReference t)
Returns the complex conjugate of t (identical to t for non-complex scalars).
Definition: TypeTraits.hpp:132
static RealType normInf(ConstReference t)
Returns the L∞ norm of t (identical to the absolute value for scalar values).
Definition: TypeTraits.hpp:182
static RealType imag(ConstReference)
Returns the imaginary part (always zero for non-complex scalars).
Definition: TypeTraits.hpp:122
static ValueType sqrt(ConstReference t)
Returns the square root of t.
Definition: TypeTraits.hpp:152
static RealType norm2(ConstReference t)
Returns the L2 (Euclidean) norm of t (identical to the absolute value for scalar values).
Definition: TypeTraits.hpp:172
T RealType
The real-valued type (identical to ValueType for scalar traits).
Definition: TypeTraits.hpp:96
Base class for unary scalar functors of the form F::apply(const T&) returning a T result.
Definition: Functional.hpp:203
T ValueType
The scalar value type.
Definition: Functional.hpp:208
const T & ArgumentType
The argument type (a const reference to ValueType).
Definition: Functional.hpp:213
ValueType ResultType
The result type of apply().
Definition: Functional.hpp:218
Primary traits template for scalar arithmetic value types.
Definition: TypeTraits.hpp:307
Functor returning the cosine of the angle between two vectors (optionally clamped to [-1,...
Definition: Functional.hpp:521
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:533
CommonType< typename VectorInnerProduct< V1, V2 >::ResultType, T >::Type ResultType
Definition: Functional.hpp:523
Base class for binary functors that take two vectors and return a vector (Math::VectorCrossProduct).
Definition: Functional.hpp:678
CommonType< typename V1::ValueType, typename V2::ValueType >::Type ResultType
The element result type (common type of the two vector element types).
Definition: Functional.hpp:683
Base class for binary functors that take two vectors and return a boolean (Math::VectorEquality and s...
Definition: Functional.hpp:551
CommonType< typename V1::ValueType, typename V2::ValueType >::Type ValueType
The element value type (common type of the two vector element types).
Definition: Functional.hpp:566
bool ResultType
The boolean result type.
Definition: Functional.hpp:556
CommonType< typename V1::SizeType, typename V2::SizeType >::Type SizeType
The unsigned size type (common type of the two vector size types).
Definition: Functional.hpp:561
Vector cross-product functor: apply(e1, e2, i) returns the i-th component of the 3D vector cross prod...
Definition: Functional.hpp:693
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:709
VectorScalarBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:695
Functor returning the sum of all elements of a vector expression.
Definition: Functional.hpp:756
VectorScalarUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:758
static ResultType apply(const VectorExpression< V > &e)
Returns the sum of all elements of e.
Definition: Functional.hpp:765
Vector equality functor: apply(e1, e2) tests element-wise equality of two vector expressions.
Definition: Functional.hpp:576
VectorBooleanBinaryFunctor< V1, V2 >::ValueType ValueType
Definition: Functional.hpp:579
VectorBooleanBinaryFunctor< V1, V2 >::SizeType SizeType
Definition: Functional.hpp:578
VectorBooleanBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:580
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:588
Vector inner-product functor: apply(e1, e2) returns .
Definition: Functional.hpp:488
VectorScalarBinaryFunctor< V1, V2 >::ResultType ResultType
Definition: Functional.hpp:490
static ResultType apply(const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2)
Returns the inner product of e1 and e2.
Definition: Functional.hpp:499
Functor returning element i of the vector-matrix product .
Definition: Functional.hpp:1500
MatrixVectorBinaryFunctor< M, V >::ResultType ResultType
Definition: Functional.hpp:1504
MatrixVectorBinaryFunctor< M, V >::SizeType SizeType
Definition: Functional.hpp:1503
static ResultType apply(const VectorExpression< E1 > &e1, const MatrixExpression< E2 > &e2, SizeType i)
Returns element i of the vector-matrix product .
Definition: Functional.hpp:1517
MatrixVectorBinaryFunctor< M, V >::ValueType ValueType
Definition: Functional.hpp:1502
Base class for unary functors that produce a matrix element from a vector expression and (i,...
Definition: Functional.hpp:1315
V::ValueType ResultType
The matrix element result type (the vector's element value type).
Definition: Functional.hpp:1320
V::SizeType SizeType
The unsigned size type used by the vector.
Definition: Functional.hpp:1325
Functor returning the L1 norm of a vector expression.
Definition: Functional.hpp:808
static ResultType apply(const VectorExpression< V > &e)
Returns the L1 norm of e.
Definition: Functional.hpp:819
VectorScalarRealUnaryFunctor< V >::RealType RealType
Definition: Functional.hpp:811
VectorScalarRealUnaryFunctor< V >::ValueType ValueType
Definition: Functional.hpp:810
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:812
Functor returning the L2 (Euclidean) norm of a vector expression.
Definition: Functional.hpp:838
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:842
VectorScalarRealUnaryFunctor< V >::RealType RealType
Definition: Functional.hpp:841
static ResultType apply(const VectorExpression< V > &e)
Returns the L2 norm of e.
Definition: Functional.hpp:849
VectorScalarRealUnaryFunctor< V >::ValueType ValueType
Definition: Functional.hpp:840
Functor returning the index of the vector element with the largest L∞ norm.
Definition: Functional.hpp:929
VectorScalarIndexUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:933
VectorScalarIndexUnaryFunctor< V >::ValueType ValueType
Definition: Functional.hpp:931
VectorScalarIndexUnaryFunctor< V >::RealType RealType
Definition: Functional.hpp:932
static ResultType apply(const VectorExpression< V > &e)
Returns the index of the element of e with the largest L∞ norm.
Definition: Functional.hpp:940
Functor returning the L∞ (maximum-magnitude) norm of a vector expression.
Definition: Functional.hpp:871
static ResultType apply(const VectorExpression< V > &e)
Returns the L∞ norm of e.
Definition: Functional.hpp:882
VectorScalarRealUnaryFunctor< V >::ValueType ValueType
Definition: Functional.hpp:873
VectorScalarRealUnaryFunctor< V >::RealType RealType
Definition: Functional.hpp:874
VectorScalarRealUnaryFunctor< V >::ResultType ResultType
Definition: Functional.hpp:875
Base class for binary functors that take two vectors and return a scalar (Math::VectorInnerProduct,...
Definition: Functional.hpp:473
CommonType< typename V1::ValueType, typename V2::ValueType >::Type ResultType
The scalar result type (common type of the two vector element types).
Definition: Functional.hpp:478
Base class for unary functors that take a vector and return a vector-element index (Math::VectorNormI...
Definition: Functional.hpp:905
TypeTraits< ValueType >::RealType RealType
The real-valued type derived from ValueType via Math::TypeTraits.
Definition: Functional.hpp:915
V::ValueType ValueType
The vector's element value type.
Definition: Functional.hpp:910
V::SizeType ResultType
The result type (the vector's size type, used for element indices).
Definition: Functional.hpp:920
Base class for unary functors that take a vector and return a real-valued scalar (Math::VectorNorm1,...
Definition: Functional.hpp:784
RealType ResultType
The real-valued result type.
Definition: Functional.hpp:799
TypeTraits< ValueType >::RealType RealType
The real-valued type derived from ValueType via Math::TypeTraits.
Definition: Functional.hpp:794
V::ValueType ValueType
The vector's element value type.
Definition: Functional.hpp:789
Base class for unary functors that take a vector and return a scalar (Math::VectorElementSum).
Definition: Functional.hpp:737
V::ValueType ResultType
The scalar result type (the vector's element value type).
Definition: Functional.hpp:742
V::SizeType SizeType
The unsigned size type used by the vector.
Definition: Functional.hpp:747
Vector tolerance-equality functor: apply(e1, e2, eps) tests element-wise equality within an absolute ...
Definition: Functional.hpp:640
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::ValueType ValueType
Definition: Functional.hpp:643
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::SizeType SizeType
Definition: Functional.hpp:642
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::Argument3Type Argument3Type
Definition: Functional.hpp:645
Scalar3VectorBooleanTernaryFunctor< V1, V2, T >::ResultType ResultType
Definition: Functional.hpp:644
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:654