27 #ifndef CDPL_MATH_VECTORASSIGNMENT_HPP
28 #define CDPL_MATH_VECTORASSIGNMENT_HPP
44 class VectorExpression;
55 template <
template <
typename T1,
typename T2>
class F,
typename V,
typename E>
62 typedef F<typename V::Reference, typename E::ValueType> FunctorType;
64 for (SizeType i = 0; i < size; i++)
65 FunctorType::apply(v(i), e()(i));
76 template <
template <
typename T1,
typename T2>
class F,
typename V,
typename T>
79 typedef F<typename V::Reference, T> FunctorType;
80 typedef typename V::SizeType SizeType;
82 SizeType size = v.getSize();
84 for (SizeType i = 0; i < size; i++)
85 FunctorType::apply(v(i), t);
96 template <
typename V,
typename E>
103 for (SizeType i = 0; i < size; i++)
104 std::swap(v(i), e()(i));
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 vector expression types.
Definition: Expression.hpp:66
constexpr unsigned int V
Specifies Vanadium.
Definition: AtomType.hpp:177
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
void vectorAssignVector(V &v, const VectorExpression< E > &e)
Applies the element-wise functor F to every (vector element, source element) pair,...
Definition: VectorAssignment.hpp:56
void vectorSwap(V &v, VectorExpression< E > &e)
Swaps the elements of two equally sized vector expressions element by element.
Definition: VectorAssignment.hpp:97
void vectorAssignScalar(V &v, const T &t)
Applies the element-wise functor F to every (vector element, scalar) pair, i.e. F::apply(v(i),...
Definition: VectorAssignment.hpp:77
The namespace of the Chemical Data Processing Library.
std::common_type< T1, T2 >::type Type
The common type.
Definition: CommonType.hpp:49