xspline.bspl¶
- xspline.bspl.cache_bspl(function)[source]¶
Cache implementation for bspline basis functions, to avoid repetitively evaluate functions.
- Parameters:
function (Callable[[tuple, ndarray[tuple[Any, ...], dtype[_ScalarT]]], ndarray[tuple[Any, ...], dtype[_ScalarT]]] | Callable[[tuple, ndarray[tuple[Any, ...], dtype[_ScalarT]], int], ndarray[tuple[Any, ...], dtype[_ScalarT]]]) – Raw value, derivative and definite integral functions.
- Returns:
Cached version of the raw functions.
- Return type:
describe
- xspline.bspl.bspl_val(*args, **kwargs)[source]¶
- Return type:
ndarray[tuple[Any, …], dtype[_ScalarT]]
- xspline.bspl.bspl_der(*args, **kwargs)[source]¶
- Return type:
ndarray[tuple[Any, …], dtype[_ScalarT]]
- xspline.bspl.bspl_int(*args, **kwargs)[source]¶
- Return type:
ndarray[tuple[Any, …], dtype[_ScalarT]]
- xspline.bspl.clear_bspl_cache()[source]¶
Clear all cache of the value, derivative and definite integral for bspline function.
- Return type:
None
- class xspline.bspl.Bspl(params)[source]¶
Bases:
BundleXFunctionBasis spline function.
- Parameters:
params (tuple[tuple[float, ...], int, int]) – This is a tuple that contains knots, degree and index of the basis function.
Example
>>> bspl = Bspl(((0.0, 1.0), 1, 0)) # knots=(0.0, 1.0), degree=2, index=0 >>> bspl([0.0, 1.0]) array([0., 1.]) >>> bspl([0.0, 1.0], order=1) array([1., 1.]) >>> bspl([0.0, 1.0], order=2) array([0., 0.]) >>> bspl([0.0, 1.0], order=-1) array([0. , 0.5])