Struct rgsl::types::basis_spline::BSpLineWorkspace
[−]
[src]
pub struct BSpLineWorkspace { // some fields omitted }
Methods
impl BSpLineWorkspace
[src]
fn new(k: usize, nbreak: usize) -> Option<BSpLineWorkspace>
This function allocates a workspace for computing B-splines of order k. The number of breakpoints is given by nbreak. This leads to n = nbreak + k - 2 basis functions. Cubic B-splines are specified by k = 4. The size of the workspace is O(5k + nbreak).
fn knots(&self, breakpts: &VectorF64) -> Value
This function computes the knots associated with the given breakpoints and stores them internally in w->knots.
fn knots_uniform(&self, a: f64, b: f64) -> Value
This function assumes uniformly spaced breakpoints on [a,b] and constructs the corresponding knot vector using the previously specified nbreak parameter. The knots are stored in w->knots.
fn eval(&self, x: f64, B: &VectorF64) -> Value
This function evaluates all B-spline basis functions at the position x and stores them in the vector B, so that the i-th element is B_i(x). The vector B must be of length n = nbreak + k - 2. This value may also be obtained by calling gsl_bspline_ncoeffs. Computing all the basis functions at once is more efficient than computing them individually, due to the nature of the defining recurrence relation.
fn eval_non_zero(&self, x: f64, Bk: &VectorF64, istart: &mut usize, iend: &mut usize) -> Value
This function evaluates all potentially nonzero B-spline basis functions at the position x and stores them in the vector Bk, so that the i-th element is B_(istart+i)(x). The last element of Bk is B_(iend)(x). The vector Bk must be of length k. By returning only the nonzero basis functions, this function allows quantities involving linear combinations of the B_i(x) to be computed without unnecessary terms (such linear combinations occur, for example, when evaluating an interpolated function).
fn ncoeffs(&self) -> usize
This function returns the number of B-spline coefficients given by n = nbreak + k - 2.
fn greville_abscissa(&self, i: usize) -> f64
The Greville abscissae are defined to be the mean location of k-1 consecutive knots in the knot vector for each basis spline function of order k. With the first and last knots in the gsl_bspline_workspace knot vector excluded, there are gsl_bspline_ncoeffs Greville abscissae for any given B-spline basis. These values are often used in B-spline collocation applications and may also be called Marsden-Schoenberg points.
Returns the location of the i-th Greville abscissa for the given B-spline basis. For the ill-defined case when k=1, the implementation chooses to return breakpoint interval midpoints.