interp_utils
jaxns.internals.interp_utils
Module Contents
- left_broadcast_multiply(x, y, axis=0)[source]
Left broadcast multiply of two arrays. Equivalent to right-padding before multiply
- Parameters:
x – […, a,b,c,…]
y – [a, b]
axis (int)
- Returns:
[…, a, b, c, …]
- get_interp_indices_and_weights(x, xp, regular_grid=False)[source]
One-dimensional linear interpolation. Outside bounds is also linear from nearest two points.
- Parameters:
x – the x-coordinates at which to evaluate the interpolated values
xp – the x-coordinates of the data points, must be increasing
regular_grid (bool)
- Returns:
the interpolated values, same shape as x
- Return type:
Tuple[Tuple[Union[int, jax.Array, float, jax.Array]], Tuple[Union[int, jax.Array, float, jax.Array]]]