27 #ifndef CDPL_MATH_MATRIXASSIGNMENT_HPP
28 #define CDPL_MATH_MATRIXASSIGNMENT_HPP
44 class MatrixExpression;
55 template <
template <
typename T1,
typename T2>
class F,
typename M,
typename E>
63 typedef F<typename M::Reference, typename E::ValueType> FunctorType;
65 for (SizeType i = 0; i < size1; i++)
66 for (SizeType j = 0; j < size2; j++)
67 FunctorType::apply(
m(i, j), e()(i, j));
78 template <
template <
typename T1,
typename T2>
class F,
typename M,
typename T>
81 typedef F<typename M::Reference, T> FunctorType;
82 typedef typename M::SizeType SizeType;
84 SizeType size1 =
m.getSize1();
85 SizeType size2 =
m.getSize2();
87 for (SizeType i = 0; i < size1; i++)
88 for (SizeType j = 0; j < size2; j++)
89 FunctorType::apply(
m(i, j), t);
100 template <
typename M,
typename E>
108 for (SizeType i = 0; i < size1; i++)
109 for (SizeType j = 0; j < size2; j++)
110 std::swap(
m(i, j), e()(i, j));
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
Thrown to indicate that the size of a (multidimensional) array is not correct.
Definition: Base/Exceptions.hpp:133
CRTP base class for all matrix expression types.
Definition: Expression.hpp:104
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 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
void matrixAssignScalar(M &m, const T &t)
Applies the element-wise functor F to every (matrix element, scalar) pair, i.e. F::apply(m(i,...
Definition: MatrixAssignment.hpp:79
void matrixAssignMatrix(M &m, const MatrixExpression< E > &e)
Applies the element-wise functor F to every (matrix element, source element) pair,...
Definition: MatrixAssignment.hpp:56
void matrixSwap(M &m, MatrixExpression< E > &e)
Swaps the elements of two equally sized matrix expressions element by element.
Definition: MatrixAssignment.hpp:101
The namespace of the Chemical Data Processing Library.
std::common_type< T1, T2 >::type Type
The common type.
Definition: CommonType.hpp:49