Skip to main content

create_basis

Function create_basis 

Source
pub fn create_basis<O: BasisOutputFormat>(
    data: ArrayView1<'_, f64>,
    knot_source: KnotSource<'_>,
    degree: usize,
    options: BasisOptions,
) -> Result<(O::Output, Array1<f64>), BasisError>
Expand description

Unified B-spline basis generation with configurable storage, knot source, and options.

This function consolidates various basis generation functions into a single entry point. Use type parameters to select output format:

  • create_basis::<Dense>(...) for dense Array2<f64> output
  • create_basis::<Sparse>(...) for sparse SparseColMat output

§Arguments

  • data - Data points to evaluate basis at
  • knot_source - Either pre-computed knots or parameters for uniform generation
  • degree - B-spline degree (e.g., 3 for cubic)
  • options - Derivative order and other options

§Returns

Tuple of (basis matrix, knot vector used)