Struct rgsl::types::basis_spline::BSpLineDerivWorkspace
source · pub struct BSpLineDerivWorkspace { /* private fields */ }
Implementations§
source§impl BSpLineDerivWorkspace
impl BSpLineDerivWorkspace
sourcepub fn new(k: usize) -> Option<BSpLineDerivWorkspace>
pub fn new(k: usize) -> Option<BSpLineDerivWorkspace>
This function allocates a workspace for computing the derivatives of a B-spline basis function of order k.
The size of the workspace is O(2k^2).
sourcepub fn eval(
&mut self,
x: f64,
nderiv: usize,
dB: &mut MatrixF64,
w: &mut BSpLineWorkspace
) -> Value
pub fn eval(
&mut self,
x: f64,
nderiv: usize,
dB: &mut MatrixF64,
w: &mut BSpLineWorkspace
) -> Value
This function evaluates all B-spline basis function derivatives of orders 0 through nderiv (inclusive) at the position x and stores them in the matrix dB. The (i,j)-th element of dB is d^jB_i(x)/dx^j. The matrix dB must be of size n = nbreak + k - 2 by nderiv + 1. The value n may also be obtained by calling gsl_bspline_ncoeffs. Note that function evaluations are included as the zeroth order derivatives in dB. Computing all the basis function derivatives at once is more efficient than computing them individually, due to the nature of the defining recurrence relation.
sourcepub fn eval_non_zero(
&mut self,
x: f64,
nderiv: usize,
dB: &mut MatrixF64,
istart: &mut usize,
iend: &mut usize,
w: &mut BSpLineWorkspace
) -> Value
pub fn eval_non_zero(
&mut self,
x: f64,
nderiv: usize,
dB: &mut MatrixF64,
istart: &mut usize,
iend: &mut usize,
w: &mut BSpLineWorkspace
) -> Value
This function evaluates all potentially nonzero B-spline basis function derivatives of orders 0 through nderiv (inclusive) at the position x and stores them in the matrix dB.
The (i,j)-th element of dB is d^j/dx^j B_(istart+i)(x). The last row of dB contains d^j/dx^j B_(iend)(x).
The matrix dB must be of size k by at least nderiv + 1. Note that function evaluations are included as the zeroth order derivatives in dB.
By returning only the nonzero basis functions, this function allows quantities involving linear combinations of the B_i(x) and their derivatives to be computed without unnecessary terms.