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;
94 return expr.getSize1();
103 return expr.getSize2();
114 return FunctorType::apply(expr(i, j));
118 ExpressionClosureType expr;
126 template <
typename E,
typename F>
141 template <
typename E,
typename F>
146 typedef F FunctorType;
148 typedef typename E::ConstClosureType ExpressionClosureType;
179 return expr.getSize();
188 return expr.getSize();
199 return FunctorType::apply(expr, i, j);
203 ExpressionClosureType expr;
211 template <
typename E,
typename F>
227 template <
typename E1,
typename E2,
typename F>
232 typedef F FunctorType;
233 typedef E1 Expression1Type;
234 typedef E2 Expression2Type;
235 typedef typename E1::ConstClosureType Expression1ClosureType;
236 typedef typename E2::ConstClosureType Expression2ClosureType;
260 expr1(e1), expr2(e2) {}
290 return FunctorType::apply(expr1(i, j), expr2(i, j));
294 Expression1ClosureType expr1;
295 Expression2ClosureType expr2;
304 template <
typename E1,
typename E2,
typename F>
325 template <
typename E1,
typename E2,
typename F>
330 typedef F FunctorType;
331 typedef E1 Expression1Type;
332 typedef E2 Expression2Type;
333 typedef typename E1::ConstClosureType Expression1ClosureType;
334 typedef typename E2::ConstClosureType Expression2ClosureType;
358 expr1(e1), expr2(e2) {}
366 return expr1.getSize1();
375 return expr2.getSize2();
386 return FunctorType::apply(expr1, expr2, i, j);
390 Expression1ClosureType expr1;
391 Expression2ClosureType expr2;
400 template <
typename E1,
typename E2,
typename F>
417 template <
typename E1,
typename E2,
typename F>
422 typedef F FunctorType;
423 typedef E1 Expression1Type;
424 typedef E2 Expression2Type;
425 typedef typename E1::ConstClosureType Expression1ClosureType;
426 typedef typename E2::ConstClosureType Expression2ClosureType;
450 expr1(e1), expr2(e2) {}
458 return expr1.getSize();
467 return expr2.getSize();
478 return FunctorType::apply(expr1(i), expr2(j));
482 Expression1ClosureType expr1;
483 Expression2ClosureType expr2;
492 template <
typename E1,
typename E2,
typename F>
512 template <
typename E1,
typename E2,
typename F>
517 typedef F FunctorType;
518 typedef E1 Expression1Type;
519 typedef E2 Expression2Type;
520 typedef typename E1::ConstClosureType Expression1ClosureType;
521 typedef typename E2::ConstClosureType Expression2ClosureType;
545 expr1(e1), expr2(e2) {}
553 return expr1.getSize1();
563 return FunctorType::apply(expr1, expr2, i);
573 return FunctorType::apply(expr1, expr2, i);
577 Expression1ClosureType expr1;
578 Expression2ClosureType expr2;
587 template <
typename E1,
typename E2,
typename F>
607 template <
typename E1,
typename E2,
typename F>
612 typedef F FunctorType;
613 typedef E1 Expression1Type;
614 typedef E2 Expression2Type;
615 typedef typename E1::ConstClosureType Expression1ClosureType;
616 typedef typename E2::ConstClosureType Expression2ClosureType;
640 expr1(e1), expr2(e2) {}
648 return expr2.getSize2();
658 return FunctorType::apply(expr1, expr2, i);
668 return FunctorType::apply(expr1, expr2, i);
672 Expression1ClosureType expr1;
673 Expression2ClosureType expr2;
682 template <
typename E1,
typename E2,
typename F>
698 template <
typename E1,
typename E2,
typename F>
703 typedef F FunctorType;
704 typedef E1 Expression1Type;
705 typedef E2 Expression2Type;
706 typedef const E1 Expression1ClosureType;
707 typedef typename E2::ConstClosureType Expression2ClosureType;
731 expr1(e1), expr2(e2) {}
739 return expr2.getSize1();
748 return expr2.getSize2();
759 return FunctorType::apply(expr1, expr2(i, j));
763 Expression1ClosureType expr1;
764 Expression2ClosureType expr2;
773 template <
typename E1,
typename E2,
typename F>
789 template <
typename E1,
typename E2,
typename F>
794 typedef F FunctorType;
795 typedef E1 Expression1Type;
796 typedef E2 Expression2Type;
797 typedef typename E1::ConstClosureType Expression1ClosureType;
798 typedef const E2 Expression2ClosureType;
822 expr1(e1), expr2(e2) {}
830 return expr1.getSize1();
839 return expr1.getSize2();
850 return FunctorType::apply(expr1(i, j), expr2);
854 Expression1ClosureType expr1;
855 Expression2ClosureType expr2;
864 template <
typename E1,
typename E2,
typename F>
878 template <
typename M>
896 typedef typename std::conditional<std::is_const<M>::value,
897 typename M::ConstReference,
900 typedef typename std::conditional<std::is_const<M>::value,
901 typename M::ConstClosureType,
943 return data.getSize2();
952 return data.getSize1();
961 return data.getMaxSize();
970 return (data.getSize1() == 0 || data.getSize2() == 0);
998 data.operator=(mt.data);
1008 template <
typename M1>
1021 template <
typename E>
1034 template <
typename E>
1047 template <
typename E>
1060 template <
typename T>
1073 template <
typename T>
1086 template <
typename E>
1099 template <
typename E>
1112 template <
typename E>
1146 template <
typename M>
1154 template <
typename M>
1162 template <
typename M>
1170 template <
typename M>
1180 template <
typename E>
1186 return ExpressionType(e());
1195 template <
typename E>
1210 template <
typename E1,
typename E2>
1211 typename MatrixBinary1Traits<E1, E2, ScalarAddition<typename E1::ValueType, typename E2::ValueType> >::ResultType
1217 return ExpressionType(e1(), e2());
1228 template <
typename E1,
typename E2>
1229 typename MatrixBinary1Traits<E1, E2, ScalarSubtraction<typename E1::ValueType, typename E2::ValueType> >::ResultType
1235 return ExpressionType(e1(), e2());
1246 template <
typename E,
typename T>
1247 typename std::enable_if<IsScalar<T>::value,
typename Scalar2MatrixBinaryTraits<E, T, ScalarMultiplication<typename E::ValueType, T> >::ResultType>::type
1253 return ExpressionType(e(), t);
1264 template <
typename T,
typename E>
1265 typename std::enable_if<IsScalar<T>::value,
typename Scalar1MatrixBinaryTraits<T, E, ScalarMultiplication<T, typename E::ValueType> >::ResultType>::type
1271 return ExpressionType(t, e());
1282 template <
typename E,
typename T>
1283 typename std::enable_if<IsScalar<T>::value,
typename Scalar2MatrixBinaryTraits<E, T, ScalarDivision<typename E::ValueType, T> >::ResultType>::type
1289 return ExpressionType(e(), t);
1300 template <
typename E1,
typename E2>
1315 template <
typename E1,
typename E2>
1332 template <
typename E1,
typename E2,
typename T>
1345 template <
typename E>
1346 typename MatrixUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ResultType
1351 return ExpressionType(e());
1360 template <
typename E>
1361 typename MatrixUnaryTraits<E, ScalarConjugation<typename E::ValueType> >::ResultType
1366 return ExpressionType(e());
1375 template <
typename E>
1376 typename MatrixUnaryTraits<E, ScalarReal<typename E::ValueType> >::ResultType
1381 return ExpressionType(e());
1390 template <
typename E>
1391 typename MatrixUnaryTraits<E, ScalarImaginary<typename E::ValueType> >::ResultType
1396 return ExpressionType(e());
1407 template <
typename E1,
typename E2>
1408 typename VectorMatrixBinaryTraits<E1, E2, ScalarMultiplication<typename E1::ValueType, typename E2::ValueType> >::ResultType
1414 return ExpressionType(e1(), e2());
1425 template <
typename E1,
typename E2>
1426 typename MatrixBinary1Traits<E1, E2, ScalarDivision<typename E1::ValueType, typename E2::ValueType> >::ResultType
1432 return ExpressionType(e1(), e2());
1443 template <
typename E1,
typename E2>
1444 typename MatrixBinary1Traits<E1, E2, ScalarMultiplication<typename E1::ValueType, typename E2::ValueType> >::ResultType
1450 return ExpressionType(e1(), e2());
1461 template <
typename E1,
typename E2>
1462 typename Matrix1VectorBinaryTraits<E1, E2, MatrixVectorProduct<E1, E2> >::ResultType
1467 return ExpressionType(e1(), e2());
1478 template <
typename E1,
typename E2>
1479 typename Matrix1VectorBinaryTraits<E1, E2, MatrixVectorProduct<E1, E2> >::ResultType
1484 return ExpressionType(e1(), e2());
1497 template <
typename C,
typename E1,
typename E2>
1500 return c().assign(
prod(e1, e2));
1511 template <
typename E1,
typename E2>
1512 typename Matrix2VectorBinaryTraits<E1, E2, VectorMatrixProduct<E1, E2> >::ResultType
1517 return ExpressionType(e1(), e2());
1528 template <
typename E1,
typename E2>
1529 typename Matrix2VectorBinaryTraits<E1, E2, VectorMatrixProduct<E1, E2> >::ResultType
1534 return ExpressionType(e1(), e2());
1547 template <
typename C,
typename E1,
typename E2>
1550 return c().assign(
prod(e1, e2));
1561 template <
typename E1,
typename E2>
1562 typename MatrixBinary2Traits<E1, E2, MatrixProduct<E1, E2> >::ResultType
1567 return ExpressionType(e1(), e2());
1578 template <
typename E1,
typename E2>
1579 typename MatrixBinary2Traits<E1, E2, MatrixProduct<E1, E2> >::ResultType
1584 return ExpressionType(e1(), e2());
1597 template <
typename C,
typename E1,
typename E2>
1600 return c().assign(
prod(e1, e2));
1609 template <
typename E>
1622 template <
typename E>
1635 template <
typename E>
1648 template <
typename E>
1661 template <
typename E>
1662 typename VectorMatrixUnaryTraits<E, DiagonalMatrixFromVector<E> >::ResultType
1667 return ExpressionType(e());
1676 template <
typename E>
1677 typename VectorMatrixUnaryTraits<E, CrossProductMatrixFromVector<E> >::ResultType
1682 return ExpressionType(e());
1691 template <
typename E>
1703 template <
typename E>
1715 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 (made available to expression-template machinery).
Definition: Expression.hpp:47
Expression-template node interpreting a binary combination of a matrix expression E1 and a vector exp...
Definition: MatrixExpression.hpp:514
SizeType getSize() const
Returns the wrapped matrix expression's first-dimension size (number of rows = size of the result vec...
Definition: MatrixExpression.hpp:551
ConstReference operator[](SizeType i) const
Alias for operator() — invokes the functor with the matrix expression, the vector expression,...
Definition: MatrixExpression.hpp:571
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:531
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:525
const ValueType ConstReference
Constant reference type to an element value.
Definition: MatrixExpression.hpp:527
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:533
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
The common signed difference type of the wrapped matrix and vector expressions.
Definition: MatrixExpression.hpp:537
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
The common size type of the wrapped matrix and vector expressions.
Definition: MatrixExpression.hpp:535
const ValueType Reference
Mutable reference type (degrades to const for expression-template results).
Definition: MatrixExpression.hpp:529
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:544
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:561
Expression-template node interpreting a binary combination of a vector expression E1 and a matrix exp...
Definition: MatrixExpression.hpp:609
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:656
const ValueType ConstReference
Constant reference type to an element value.
Definition: MatrixExpression.hpp:622
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:620
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
The common size type of the wrapped vector and matrix expressions.
Definition: MatrixExpression.hpp:630
ConstReference operator[](SizeType i) const
Alias for operator() — invokes the functor with the vector expression, the matrix expression,...
Definition: MatrixExpression.hpp:666
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
The common signed difference type of the wrapped vector and matrix expressions.
Definition: MatrixExpression.hpp:632
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:628
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:626
const ValueType Reference
Mutable reference type (degrades to const for expression-template results).
Definition: MatrixExpression.hpp:624
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:639
SizeType getSize() const
Returns the wrapped matrix expression's second-dimension size (number of columns = size of the result...
Definition: MatrixExpression.hpp:646
Expression-template node combining two matrix expressions E1 and E2 element-wise via the binary funct...
Definition: MatrixExpression.hpp:229
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:248
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
The common size type of the two wrapped expressions.
Definition: MatrixExpression.hpp:250
const ValueType Reference
Mutable reference type (degrades to const for expression-template results).
Definition: MatrixExpression.hpp:244
SizeType getSize1() const
Returns the number of rows after verifying that both wrapped expressions agree on it.
Definition: MatrixExpression.hpp:267
SizeType getSize2() const
Returns the number of columns after verifying that both wrapped expressions agree on it.
Definition: MatrixExpression.hpp:277
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:288
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:246
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
The common signed difference type of the two wrapped expressions.
Definition: MatrixExpression.hpp:252
MatrixBinary1(const Expression1Type &e1, const Expression2Type &e2)
Constructs the expression-template node wrapping e1 and e2.
Definition: MatrixExpression.hpp:259
const ValueType ConstReference
Constant reference type to an element value.
Definition: MatrixExpression.hpp:242
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:240
Expression-template node combining two matrix expressions E1 and E2 via a binary functor F that is in...
Definition: MatrixExpression.hpp:327
const ValueType ConstReference
Constant reference type to an element value.
Definition: MatrixExpression.hpp:340
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:344
const ValueType Reference
Mutable reference type (degrades to const for expression-template results).
Definition: MatrixExpression.hpp:342
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:346
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
The common signed difference type of the two wrapped expressions.
Definition: MatrixExpression.hpp:350
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:384
MatrixBinary2(const Expression1Type &e1, const Expression2Type &e2)
Constructs the expression-template node wrapping e1 and e2.
Definition: MatrixExpression.hpp:357
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:338
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
The common size type of the two wrapped expressions.
Definition: MatrixExpression.hpp:348
SizeType getSize1() const
Returns the first wrapped expression's first-dimension size (number of rows of the result).
Definition: MatrixExpression.hpp:364
SizeType getSize2() const
Returns the second wrapped expression's second-dimension size (number of columns of the result).
Definition: MatrixExpression.hpp:373
Refinement of Math::MatrixExpression marking the derived type as a concrete (writable) matrix contain...
Definition: Expression.hpp:250
CRTP base class for all matrix expression types.
Definition: Expression.hpp:104
Mutable view adapter that exposes the transpose of a matrix M as a matrix expression ( ).
Definition: MatrixExpression.hpp:880
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:902
M::ConstReference ConstReference
Constant reference type to an element.
Definition: MatrixExpression.hpp:894
SizeType getMaxSize() const
Returns the maximum number of elements the wrapped matrix can hold.
Definition: MatrixExpression.hpp:959
void swap(MatrixTranspose &mt)
Swaps the underlying matrices of the two transpose views.
Definition: MatrixExpression.hpp:1123
SelfType ClosureType
Closure type used when this proxy appears inside another expression.
Definition: MatrixExpression.hpp:906
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:1074
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:1061
MatrixTranspose & operator-=(const MatrixExpression< E > &e)
Subtracts the matrix expression e from this transpose view.
Definition: MatrixExpression.hpp:1048
M::ValueType ValueType
The element value type of the wrapped matrix.
Definition: MatrixExpression.hpp:892
MatrixTranspose(MatrixType &m)
Constructs the transpose view proxy referring to m.
Definition: MatrixExpression.hpp:912
SizeType getSize1() const
Returns the number of rows of the transpose view (= number of columns of the wrapped matrix).
Definition: MatrixExpression.hpp:941
M::SizeType SizeType
The size type used by the wrapped matrix.
Definition: MatrixExpression.hpp:888
std::conditional< std::is_const< M >::value, typename M::ConstReference, typename M::Reference >::type Reference
Mutable reference type (degrades to ConstReference when the wrapped matrix is const).
Definition: MatrixExpression.hpp:898
MatrixTranspose & operator=(const MatrixTranspose &mt)
Copy-assigns the wrapped matrix from the contents of mt's wrapped matrix.
Definition: MatrixExpression.hpp:996
M::DifferenceType DifferenceType
The signed difference type used by the wrapped matrix.
Definition: MatrixExpression.hpp:890
MatrixTranspose & minusAssign(const MatrixExpression< E > &e)
Subtracts the matrix expression e from this transpose view without intermediate temporary.
Definition: MatrixExpression.hpp:1113
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:1022
MatrixTranspose & operator=(const MatrixTranspose< M1 > &mt)
Assigns the wrapped matrix from mt's wrapped matrix (possibly differing types).
Definition: MatrixExpression.hpp:1009
SizeType getSize2() const
Returns the number of columns of the transpose view (= number of rows of the wrapped matrix).
Definition: MatrixExpression.hpp:950
ConstReference operator()(SizeType i, SizeType j) const
Returns a const reference to the wrapped matrix's element at (j, i).
Definition: MatrixExpression.hpp:932
Reference operator()(SizeType i, SizeType j)
Returns a mutable reference to the wrapped matrix's element at (j, i).
Definition: MatrixExpression.hpp:921
M MatrixType
The wrapped matrix type.
Definition: MatrixExpression.hpp:886
MatrixTranspose & plusAssign(const MatrixExpression< E > &e)
Adds the matrix expression e to this transpose view without intermediate temporary.
Definition: MatrixExpression.hpp:1100
friend void swap(MatrixTranspose &mt1, MatrixTranspose &mt2)
ADL-enabled free-function form of swap().
Definition: MatrixExpression.hpp:1133
const SelfType ConstClosureType
Constant closure type used when this proxy appears inside another expression.
Definition: MatrixExpression.hpp:904
MatrixTranspose & operator+=(const MatrixExpression< E > &e)
Adds the matrix expression e to this transpose view.
Definition: MatrixExpression.hpp:1035
bool isEmpty() const
Tells whether the view is empty (the wrapped matrix has zero rows or zero columns).
Definition: MatrixExpression.hpp:968
MatrixClosureType & getData()
Returns a reference to the wrapped matrix (via its stored closure).
Definition: MatrixExpression.hpp:977
const MatrixClosureType & getData() const
Returns a const reference to the wrapped matrix (via its stored closure).
Definition: MatrixExpression.hpp:986
MatrixTranspose & assign(const MatrixExpression< E > &e)
Assigns the matrix expression e to this transpose view without intermediate temporary.
Definition: MatrixExpression.hpp:1087
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:79
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:73
const ValueType ConstReference
Constant reference type to an element value.
Definition: MatrixExpression.hpp:69
const ValueType Reference
Mutable reference type (degrades to const for expression-template results).
Definition: MatrixExpression.hpp:71
MatrixUnary(const ExpressionType &e)
Constructs the expression-template node wrapping e.
Definition: MatrixExpression.hpp:85
SizeType getSize2() const
Returns the wrapped expression's second-dimension size.
Definition: MatrixExpression.hpp:101
SizeType getSize1() const
Returns the wrapped expression's first-dimension size.
Definition: MatrixExpression.hpp:92
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:67
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:75
E::SizeType SizeType
The size type inherited from the wrapped expression.
Definition: MatrixExpression.hpp:77
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:112
Expression-template node combining a scalar E1 (lhs) and a matrix expression E2 (rhs) element-wise vi...
Definition: MatrixExpression.hpp:700
const ValueType ConstReference
Constant reference type to an element value.
Definition: MatrixExpression.hpp:713
const ValueType Reference
Mutable reference type (degrades to const for expression-template results).
Definition: MatrixExpression.hpp:715
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:719
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:711
SizeType getSize1() const
Returns the wrapped matrix expression's first-dimension size (number of rows).
Definition: MatrixExpression.hpp:737
Scalar1MatrixBinary(const Expression1Type &e1, const Expression2Type &e2)
Constructs the expression-template node combining the scalar e1 and the matrix expression e2.
Definition: MatrixExpression.hpp:730
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:717
E2::SizeType SizeType
The size type inherited from the wrapped matrix expression.
Definition: MatrixExpression.hpp:721
E2::DifferenceType DifferenceType
The signed difference type inherited from the wrapped matrix expression.
Definition: MatrixExpression.hpp:723
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:757
SizeType getSize2() const
Returns the wrapped matrix expression's second-dimension size (number of columns).
Definition: MatrixExpression.hpp:746
Expression-template node combining a matrix expression E1 (lhs) and a scalar E2 (rhs) element-wise vi...
Definition: MatrixExpression.hpp:791
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:808
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:810
const ValueType Reference
Mutable reference type (degrades to const for expression-template results).
Definition: MatrixExpression.hpp:806
Scalar2MatrixBinary(const Expression1Type &e1, const Expression2Type &e2)
Constructs the expression-template node combining the matrix expression e1 and the scalar e2.
Definition: MatrixExpression.hpp:821
E1::SizeType SizeType
The size type inherited from the wrapped matrix expression.
Definition: MatrixExpression.hpp:812
E1::DifferenceType DifferenceType
The signed difference type inherited from the wrapped matrix expression.
Definition: MatrixExpression.hpp:814
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:802
const ValueType ConstReference
Constant reference type to an element value.
Definition: MatrixExpression.hpp:804
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:848
SizeType getSize1() const
Returns the wrapped matrix expression's first-dimension size (number of rows).
Definition: MatrixExpression.hpp:828
SizeType getSize2() const
Returns the wrapped matrix expression's second-dimension size (number of columns).
Definition: MatrixExpression.hpp:837
Refinement of Math::VectorExpression marking the derived type as a concrete (writable) vector contain...
Definition: Expression.hpp:215
CRTP base class for all vector expression types.
Definition: Expression.hpp:66
Expression-template node interpreting a binary combination of two vector expressions as a matrix (e....
Definition: MatrixExpression.hpp:419
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:430
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:438
VectorMatrixBinary(const Expression1Type &e1, const Expression2Type &e2)
Constructs the expression-template node wrapping e1 and e2.
Definition: MatrixExpression.hpp:449
const ValueType Reference
Mutable reference type (degrades to const for expression-template results).
Definition: MatrixExpression.hpp:434
CommonType< typename E1::DifferenceType, typename E2::DifferenceType >::Type DifferenceType
The common signed difference type of the two wrapped vector expressions.
Definition: MatrixExpression.hpp:442
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:436
const ValueType ConstReference
Constant reference type to an element value.
Definition: MatrixExpression.hpp:432
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:476
CommonType< typename E1::SizeType, typename E2::SizeType >::Type SizeType
The common size type of the two wrapped vector expressions.
Definition: MatrixExpression.hpp:440
SizeType getSize1() const
Returns the first wrapped vector expression's size (number of rows of the resulting matrix view).
Definition: MatrixExpression.hpp:456
SizeType getSize2() const
Returns the second wrapped vector expression's size (number of columns of the resulting matrix view).
Definition: MatrixExpression.hpp:465
Expression-template node interpreting a vector expression E as a column matrix via the per-element fu...
Definition: MatrixExpression.hpp:143
const SelfType ConstClosureType
Constant closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:158
SizeType getSize2() const
Returns the wrapped vector expression's size (used as the number of columns of the resulting matrix v...
Definition: MatrixExpression.hpp:186
E::DifferenceType DifferenceType
The signed difference type inherited from the wrapped vector expression.
Definition: MatrixExpression.hpp:164
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:197
const ValueType ConstReference
Constant reference type to an element value.
Definition: MatrixExpression.hpp:154
SizeType getSize1() const
Returns the wrapped vector expression's size (used as the number of rows of the resulting matrix view...
Definition: MatrixExpression.hpp:177
F::ResultType ValueType
The element value type of the expression (the functor's result type).
Definition: MatrixExpression.hpp:152
SelfType ClosureType
Closure type used when this expression appears inside another expression.
Definition: MatrixExpression.hpp:160
const ValueType Reference
Mutable reference type (degrades to const for expression-template results).
Definition: MatrixExpression.hpp:156
E::SizeType SizeType
The size type inherited from the wrapped vector expression.
Definition: MatrixExpression.hpp:162
VectorMatrixUnary(const ExpressionType &e)
Constructs the expression-template node wrapping the vector expression e.
Definition: MatrixExpression.hpp:170
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:704
MatrixTranspose< E > trans(MatrixExpression< E > &e)
Returns a mutable Math::MatrixTranspose view of the matrix expression e.
Definition: MatrixExpression.hpp:1692
MatrixTrace< E >::ResultType trace(const MatrixExpression< E > &e)
Returns the trace (sum of diagonal elements) of the matrix expression e.
Definition: MatrixExpression.hpp:1611
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:639
VectorMatrixUnaryTraits< E, CrossProductMatrixFromVector< E > >::ResultType cross(const VectorExpression< E > &e)
Returns the cross-product (skew-symmetric) matrix corresponding to the 3-vector expression e (such th...
Definition: MatrixExpression.hpp:1678
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:624
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:1663
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:611
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:561
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:654
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:594
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:579
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:525
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:686
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:669
MatrixNormInfinity< E >::ResultType normInf(const MatrixExpression< E > &e)
Returns the L∞ (maximum absolute row sum) norm of the matrix expression e.
Definition: MatrixExpression.hpp:1650
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:458
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:1409
GridElementSum< E >::ResultType sum(const GridExpression< E > &e)
Returns the sum of all elements of the grid expression e.
Definition: GridExpression.hpp:720
MatrixNorm1< E >::ResultType norm1(const MatrixExpression< E > &e)
Returns the L1 (maximum absolute column sum) norm of the matrix expression e.
Definition: MatrixExpression.hpp:1624
const E & operator+(const GridExpression< E > &e)
Returns the grid expression e unchanged (unary +).
Definition: GridExpression.hpp:474
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:1480
MatrixNormFrobenius< E >::ResultType normFrob(const MatrixExpression< E > &e)
Returns the Frobenius norm of the matrix expression e ( ).
Definition: MatrixExpression.hpp:1637
The namespace of the Chemical Data Processing Library.
std::common_type< T1, T2 >::type Type
The common type.
Definition: CommonType.hpp:49
Traits selecting the expression-template node and its result type for the Math::Matrix1VectorBinary i...
Definition: MatrixExpression.hpp:589
Matrix1VectorBinary< E1, E2, F > ExpressionType
The expression-template node type.
Definition: MatrixExpression.hpp:592
ExpressionType ResultType
The expression-template result type returned by free-function operators.
Definition: MatrixExpression.hpp:594
Traits selecting the expression-template node and its result type for the Math::Matrix2VectorBinary i...
Definition: MatrixExpression.hpp:684
Matrix2VectorBinary< E1, E2, F > ExpressionType
The expression-template node type.
Definition: MatrixExpression.hpp:687
ExpressionType ResultType
The expression-template result type returned by free-function operators.
Definition: MatrixExpression.hpp:689
Traits selecting the expression-template node and its result type for the Math::MatrixBinary1 instant...
Definition: MatrixExpression.hpp:306
MatrixBinary1< E1, E2, F > ExpressionType
The expression-template node type.
Definition: MatrixExpression.hpp:309
ExpressionType ResultType
The expression-template result type returned by free-function operators.
Definition: MatrixExpression.hpp:311
Traits selecting the expression-template node and its result type for the Math::MatrixBinary2 instant...
Definition: MatrixExpression.hpp:402
ExpressionType ResultType
The expression-template result type returned by free-function operators.
Definition: MatrixExpression.hpp:407
MatrixBinary2< E1, E2, F > ExpressionType
The expression-template node type.
Definition: MatrixExpression.hpp:405
MatrixScalarUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1023
static ResultType apply(const MatrixExpression< M > &e)
Returns the element sum of e.
Definition: Functional.hpp:1030
MatrixBooleanBinaryFunctor< M1, M2 >::ResultType ResultType
Definition: Functional.hpp:915
static ResultType apply(const MatrixExpression< M1 > &e1, const MatrixExpression< M2 > &e2)
Tells whether e1 and e2 have the same dimensions and equal element values.
Definition: Functional.hpp:923
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1102
static ResultType apply(const MatrixExpression< M > &e)
Returns the L1 norm of e.
Definition: Functional.hpp:1109
static ResultType apply(const MatrixExpression< M > &e)
Returns the Frobenius norm of e.
Definition: Functional.hpp:1148
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1141
static ResultType apply(const MatrixExpression< M > &e)
Returns the L∞ norm of e.
Definition: Functional.hpp:1185
MatrixScalarRealUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1178
Selects a concrete temporary matrix type compatible with the matrix expression M.
Definition: TypeTraits.hpp:313
static ResultType apply(const MatrixExpression< M1 > &e1, const MatrixExpression< M2 > &e2, Argument3Type epsilon)
Tells whether e1 and e2 agree element-wise within the absolute tolerance epsilon.
Definition: Functional.hpp:982
Scalar3MatrixBooleanTernaryFunctor< M1, M2, T >::ResultType ResultType
Definition: Functional.hpp:972
MatrixScalarUnaryFunctor< M >::ResultType ResultType
Definition: Functional.hpp:1054
static ResultType apply(const MatrixExpression< M > &e)
Returns the trace of e.
Definition: Functional.hpp:1062
Traits selecting the expression-template node and its result type for the Math::MatrixUnary instantia...
Definition: MatrixExpression.hpp:128
MatrixUnary< E, F > ExpressionType
The expression-template node type.
Definition: MatrixExpression.hpp:131
ExpressionType ResultType
The expression-template result type returned by free-function operators.
Definition: MatrixExpression.hpp:133
Traits selecting the expression-template node and its result type for the Math::Scalar1MatrixBinary i...
Definition: MatrixExpression.hpp:775
ExpressionType ResultType
The expression-template result type returned by free-function operators.
Definition: MatrixExpression.hpp:780
Scalar1MatrixBinary< E1, E2, F > ExpressionType
The expression-template node type.
Definition: MatrixExpression.hpp:778
Traits selecting the expression-template node and its result type for the Math::Scalar2MatrixBinary i...
Definition: MatrixExpression.hpp:866
ExpressionType ResultType
The expression-template result type returned by free-function operators.
Definition: MatrixExpression.hpp:871
Scalar2MatrixBinary< E1, E2, F > ExpressionType
The expression-template node type.
Definition: MatrixExpression.hpp:869
Scalar binary addition functor: apply(t1, t2) returns t1 + t2.
Definition: Functional.hpp:344
Scalar binary division functor: apply(t1, t2) returns t1 / t2.
Definition: Functional.hpp:419
Scalar binary multiplication functor: apply(t1, t2) returns t1 * t2.
Definition: Functional.hpp:394
Scalar binary subtraction functor: apply(t1, t2) returns t1 - t2.
Definition: Functional.hpp:369
Traits selecting the expression-template node and its result type for the Math::VectorMatrixBinary in...
Definition: MatrixExpression.hpp:494
ExpressionType ResultType
The expression-template result type returned by free-function operators.
Definition: MatrixExpression.hpp:499
VectorMatrixBinary< E1, E2, F > ExpressionType
The expression-template node type.
Definition: MatrixExpression.hpp:497
Traits selecting the expression-template node and its result type for the Math::VectorMatrixUnary ins...
Definition: MatrixExpression.hpp:213
VectorMatrixUnary< E, F > ExpressionType
The expression-template node type.
Definition: MatrixExpression.hpp:216
ExpressionType ResultType
The expression-template result type returned by free-function operators.
Definition: MatrixExpression.hpp:218
Selects a concrete temporary vector type compatible with the vector expression V.
Definition: TypeTraits.hpp:301