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);
91 for(
Index i(0); i < n00; ++i)
93 for(
Index i(0); i < n01; ++i)
95 for(
Index i(0); i < n1; ++i)
100 x.template at<0>().template at<0>().
convert(r00);
101 x.template at<0>().template at<1>().
convert(r01);
102 x.template at<1>().
convert(r1);
112 for(
Index i(0); i < n00; ++i)
114 for(
Index i(0); i < n01; ++i)
116 for(
Index i(0); i < n1; ++i)
121 y.template at<0>().template at<0>().
convert(r00);
122 y.template at<0>().template at<1>().
convert(r01);
123 y.template at<1>().
convert(r1);
133 for(
Index i(0); i < n00; ++i)
135 for(
Index i(0); i < n01; ++i)
137 for(
Index i(0); i < n1; ++i)
142 z.template at<0>().template at<0>().
convert(r00);
143 z.template at<0>().template at<1>().
convert(r01);
144 z.template at<1>().
convert(r1);
152 x.template at<0>().template at<0>() =
ScalarVector(n00, DataType(0));
153 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.