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));
95 #endif // CDPL_MATH_GRIDASSIGNMENT_HPP