27 #ifndef CDPL_MATH_MATRIXEXPRESSION_HPP
28 #define CDPL_MATH_MATRIXEXPRESSION_HPP
30 #include <type_traits>
47 class VectorContainer;
49 class MatrixContainer;
56 template <
typename E,
typename F>
61 typedef F FunctorType;
63 typedef typename E::ConstClosureType ExpressionClosureType;
114 return expr.getSize1();
123 return expr.getSize2();
134 return FunctorType::apply(expr(i, j));
138 ExpressionClosureType expr;
146 template <
typename E,
typename F>
166 template <
typename E,
typename F>
171 typedef F FunctorType;
173 typedef typename E::ConstClosureType ExpressionClosureType;
224 return expr.getSize();
233 return expr.getSize();
244 return FunctorType::apply(expr, i, j);
248 ExpressionClosureType expr;
256 template <
typename E,
typename F>
277 template <
typename E1,
typename E2,
typename F>
282 typedef F FunctorType;
283 typedef E1 Expression1Type;
284 typedef E2 Expression2Type;
285 typedef typename E1::ConstClosureType Expression1ClosureType;
286 typedef typename E2::ConstClosureType Expression2ClosureType;
330 expr1(e1), expr2(e2) {}
360 return FunctorType::apply(expr1(i, j), expr2(i, j));
364 Expression1ClosureType expr1;
365 Expression2ClosureType expr2;
374 template <
typename E1,
typename E2,
typename F>
400 template <
typename E1,
typename E2,
typename F>
405 typedef F FunctorType;
406 typedef E1 Expression1Type;
407 typedef E2 Expression2Type;
408 typedef typename E1::ConstClosureType Expression1ClosureType;
409 typedef typename E2::ConstClosureType Expression2ClosureType;
453 expr1(e1), expr2(e2) {}
461 return expr1.getSize1();
470 return expr2.getSize2();
481 return FunctorType::apply(expr1, expr2, i, j);
485 Expression1ClosureType expr1;
486 Expression2ClosureType expr2;
495 template <
typename E1,
typename E2,
typename F>
517 template <
typename E1,
typename E2,
typename F>
522 typedef F FunctorType;
523 typedef E1 Expression1Type;
524 typedef E2 Expression2Type;
525 typedef typename E1::ConstClosureType Expression1ClosureType;
526 typedef typename E2::ConstClosureType Expression2ClosureType;
570 expr1(e1), expr2(e2) {}
578 return expr1.getSize();
587 return expr2.getSize();
598 return FunctorType::apply(expr1(i), expr2(j));
602 Expression1ClosureType expr1;
603 Expression2ClosureType expr2;
612 template <
typename E1,
typename E2,
typename F>
637 template <
typename E1,
typename E2,
typename F>
642 typedef F FunctorType;
643 typedef E1 Expression1Type;
644 typedef E2 Expression2Type;
645 typedef typename E1::ConstClosureType Expression1ClosureType;
646 typedef typename E2::ConstClosureType Expression2ClosureType;
690 expr1(e1), expr2(e2) {}
698 return expr1.getSize1();
708 return FunctorType::apply(expr1, expr2, i);
718 return FunctorType::apply(expr1, expr2, i);
722 Expression1ClosureType expr1;
723 Expression2ClosureType expr2;
732 template <
typename E1,
typename E2,
typename F>
757 template <
typename E1,
typename E2,
typename F>
762 typedef F FunctorType;
763 typedef E1 Expression1Type;
764 typedef E2 Expression2Type;
765 typedef typename E1::ConstClosureType Expression1ClosureType;
766 typedef typename E2::ConstClosureType Expression2ClosureType;
810 expr1(e1), expr2(e2) {}
818 return expr2.getSize2();
828 return FunctorType::apply(expr1, expr2, i);
838 return FunctorType::apply(expr1, expr2, i);
842 Expression1ClosureType expr1;
843 Expression2ClosureType expr2;
852 template <
typename E1,
typename E2,
typename F>
873 template <
typename E1,
typename E2,
typename F>
878 typedef F FunctorType;
879 typedef E1 Expression1Type;
880 typedef E2 Expression2Type;
881 typedef const E1 Expression1ClosureType;
882 typedef typename E2::ConstClosureType Expression2ClosureType;
926 expr1(e1), expr2(e2) {}
934 return expr2.getSize1();
943 return expr2.getSize2();
954 return FunctorType::apply(expr1, expr2(i, j));
958 Expression1ClosureType expr1;
959 Expression2ClosureType expr2;
968 template <
typename E1,
typename E2,
typename F>
989 template <
typename E1,
typename E2,
typename F>
994 typedef F FunctorType;
995 typedef E1 Expression1Type;
996 typedef E2 Expression2Type;
997 typedef typename E1::ConstClosureType Expression1ClosureType;
998 typedef const E2 Expression2ClosureType;
1042 expr1(e1), expr2(e2) {}
1050 return expr1.getSize1();
1059 return expr1.getSize2();
1070 return FunctorType::apply(expr1(i, j), expr2);
1074 Expression1ClosureType expr1;
1075 Expression2ClosureType expr2;
1084 template <
typename E1,
typename E2,
typename F>
1103 template <
typename M>
1138 typedef typename std::conditional<std::is_const<M>::value,
1139 typename M::ConstReference,
1145 typedef typename std::conditional<std::is_const<M>::value,
1146 typename M::ConstClosureType,
1194 return data.getSize2();
1203 return data.getSize1();
1212 return data.getMaxSize();
1221 return (data.getSize1() == 0 || data.getSize2() == 0);
1249 data.operator=(mt.data);
1259 template <
typename M1>
1272 template <
typename E>
1285 template <
typename E>
1298 template <
typename E>
1311 template <
typename T>
1324 template <
typename T>
1337 template <
typename E>
1350 template <
typename E>
1363 template <
typename E>
1397 template <
typename M>
1405 template <
typename M>
1413 template <
typename M>
1421 template <
typename M>
1431 template <
typename E>
1437 return ExpressionType(e());
1446 template <
typename E>
1461 template <
typename E1,
typename E2>
1462 typename MatrixBinary1Traits<E1, E2, ScalarAddition<typename E1::ValueType, typename E2::ValueType> >::ResultType
1468 return ExpressionType(e1(), e2());
1479 template <
typename E1,
typename E2>
1480 typename MatrixBinary1Traits<E1, E2, ScalarSubtraction<typename E1::ValueType, typename E2::ValueType> >::ResultType
1486 return ExpressionType(e1(), e2());
1497 template <
typename E,
typename T>
1498 typename std::enable_if<IsScalar<T>::value,
typename Scalar2MatrixBinaryTraits<E, T, ScalarMultiplication<typename E::ValueType, T> >::ResultType>::type
1504 return ExpressionType(e(), t);
1515 template <
typename T,
typename E>
1516 typename std::enable_if<IsScalar<T>::value,
typename Scalar1MatrixBinaryTraits<T, E, ScalarMultiplication<T, typename E::ValueType> >::ResultType>::type
1522 return ExpressionType(t, e());
1533 template <
typename E,
typename T>
1534 typename std::enable_if<IsScalar<T>::value,
typename Scalar2MatrixBinaryTraits<E, T, ScalarDivision<typename E::ValueType, T> >::ResultType>::type
1540 return ExpressionType(e(), t);
1551 template <
typename E1,
typename E2>
1566 template <
typename E1,
typename E2>
1583 template <
typename E1,
typename E2,
typename T>
1596 template <
typename E>
1597 typename MatrixUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ResultType
1602 return ExpressionType(e());
1611 template <
typename E>
1612 typename MatrixUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ResultType
1617 return ExpressionType(e());
1626 template <
typename E>
1627 typename MatrixUnaryTraits<E, ScalarReal<typename E::ValueType> >::ResultType
1632 return ExpressionType(e());
1641 template <
typename E>
1642 typename MatrixUnaryTraits<E, ScalarImaginary<typename E::ValueType> >::ResultType
1647 return ExpressionType(e());
1658 template <
typename E1,
typename E2>
1659 typename VectorMatrixBinaryTraits<E1, E2, ScalarMultiplication<typename E1::ValueType, typename E2::ValueType> >::ResultType
1665 return ExpressionType(e1(), e2());
1676 template <
typename E1,
typename E2>
1677 typename MatrixBinary1Traits<E1, E2, ScalarDivision<typename E1::ValueType, typename E2::ValueType> >::ResultType
1683 return ExpressionType(e1(), e2());
1694 template <
typename E1,
typename E2>
1695 typename MatrixBinary1Traits<E1, E2, ScalarMultiplication<typename E1::ValueType, typename E2::ValueType> >::ResultType
1701 return ExpressionType(e1(), e2());
1712 template <
typename E1,
typename E2>
1713 typename Matrix1VectorBinaryTraits<E1, E2, MatrixVectorProduct<E1, E2> >::ResultType
1718 return ExpressionType(e1(), e2());
1729 template <
typename E1,
typename E2>
1730 typename Matrix1VectorBinaryTraits<E1, E2, MatrixVectorProduct<E1, E2> >::ResultType
1735 return ExpressionType(e1(), e2());
1748 template <
typename C,
typename E1,
typename E2>
1751 return c().assign(
prod(e1, e2));
1762 template <
typename E1,
typename E2>
1763 typename Matrix2VectorBinaryTraits<E1, E2, VectorMatrixProduct<E1, E2> >::ResultType
1768 return ExpressionType(e1(), e2());
1779 template <
typename E1,
typename E2>
1780 typename Matrix2VectorBinaryTraits<E1, E2, VectorMatrixProduct<E1, E2> >::ResultType
1785 return ExpressionType(e1(), e2());
1798 template <
typename C,
typename E1,
typename E2>
1801 return c().assign(
prod(e1, e2));
1812 template <
typename E1,
typename E2>
1813 typename MatrixBinary2Traits<E1, E2, MatrixProduct<E1, E2> >::ResultType
1818 return ExpressionType(e1(), e2());
1829 template <
typename E1,
typename E2>
1830 typename MatrixBinary2Traits<E1, E2, MatrixProduct<E1, E2> >::ResultType
1835 return ExpressionType(e1(), e2());
1848 template <
typename C,
typename E1,
typename E2>
1851 return c().assign(
prod(e1, e2));
1860 template <
typename E>
1873 template <
typename E>
1886 template <
typename E>
1899 template <
typename E>
1912 template <
typename E>
1913 typename VectorMatrixUnaryTraits<E, DiagonalMatrixFromVector<E> >::ResultType
1918 return ExpressionType(e());
1927 template <
typename E>
1928 typename VectorMatrixUnaryTraits<E, CrossProductMatrixFromVector<E> >::ResultType
1933 return ExpressionType(e());
1942 template <
typename E>
1954 template <
typename E>
1966 template <
typename E>
Definition of exception classes.
Definition of various preprocessor macros for error checking.
#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 basic expression types.
Definition of various functors.
Definition of type traits.
Thrown to indicate that the size of a (multidimensional) array is not correct.
Definition: Base/Exceptions.hpp:133
E ExpressionType
The derived expression type.
Definition: Expression.hpp:49
Expression template node interpreting a binary combination of a matrix expression E1 and a vector exp...
Definition: MatrixExpression.hpp:639
SizeType getSize() const
Returns the wrapped matrix expression's number of rows (number of rows = size of the result vector).
Definition: MatrixExpression.hpp:696
ConstReference operator[](SizeType i) const
Alias for operator() — invokes the functor with the matrix expression, the vector expression,...
Definition: MatrixExpression.hpp:716
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:667
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:652
const ValueType ConstReference
Constant element reference type.
Definition: MatrixExpression.hpp:657
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:672
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
The common signed difference type of the wrapped matrix and vector expressions.
Definition: MatrixExpression.hpp:682
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
The common size type of the wrapped matrix and vector expressions.
Definition: MatrixExpression.hpp:677
const ValueType Reference
Mutable element reference type (degrades to const for expression template results).
Definition: MatrixExpression.hpp:662
Matrix1VectorBinary(const Expression1Type &e1, const Expression2Type &e2)
Constructs the expression template node wrapping the matrix expression e1 and the vector expression e...
Definition: MatrixExpression.hpp:689
ConstReference operator()(SizeType i) const
Invokes the functor with the matrix expression, the vector expression, and the index i to compute ele...
Definition: MatrixExpression.hpp:706
Expression template node interpreting a binary combination of a vector expression E1 and a matrix exp...
Definition: MatrixExpression.hpp:759
ConstReference operator()(SizeType i) const
Invokes the functor with the vector expression, the matrix expression, and the index i to compute ele...
Definition: MatrixExpression.hpp:826
const ValueType ConstReference
Constant element reference type.
Definition: MatrixExpression.hpp:777
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:772
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
The common size type of the wrapped vector and matrix expressions.
Definition: MatrixExpression.hpp:797
ConstReference operator[](SizeType i) const
Alias for operator() — invokes the functor with the vector expression, the matrix expression,...
Definition: MatrixExpression.hpp:836
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
The common signed difference type of the wrapped vector and matrix expressions.
Definition: MatrixExpression.hpp:802
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:792
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:787
const ValueType Reference
Mutable element reference type (degrades to const for expression template results).
Definition: MatrixExpression.hpp:782
Matrix2VectorBinary(const Expression1Type &e1, const Expression2Type &e2)
Constructs the expression template node wrapping the vector expression e1 and the matrix expression e...
Definition: MatrixExpression.hpp:809
SizeType getSize() const
Returns the wrapped matrix expression's number of columns (number of columns = size of the result vec...
Definition: MatrixExpression.hpp:816
Expression template node combining two matrix expressions E1 and E2 element-wise via the binary funct...
Definition: MatrixExpression.hpp:279
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:312
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
The common size type of the two wrapped expressions.
Definition: MatrixExpression.hpp:317
const ValueType Reference
Mutable element reference type (degrades to const for expression template results).
Definition: MatrixExpression.hpp:302
SizeType getSize1() const
Returns the number of rows after verifying that both wrapped expressions agree on it.
Definition: MatrixExpression.hpp:337
SizeType getSize2() const
Returns the number of columns after verifying that both wrapped expressions agree on it.
Definition: MatrixExpression.hpp:347
ConstReference operator()(SizeType i, SizeType j) const
Applies the binary functor element-wise at (i, j) of the two wrapped expressions and returns the resu...
Definition: MatrixExpression.hpp:358
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:307
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
The common signed difference type of the two wrapped expressions.
Definition: MatrixExpression.hpp:322
MatrixBinary1(const Expression1Type &e1, const Expression2Type &e2)
Constructs the expression template node wrapping e1 and e2.
Definition: MatrixExpression.hpp:329
const ValueType ConstReference
Constant element reference type.
Definition: MatrixExpression.hpp:297
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:292
Expression template node combining two matrix expressions E1 and E2 via a binary functor F that is in...
Definition: MatrixExpression.hpp:402
const ValueType ConstReference
Constant element reference type.
Definition: MatrixExpression.hpp:420
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:430
const ValueType Reference
Mutable element reference type (degrades to const for expression template results).
Definition: MatrixExpression.hpp:425
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:435
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
The common signed difference type of the two wrapped expressions.
Definition: MatrixExpression.hpp:445
ConstReference operator()(SizeType i, SizeType j) const
Invokes the functor with both wrapped expressions and the indices (i, j) and returns the result.
Definition: MatrixExpression.hpp:479
MatrixBinary2(const Expression1Type &e1, const Expression2Type &e2)
Constructs the expression template node wrapping e1 and e2.
Definition: MatrixExpression.hpp:452
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:415
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
The common size type of the two wrapped expressions.
Definition: MatrixExpression.hpp:440
SizeType getSize1() const
Returns the first wrapped expression's number of rows (= number of rows of the result).
Definition: MatrixExpression.hpp:459
SizeType getSize2() const
Returns the second wrapped expression's number of columns (= number of columns of the result).
Definition: MatrixExpression.hpp:468
Refinement of Math::MatrixExpression marking the derived type as a concrete (writable) matrix contain...
Definition: Expression.hpp:262
CRTP base class of all matrix expression types.
Definition: Expression.hpp:108
Mutable view adapter that exposes the transpose of a matrix M as a matrix expression ( ).
Definition: MatrixExpression.hpp:1105
std::conditional< std::is_const< M >::value, typename M::ConstClosureType, typename M::ClosureType >::type MatrixClosureType
Closure type used to store the wrapped matrix internally.
Definition: MatrixExpression.hpp:1147
M::ConstReference ConstReference
Constant element reference type.
Definition: MatrixExpression.hpp:1133
SizeType getMaxSize() const
Returns the maximum number of elements the wrapped matrix can hold.
Definition: MatrixExpression.hpp:1210
void swap(MatrixTranspose &mt)
Swaps the underlying matrices of the two transpose views.
Definition: MatrixExpression.hpp:1374
SelfType ClosureType
Closure type used when this proxy appears inside another expression.
Definition: MatrixExpression.hpp:1157
std::enable_if< IsScalar< T >::value, MatrixTranspose >::type & operator/=(const T &t)
Divides every element of the wrapped matrix by the scalar t.
Definition: MatrixExpression.hpp:1325
std::enable_if< IsScalar< T >::value, MatrixTranspose >::type & operator*=(const T &t)
Multiplies every element of the wrapped matrix by the scalar t.
Definition: MatrixExpression.hpp:1312
MatrixTranspose & operator-=(const MatrixExpression< E > &e)
Subtracts the matrix expression e from this transpose view.
Definition: MatrixExpression.hpp:1299
M::ValueType ValueType
The element value type of the wrapped matrix.
Definition: MatrixExpression.hpp:1128
MatrixTranspose(MatrixType &m)
Constructs the transpose view proxy referring to m.
Definition: MatrixExpression.hpp:1163
SizeType getSize1() const
Returns the number of rows of the transpose view (= number of columns of the wrapped matrix).
Definition: MatrixExpression.hpp:1192
M::SizeType SizeType
The size type used by the wrapped matrix.
Definition: MatrixExpression.hpp:1118
std::conditional< std::is_const< M >::value, typename M::ConstReference, typename M::Reference >::type Reference
Mutable element reference type (degrades to ConstReference when the wrapped matrix is const).
Definition: MatrixExpression.hpp:1140
MatrixTranspose & operator=(const MatrixTranspose &mt)
Copy-assigns the wrapped matrix from the contents of mt's wrapped matrix.
Definition: MatrixExpression.hpp:1247
M::DifferenceType DifferenceType
The signed difference type used by the wrapped matrix.
Definition: MatrixExpression.hpp:1123
MatrixTranspose & minusAssign(const MatrixExpression< E > &e)
Subtracts the matrix expression e from this transpose view without intermediate temporary.
Definition: MatrixExpression.hpp:1364
MatrixTranspose & operator=(const MatrixExpression< E > &e)
Assigns the matrix expression e to this transpose view (writes the transpose into the wrapped matrix)...
Definition: MatrixExpression.hpp:1273
MatrixTranspose & operator=(const MatrixTranspose< M1 > &mt)
Assigns the wrapped matrix from mt's wrapped matrix (possibly differing types).
Definition: MatrixExpression.hpp:1260
SizeType getSize2() const
Returns the number of columns of the transpose view (= number of rows of the wrapped matrix).
Definition: MatrixExpression.hpp:1201
ConstReference operator()(SizeType i, SizeType j) const
Returns a const reference to the wrapped matrix's element at (j, i).
Definition: MatrixExpression.hpp:1183
Reference operator()(SizeType i, SizeType j)
Returns a mutable reference to the wrapped matrix's element at (j, i).
Definition: MatrixExpression.hpp:1172
M MatrixType
The wrapped matrix type.
Definition: MatrixExpression.hpp:1113
MatrixTranspose & plusAssign(const MatrixExpression< E > &e)
Adds the matrix expression e to this transpose view without intermediate temporary.
Definition: MatrixExpression.hpp:1351
friend void swap(MatrixTranspose &mt1, MatrixTranspose &mt2)
ADL-enabled free-function form of swap().
Definition: MatrixExpression.hpp:1384
const SelfType ConstClosureType
Constant closure type used when this proxy appears inside another expression.
Definition: MatrixExpression.hpp:1152
MatrixTranspose & operator+=(const MatrixExpression< E > &e)
Adds the matrix expression e to this transpose view.
Definition: MatrixExpression.hpp:1286
bool isEmpty() const
Tells whether the view is empty (the wrapped matrix has zero rows or zero columns).
Definition: MatrixExpression.hpp:1219
MatrixClosureType & getData()
Returns a reference to the wrapped matrix (via its stored closure).
Definition: MatrixExpression.hpp:1228
const MatrixClosureType & getData() const
Returns a const reference to the wrapped matrix (via its stored closure).
Definition: MatrixExpression.hpp:1237
MatrixTranspose & assign(const MatrixExpression< E > &e)
Assigns the matrix expression e to this transpose view without intermediate temporary.
Definition: MatrixExpression.hpp:1338
Expression template node applying a unary functor F element-wise to a matrix expression E.
Definition: MatrixExpression.hpp:58
E::DifferenceType DifferenceType
The signed difference type inherited from the wrapped expression.
Definition: MatrixExpression.hpp:99
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:84
const ValueType ConstReference
Constant element reference type.
Definition: MatrixExpression.hpp:74
const ValueType Reference
Mutable element reference type (degrades to const for expression template results).
Definition: MatrixExpression.hpp:79
MatrixUnary(const ExpressionType &e)
Constructs the expression template node wrapping e.
Definition: MatrixExpression.hpp:105
SizeType getSize2() const
Returns the wrapped expression's number of columns.
Definition: MatrixExpression.hpp:121
SizeType getSize1() const
Returns the wrapped expression's number of rows.
Definition: MatrixExpression.hpp:112
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:69
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:89
E::SizeType SizeType
The size type inherited from the wrapped expression.
Definition: MatrixExpression.hpp:94
ConstReference operator()(SizeType i, SizeType j) const
Applies the unary functor to element (i, j) of the wrapped expression and returns the result.
Definition: MatrixExpression.hpp:132
Expression template node combining a scalar E1 (lhs) and a matrix expression E2 (rhs) element-wise vi...
Definition: MatrixExpression.hpp:875
const ValueType ConstReference
Constant element reference type.
Definition: MatrixExpression.hpp:893
const ValueType Reference
Mutable element reference type (degrades to const for expression template results).
Definition: MatrixExpression.hpp:898
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:908
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:888
SizeType getSize1() const
Returns the wrapped matrix expression's number of rows.
Definition: MatrixExpression.hpp:932
Scalar1MatrixBinary(const Expression1Type &e1, const Expression2Type &e2)
Constructs the expression template node combining the scalar e1 and the matrix expression e2.
Definition: MatrixExpression.hpp:925
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:903
E2::SizeType SizeType
The size type inherited from the wrapped matrix expression.
Definition: MatrixExpression.hpp:913
E2::DifferenceType DifferenceType
The signed difference type inherited from the wrapped matrix expression.
Definition: MatrixExpression.hpp:918
ConstReference operator()(SizeType i, SizeType j) const
Applies the binary functor to the scalar and the element at (i, j) of the wrapped matrix expression a...
Definition: MatrixExpression.hpp:952
SizeType getSize2() const
Returns the wrapped matrix expression's number of columns.
Definition: MatrixExpression.hpp:941
Expression template node combining a matrix expression E1 (lhs) and a scalar E2 (rhs) element-wise vi...
Definition: MatrixExpression.hpp:991
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:1019
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:1024
const ValueType Reference
Mutable element reference type (degrades to const for expression template results).
Definition: MatrixExpression.hpp:1014
Scalar2MatrixBinary(const Expression1Type &e1, const Expression2Type &e2)
Constructs the expression template node combining the matrix expression e1 and the scalar e2.
Definition: MatrixExpression.hpp:1041
E1::SizeType SizeType
The size type inherited from the wrapped matrix expression.
Definition: MatrixExpression.hpp:1029
E1::DifferenceType DifferenceType
The signed difference type inherited from the wrapped matrix expression.
Definition: MatrixExpression.hpp:1034
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:1004
const ValueType ConstReference
Constant element reference type.
Definition: MatrixExpression.hpp:1009
ConstReference operator()(SizeType i, SizeType j) const
Applies the binary functor to the element at (i, j) of the wrapped matrix expression and the scalar a...
Definition: MatrixExpression.hpp:1068
SizeType getSize1() const
Returns the wrapped matrix expression's number of rows.
Definition: MatrixExpression.hpp:1048
SizeType getSize2() const
Returns the wrapped matrix expression's number of columns.
Definition: MatrixExpression.hpp:1057
Refinement of Math::VectorExpression marking the derived type as a concrete (writable) vector contain...
Definition: Expression.hpp:225
CRTP base class of all vector expression types.
Definition: Expression.hpp:68
Expression template node interpreting a binary combination of two vector expressions as a matrix (e....
Definition: MatrixExpression.hpp:519
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:532
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:552
VectorMatrixBinary(const Expression1Type &e1, const Expression2Type &e2)
Constructs the expression template node wrapping e1 and e2.
Definition: MatrixExpression.hpp:569
const ValueType Reference
Mutable element reference type (degrades to const for expression template results).
Definition: MatrixExpression.hpp:542
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
The common signed difference type of the two wrapped vector expressions.
Definition: MatrixExpression.hpp:562
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:547
const ValueType ConstReference
Constant element reference type.
Definition: MatrixExpression.hpp:537
ConstReference operator()(SizeType i, SizeType j) const
Applies the binary functor to e1(i) and e2(j) to produce the matrix element at (i,...
Definition: MatrixExpression.hpp:596
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
The common size type of the two wrapped vector expressions.
Definition: MatrixExpression.hpp:557
SizeType getSize1() const
Returns the first wrapped vector expression's size (number of rows of the resulting matrix view).
Definition: MatrixExpression.hpp:576
SizeType getSize2() const
Returns the second wrapped vector expression's size (number of columns of the resulting matrix view).
Definition: MatrixExpression.hpp:585
Expression template node interpreting a vector expression E as a column matrix via the per-element fu...
Definition: MatrixExpression.hpp:168
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:194
SizeType getSize2() const
Returns the wrapped vector expression's size (used as the number of columns of the resulting matrix v...
Definition: MatrixExpression.hpp:231
E::DifferenceType DifferenceType
The signed difference type inherited from the wrapped vector expression.
Definition: MatrixExpression.hpp:209
ConstReference operator()(SizeType i, SizeType j) const
Applies the functor to the wrapped vector expression and the index pair (i, j) to produce the matrix ...
Definition: MatrixExpression.hpp:242
const ValueType ConstReference
Constant element reference type.
Definition: MatrixExpression.hpp:184
SizeType getSize1() const
Returns the wrapped vector expression's size (used as the number of rows of the resulting matrix view...
Definition: MatrixExpression.hpp:222
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:179
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:199
const ValueType Reference
Mutable element reference type (degrades to const for expression template results).
Definition: MatrixExpression.hpp:189
E::SizeType SizeType
The size type inherited from the wrapped vector expression.
Definition: MatrixExpression.hpp:204
VectorMatrixUnary(const ExpressionType &e)
Constructs the expression template node wrapping the vector expression e.
Definition: MatrixExpression.hpp:215
constexpr unsigned int M
Generic type that covers any element that is a metal.
Definition: AtomType.hpp:657
constexpr unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
constexpr unsigned int F
Specifies Fluorine.
Definition: AtomType.hpp:107
constexpr unsigned int C
Specifies Carbon.
Definition: AtomType.hpp:92
constexpr unsigned int E
Specifies that the stereocenter has E configuration.
Definition: CIPDescriptor.hpp:96
constexpr unsigned int m
Specifies that the stereocenter has m configuration.
Definition: CIPDescriptor.hpp:116
GridBinary1Traits< E1, E2, ScalarMultiplication< typename E1::ValueType, typename E2::ValueType > >::ResultType elemProd(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Returns the element-wise product of the grid expressions e1 and e2 (Hadamard product).
Definition: GridExpression.hpp:802
MatrixTranspose< E > trans(MatrixExpression< E > &e)
Returns a mutable Math::MatrixTranspose view of the matrix expression e.
Definition: MatrixExpression.hpp:1943
MatrixTrace< E >::ResultType trace(const MatrixExpression< E > &e)
Returns the trace (sum of diagonal elements) of the matrix expression e.
Definition: MatrixExpression.hpp:1862
GridUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType herm(const GridExpression< E > &e)
Returns the Hermitian conjugate of the grid expression e (alias of conj() for grids).
Definition: GridExpression.hpp:737
VectorMatrixUnaryTraits< E, CrossProductMatrixFromVector< E > >::ResultType cross(const VectorExpression< E > &e)
Returns the cross-product (skew-symmetric) matrix corresponding to the 3D vector expression e (such t...
Definition: MatrixExpression.hpp:1929
GridUnaryTraits< E, ScalarConjugation< typename E::ValueType > >::ResultType conj(const GridExpression< E > &e)
Returns the element-wise complex conjugate of the grid expression e (identity for real-valued grids).
Definition: GridExpression.hpp:722
VectorMatrixUnaryTraits< E, DiagonalMatrixFromVector< E > >::ResultType diag(const VectorExpression< E > &e)
Returns a diagonal matrix whose diagonal entries are the components of the vector expression e.
Definition: MatrixExpression.hpp:1914
std::enable_if< std::is_arithmetic< T >::value, typename GridToleranceEquality< E1, E2, T >::ResultType >::type equals(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2, const T &eps)
Tells whether the grid expressions e1 and e2 agree element-wise within the absolute tolerance eps.
Definition: GridExpression.hpp:709
std::enable_if< IsScalar< T >::value, typename Scalar2GridBinaryTraits< E, T, ScalarDivision< typename E::ValueType, T > >::ResultType >::type operator/(const GridExpression< E > &e, const T &t)
Returns the element-wise quotient of the grid expression e by the scalar t.
Definition: GridExpression.hpp:659
GridUnaryTraits< E, ScalarReal< typename E::ValueType > >::ResultType real(const GridExpression< E > &e)
Returns the element-wise real part of the grid expression e.
Definition: GridExpression.hpp:752
GridEquality< E1, E2 >::ResultType operator!=(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Tells whether the grid expressions e1 and e2 differ in at least one element.
Definition: GridExpression.hpp:692
GridEquality< E1, E2 >::ResultType operator==(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Tells whether the grid expressions e1 and e2 are element-wise equal.
Definition: GridExpression.hpp:677
std::enable_if< IsScalar< T >::value, typename Scalar2GridBinaryTraits< E, T, ScalarMultiplication< typename E::ValueType, T > >::ResultType >::type operator*(const GridExpression< E > &e, const T &t)
Returns the element-wise product of the grid expression e and the scalar t.
Definition: GridExpression.hpp:623
GridBinary1Traits< E1, E2, ScalarDivision< typename E1::ValueType, typename E2::ValueType > >::ResultType elemDiv(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Returns the element-wise quotient of the grid expressions e1 and e2.
Definition: GridExpression.hpp:784
GridUnaryTraits< E, ScalarImaginary< typename E::ValueType > >::ResultType imag(const GridExpression< E > &e)
Returns the element-wise imaginary part of the grid expression e.
Definition: GridExpression.hpp:767
MatrixNormInfinity< E >::ResultType normInf(const MatrixExpression< E > &e)
Returns the L∞ (maximum absolute row sum) norm of the matrix expression e.
Definition: MatrixExpression.hpp:1901
GridUnaryTraits< E, ScalarNegation< typename E::ValueType > >::ResultType operator-(const GridExpression< E > &e)
Returns the element-wise negation of the grid expression e.
Definition: GridExpression.hpp:557
VectorMatrixBinaryTraits< E1, E2, ScalarMultiplication< typename E1::ValueType, typename E2::ValueType > >::ResultType outerProd(const VectorExpression< E1 > &e1, const VectorExpression< E2 > &e2)
Returns the outer product of the vector expressions e1 and e2 as a matrix expression .
Definition: MatrixExpression.hpp:1660
GridElementSum< E >::ResultType sum(const GridExpression< E > &e)
Returns the sum of all elements of the grid expression e.
Definition: GridExpression.hpp:818
MatrixNorm1< E >::ResultType norm1(const MatrixExpression< E > &e)
Returns the L1 (maximum absolute column sum) norm of the matrix expression e.
Definition: MatrixExpression.hpp:1875
const E & operator+(const GridExpression< E > &e)
Returns the grid expression e unchanged (unary +).
Definition: GridExpression.hpp:572
Matrix1VectorBinaryTraits< E1, E2, MatrixVectorProduct< E1, E2 > >::ResultType prod(const MatrixExpression< E1 > &e1, const VectorExpression< E2 > &e2)
Returns the matrix-vector product as a vector expression (named-function form of operator*).
Definition: MatrixExpression.hpp:1731
MatrixNormFrobenius< E >::ResultType normFrob(const MatrixExpression< E > &e)
Returns the Frobenius norm of the matrix expression e ( ).
Definition: MatrixExpression.hpp:1888
The namespace of the Chemical Data Processing Library.
std::common_type< T1, T2 >::type Type
The common type.
Definition: CommonType.hpp:51
Traits selecting the expression template node and its result type for the Math::Matrix1VectorBinary i...
Definition: MatrixExpression.hpp:734
Matrix1VectorBinary< E1, E2, F > ExpressionType
The expression template node type.
Definition: MatrixExpression.hpp:739
ExpressionType ResultType
The expression template result type returned by free-function operators.
Definition: MatrixExpression.hpp:744
Traits selecting the expression template node and its result type for the Math::Matrix2VectorBinary i...
Definition: MatrixExpression.hpp:854
Matrix2VectorBinary< E1, E2, F > ExpressionType
The expression template node type.
Definition: MatrixExpression.hpp:859
ExpressionType ResultType
The expression template result type returned by free-function operators.
Definition: MatrixExpression.hpp:864
Traits selecting the expression template node and its result type for the Math::MatrixBinary1 instant...
Definition: MatrixExpression.hpp:376
MatrixBinary1< E1, E2, F > ExpressionType
The expression template node type.
Definition: MatrixExpression.hpp:381
ExpressionType ResultType
The expression template result type returned by free-function operators.
Definition: MatrixExpression.hpp:386
Traits selecting the expression template node and its result type for the Math::MatrixBinary2 instant...
Definition: MatrixExpression.hpp:497
ExpressionType ResultType
The expression template result type returned by free-function operators.
Definition: MatrixExpression.hpp:507
MatrixBinary2< E1, E2, F > ExpressionType
The expression template node type.
Definition: MatrixExpression.hpp:502
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
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
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1204
static ResultType apply(const MatrixExpression< M > &e)
Returns the L1 norm of e.
Definition: Functional.hpp:1211
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
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
Selects a concrete temporary matrix type compatible with the matrix expression M.
Definition: TypeTraits.hpp:337
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 >::ResultType ResultType
Definition: Functional.hpp:1064
MatrixScalarUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1148
static ResultType apply(const MatrixExpression< M > &e)
Returns the trace of e.
Definition: Functional.hpp:1156
Traits selecting the expression template node and its result type for the Math::MatrixUnary instantia...
Definition: MatrixExpression.hpp:148
MatrixUnary< E, F > ExpressionType
The expression template node type.
Definition: MatrixExpression.hpp:153
ExpressionType ResultType
The expression template result type returned by free-function operators.
Definition: MatrixExpression.hpp:158
Traits selecting the expression template node and its result type for the Math::Scalar1MatrixBinary i...
Definition: MatrixExpression.hpp:970
ExpressionType ResultType
The expression template result type returned by free-function operators.
Definition: MatrixExpression.hpp:980
Scalar1MatrixBinary< E1, E2, F > ExpressionType
The expression template node type.
Definition: MatrixExpression.hpp:975
Traits selecting the expression template node and its result type for the Math::Scalar2MatrixBinary i...
Definition: MatrixExpression.hpp:1086
ExpressionType ResultType
The expression template result type returned by free-function operators.
Definition: MatrixExpression.hpp:1096
Scalar2MatrixBinary< E1, E2, F > ExpressionType
The expression template node type.
Definition: MatrixExpression.hpp:1091
Scalar binary addition functor: apply(t1, t2) returns t1 + t2.
Definition: Functional.hpp:373
Scalar binary division functor: apply(t1, t2) returns t1 / t2.
Definition: Functional.hpp:448
Scalar binary multiplication functor: apply(t1, t2) returns t1 * t2.
Definition: Functional.hpp:423
Scalar binary subtraction functor: apply(t1, t2) returns t1 - t2.
Definition: Functional.hpp:398
Traits selecting the expression template node and its result type for the Math::VectorMatrixBinary in...
Definition: MatrixExpression.hpp:614
ExpressionType ResultType
The expression template result type returned by free-function operators.
Definition: MatrixExpression.hpp:624
VectorMatrixBinary< E1, E2, F > ExpressionType
The expression template node type.
Definition: MatrixExpression.hpp:619
Traits selecting the expression template node and its result type for the Math::VectorMatrixUnary ins...
Definition: MatrixExpression.hpp:258
VectorMatrixUnary< E, F > ExpressionType
The expression template node type.
Definition: MatrixExpression.hpp:263
ExpressionType ResultType
The expression template result type returned by free-function operators.
Definition: MatrixExpression.hpp:268
Selects a concrete temporary vector type compatible with the vector expression V.
Definition: TypeTraits.hpp:323