10#include <kernel/lafem/dense_vector.hpp>
11#include <kernel/lafem/power_vector.hpp>
12#include <kernel/lafem/tuple_vector.hpp>
23 template<
typename DataType_,
typename IndexType_>
28 typedef DataType_ DataType;
29 typedef IndexType_ IndexType;
40 static DataType fx00(
Index i)
42 return DataType(0.2) * DataType(i);
45 static DataType fx01(
Index i)
47 return DataType(2) - DataType(i);
50 static DataType fx1(
Index i)
52 return DataType(0.01) *
Math::sqr(DataType(i+1));
55 static DataType fy00(
Index i)
57 return -DataType(3) + DataType(2*i);
60 static DataType fy01(
Index i)
62 return DataType(1) +
Math::sqrt(DataType(i+1));
65 static DataType fy1(
Index i)
67 return DataType(1) + DataType(7) / DataType(i+1);
70 static DataType fz00(
Index i)
75 static DataType fz01(
Index i)
77 return -DataType(5) -
Math::sqrt(DataType(i+1));
80 static DataType fz1(
Index i)
82 return - DataType(7) / DataType(i+1);
95 for(
Index i(0); i < n00; ++i)
97 for(
Index i(0); i < n01; ++i)
99 for(
Index i(0); i < n1; ++i)
105 x.template at<0>().template at<0>().
convert(r00);
106 x.template at<0>().template at<1>().
convert(r01);
107 x.template at<1>().
convert(r1);
121 for(
Index i(0); i < n00; ++i)
123 for(
Index i(0); i < n01; ++i)
125 for(
Index i(0); i < n1; ++i)
132 y.template at<0>().template at<0>().
convert(r00);
133 y.template at<0>().template at<1>().
convert(r01);
134 y.template at<1>().
convert(r1);
148 for(
Index i(0); i < n00; ++i)
150 for(
Index i(0); i < n01; ++i)
152 for(
Index i(0); i < n1; ++i)
158 z.template at<0>().template at<0>().
convert(r00);
159 z.template at<0>().template at<1>().
convert(r01);
160 z.template at<1>().
convert(r1);
168 x.template at<0>().template at<0>() =
ScalarVector(n00, DataType(0));
169 x.template at<0>().template at<1>() =
ScalarVector(n01, DataType(0));
Dense data vector class template.
Power-Vector meta class template.
Variadic TupleVector class template.
void convert(const TupleVector< First2_, Rest2_... > &other)
Conversion method.
String class implementation.
T_ sqrt(T_ x)
Returns the square-root of a value.
T_ sqr(T_ x)
Returns the square of a value.
PreferredBackend
The backend that shall be used in all compute heavy calculations.
std::uint64_t Index
Index data type.