36 template <
typename Po
int1,
typename Po
int2,
typename Po
int3,
typename Value>
40 -> decltype(
C(std::declval<double>() * std::declval<C>() +
41 std::declval<double>() * std::declval<C>()),
48 -> decltype(
double(std::declval<C>()[0]), std::true_type());
53 std::is_same<std::true_type,
54 decltype(value_type_test<Value>(
nullptr))>
::value and
55 std::is_same<std::true_type,
56 decltype(point_type_test<Point1>(
nullptr))>
::value and
57 std::is_same<std::true_type,
58 decltype(point_type_test<Point2>(
nullptr))>
::value and
59 std::is_same<std::true_type,
60 decltype(point_type_test<Point3>(
nullptr))>
::value;
75 static constexpr
size_t value = 1
u;
97 template <
typename T,
class Point1,
class Point2,
class Point3,
size_t D,
103 template <
typename T,
class Point1,
class Point2,
class Point3,
size_t D,
106 static T run(
const Point1&
pos,
const Point2& lowerLeft,
107 const Point3& upperRight,
const std::array<T, N>& fields) {
109 const double f = (pos[D] - lowerLeft[D]) / (upperRight[D] - lowerLeft[D]);
111 std::array<T, (N >> 1)> newFields;
112 for (
size_t i = 0; i <
N / 2; ++i) {
113 newFields.at(i) = (1 - f) * fields.at(2 * i) + f * fields.at(2 * i + 1);
117 pos, lowerLeft, upperRight, newFields);
122 template <
typename T,
class Po
int1,
class Po
int2,
class Po
int3,
size_t D>
124 static T run(
const Point1& pos,
const Point2& lowerLeft,
125 const Point3& upperRight,
const std::array<T, 2u>& fields) {
127 const double f = (pos[D] - lowerLeft[D]) / (upperRight[D] - lowerLeft[D]);
129 return (1 - f) * fields.at(0) + f * fields.at(1);