#[non_exhaustive]pub struct BasisSystem {
pub eval_matrix: Vec<f64>,
pub penalty_matrix: Vec<f64>,
pub nbasis: usize,
pub n_eval: usize,
pub lfd_order: usize,
}Expand description
A basis evaluation matrix bundled with its roughness-penalty (Gram) matrix.
Created by the basis factories (monomial_basis, etc.) — never constructed directly
by callers. The #[non_exhaustive] attribute allows adding new fields (e.g., domain,
basis_type) in future versions without breaking existing code.
§Field layout
eval_matrix: column-major, shape(n_eval × nbasis). Element (t_i, j) is at indexi + j * n_eval.penalty_matrix: column-major, shape(nbasis × nbasis). Element (j, k) is at indexj + k * nbasis.
§Example
use fdars_core::monomial_basis;
let t = vec![0.0, 0.5, 1.0];
let bs = monomial_basis(&t, 3).unwrap();
assert_eq!(bs.nbasis, 3);
assert_eq!(bs.n_eval, 3);
assert_eq!(bs.eval_matrix.len(), 9);
assert_eq!(bs.penalty_matrix.len(), 9);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.eval_matrix: Vec<f64>Column-major evaluation matrix, shape (n_eval × nbasis).
Element (t_i, j) is at index i + j * n_eval.
penalty_matrix: Vec<f64>Column-major roughness-penalty (Gram) matrix, shape (nbasis × nbasis).
R[j,k] = ∫ D^lfd_order B_j(t) · D^lfd_order B_k(t) dt.
Symmetric and positive-semi-definite. Element (j, k) at index j + k * nbasis.
nbasis: usizeNumber of basis functions (nbasis).
n_eval: usizeNumber of evaluation points, i.e. argvals.len().
lfd_order: usizeDerivative order used to compute penalty_matrix (roughness order).
Trait Implementations§
Source§impl Clone for BasisSystem
impl Clone for BasisSystem
Source§fn clone(&self) -> BasisSystem
fn clone(&self) -> BasisSystem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BasisSystem
impl Debug for BasisSystem
Source§impl PartialEq for BasisSystem
impl PartialEq for BasisSystem
impl StructuralPartialEq for BasisSystem
Auto Trait Implementations§
impl Freeze for BasisSystem
impl RefUnwindSafe for BasisSystem
impl Send for BasisSystem
impl Sync for BasisSystem
impl Unpin for BasisSystem
impl UnsafeUnpin for BasisSystem
impl UnwindSafe for BasisSystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.