27namespace Utils::Interpolation::detail {
31 std::array<int, 3> corner;
33 std::array<double, 3> distance;
44 for (
unsigned int dim = 0u; dim < 3u; ++dim) {
45 auto const fractional_index = (pos[dim] - offset[dim]) / grid_spacing[dim];
47 if constexpr (order % 2 == 0) {
48 nmp =
static_cast<int>(std::floor(fractional_index));
49 block.distance[dim] = fractional_index - nmp - 0.5;
51 nmp =
static_cast<int>(std::floor(fractional_index + 0.5));
52 block.distance[dim] = fractional_index - nmp;
54 block.corner[dim] = nmp - (order - 1) / 2;
Vector implementation and trait types for boost qvm interoperability.
static double * block(double *p, std::size_t index, std::size_t size)