30namespace Interpolation {
44template <
int order,
typename Kernel>
50 auto const block = detail::ll_and_dist<order>(pos, grid_spacing, offset);
53 std::array<double, order> w_y{};
54 std::array<double, order> w_z{};
55 for (
int i = 0; i <
order; i++) {
60 std::array<int, 3> ind;
61 for (
int i = 0; i <
order; i++) {
62 ind[0] =
block.corner[0] + i;
65 ind[1] =
block.corner[1] +
j;
66 auto const wxy =
wx * w_y[
static_cast<unsigned>(
j)];
67 for (
int k = 0; k <
order; k++) {
68 ind[2] =
block.corner[2] + k;
69 kernel(ind,
wxy * w_z[
static_cast<unsigned>(k)]);
78template <
int order,
typename T,
typename Kernel>
85 [&value, &kernel](std::array<int, 3>
const &ind,
double w) {
86 value += w * kernel(ind);
88 grid_spacing, offset);
Vector implementation and trait types for boost qvm interoperability.
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
static double * block(double *p, std::size_t index, std::size_t size)
void bspline_3d(Vector3d const &pos, Kernel const &kernel, Vector3d const &grid_spacing, Vector3d const &offset)
cardinal B-spline interpolation with internal iteration.
T bspline_3d_accumulate(Vector3d const &pos, Kernel const &kernel, Vector3d const &grid_spacing, Vector3d const &offset, T const &init)
cardinal B-spline weighted sum.
DEVICE_QUALIFIER auto bspline(int i, T x) -> T requires((order > 0) and(order<=7))
Formula of the B-spline.