xnn.common.models.pme.bspline_weights#

xnn.common.models.pme.bspline_weights(t, order)[source]#

Cardinal B-spline weights M_p(t + j) for j from 0 to p - 1.

For a scaled coordinate u with fractional part t = u - floor(u) the charge lands on the grid points floor(u) - j with these weights (paper eq 4.1). Built by the recursion M_n(x) = x / (n - 1) M_{n-1}(x) + (n - x) / (n - 1) M_{n-1}(x - 1) from M_2.

Parameters:
  • t (Tensor) – Fractional offsets in [0, 1), any shape (...).

  • order (int) – The spline order p >= 2.

Returns:

Weights (..., order) summing to one along the last axis.

Return type:

Tensor