27 #ifndef CDPL_MATH_GRIDASSIGNMENT_HPP
28 #define CDPL_MATH_GRIDASSIGNMENT_HPP
45 template <
template <
typename T1,
typename T2>
class F,
typename G,
typename E>
54 typedef F<typename G::Reference, typename E::ValueType> FunctorType;
56 for (SizeType i = 0; i < size1; i++)
57 for (SizeType j = 0; j < size2; j++)
58 for (SizeType k = 0; k < size3; k++)
59 FunctorType::apply(g(i, j, k), e()(i, j, k));
62 template <
template <
typename T1,
typename T2>
class F,
typename G,
typename T>
65 typedef F<typename G::Reference, T> FunctorType;
66 typedef typename G::SizeType SizeType;
68 SizeType size1 = g.getSize1();
69 SizeType size2 = g.getSize2();
70 SizeType size3 = g.getSize3();
72 for (SizeType i = 0; i < size1; i++)
73 for (SizeType j = 0; j < size2; j++)
74 for (SizeType k = 0; k < size3; k++)
75 FunctorType::apply(g(i, j, k), t);
78 template <
typename G,
typename E>
87 for (SizeType i = 0; i < size1; i++)
88 for (SizeType j = 0; j < size2; j++)
89 for (SizeType k = 0; k < size3; k++)
90 std::swap(g(i, j, k), e()(i, j, k));
Definition of exception classes.
Definition of various preprocessor macros for error checking.
#define CDPL_MATH_CHECK_SIZE_EQUALITY(size1, size2, e)
Definition: Check.hpp:62
Thrown to indicate that the size of a (multidimensional) array is not correct.
Definition: Base/Exceptions.hpp:133
Definition: Expression.hpp:120
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 gridAssignScalar(G &g, const T &t)
Definition: GridAssignment.hpp:63
void gridAssignGrid(G &g, const GridExpression< E > &e)
Definition: GridAssignment.hpp:46
void gridSwap(G &g, GridExpression< E > &e)
Definition: GridAssignment.hpp:79
The namespace of the Chemical Data Processing Library.
std::common_type< T1, T2 >::type Type
Definition: CommonType.hpp:43