From 8ac909c93a32c4f80253539d7701fdda750e7774 Mon Sep 17 00:00:00 2001 From: "Brendan K. Krueger" Date: Tue, 1 Oct 2024 11:19:01 -0600 Subject: [PATCH] I was querying the grids in the wrong order, so my indices and weights were all wrong. --- spiner/databox.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spiner/databox.hpp b/spiner/databox.hpp index a298bbfcf..956f576cb 100644 --- a/spiner/databox.hpp +++ b/spiner/databox.hpp @@ -482,7 +482,7 @@ DataBox::interpToReal_alt(const Coords... coords) const noex int indices[N]; weights_t weights[N]; for (std::size_t n = 0; n < N; ++n) { - grids_[n].weights(get_value(n, coords...), indices[n], weights[n]); + grids_[N - 1 - n].weights(get_value(n, coords...), indices[n], weights[n]); } return interpToReal_core( [this](auto ...ii) { return this->dataView_(ii...); }, @@ -496,12 +496,12 @@ PORTABLE_FORCEINLINE_FUNCTION T DataBox::interpToReal_core(Callable && callable, const weights_t * weightlist, const int * indices) const noexcept { - const weights_t & w = weightlist[0]; if constexpr (N == 0) { // base case return callable(); } else { // recursive case + const weights_t & w = weightlist[0]; return w[0] * interpToReal_core( [&c=callable, i=indices[0]](auto ...ii) { return c(i, ii...); }, weightlist + 1,