pub struct DeviationRuntime { /* private fields */ }Expand description
Precomputed per-span polynomial coefficient matrices for a structurally monotone anchored deviation basis.
Raw coefficients are monotone I-spline coefficients. The deviation
derivative w'(x) is a nonnegative quadratic B-spline combination, so
w(x) is a cubic I-spline combination with C2 continuity at knots and
constant tails. Zero coefficients still mean the identity map. The fitted
coefficients live in the configured moment-anchor nullspace and are mapped
back to these raw coefficients for monotonicity.
Monotonicity of the full transform x + w(x) is enforced by lower bounds
on each span’s quadratic Bernstein controls for w'(x).
Implementations§
Source§impl DeviationRuntime
impl DeviationRuntime
Sourcepub fn installed_flex_block(&self) -> Option<&InstalledFlexBlock>
pub fn installed_flex_block(&self) -> Option<&InstalledFlexBlock>
Accessor for the installed flex block set via
install_compiled_flex_block. Save-time code uses this to snapshot
the install state into the saved model; predict-time code reconstructs
the per-row η correction n_row · anchor_correction · β.
Sourcepub fn anchor_rows_at_training(&self) -> Option<&Array2<f64>>
pub fn anchor_rows_at_training(&self) -> Option<&Array2<f64>>
Cached parametric-anchor matrix at training rows, installed by
install_compiled_flex_block_into_runtime when the
runtime is reparameterised against the parametric anchor union.
Used by per-row link-deviation evaluators that need the row’s
anchor slice to apply design_with_anchor_rows correctly. Returns
None for runtimes that have not been reparameterised.
Sourcepub fn design_with_anchor_rows(
&self,
values: &Array1<f64>,
anchor_rows: ArrayView2<'_, f64>,
) -> Result<Array2<f64>, String>
pub fn design_with_anchor_rows( &self, values: &Array1<f64>, anchor_rows: ArrayView2<'_, f64>, ) -> Result<Array2<f64>, String>
Evaluate design(values) - anchor_rows · M where anchor_rows is
the n × d parametric-anchor matrix at the same rows as values.
Mandatory when an installed flex block is present; for runtimes
without one this is equivalent to design(values) and anchor_rows
must be n × 0.
pub fn degree(&self) -> usize
pub fn value_span_degree(&self) -> usize
pub fn basis_dim(&self) -> usize
pub fn monotonicity_eps(&self) -> f64
pub fn span_c0(&self) -> &Array2<f64>
pub fn span_c1(&self) -> &Array2<f64>
pub fn span_c2(&self) -> &Array2<f64>
pub fn span_c3(&self) -> &Array2<f64>
Sourcepub fn design(&self, values: &Array1<f64>) -> Result<Array2<f64>, String>
pub fn design(&self, values: &Array1<f64>) -> Result<Array2<f64>, String>
Pure-span design (no anchor-residual subtraction). Callers must
ensure the runtime has no anchor residual; otherwise use
design_with_anchor_rows. Derivative paths are unaffected: the
residual subtraction n_row · M is constant in the candidate
argument, so its derivatives are identically zero.
pub fn first_derivative_design( &self, values: &Array1<f64>, ) -> Result<Array2<f64>, String>
pub fn second_derivative_design( &self, values: &Array1<f64>, ) -> Result<Array2<f64>, String>
pub fn third_derivative_design( &self, values: &Array1<f64>, ) -> Result<Array2<f64>, String>
pub fn breakpoints(&self) -> &Array1<f64>
pub fn basis_span_cubic( &self, span_idx: usize, basis_idx: usize, ) -> Result<LocalSpanCubic, String>
Sourcepub fn basis_cubic_at(
&self,
basis_idx: usize,
value: f64,
) -> Result<LocalSpanCubic, String>
pub fn basis_cubic_at( &self, basis_idx: usize, value: f64, ) -> Result<LocalSpanCubic, String>
Return the correct per-basis LocalSpanCubic for any evaluation
point. Strictly outside the knot support, returns a constant cubic
(c1=c2=c3=0) at the saturated tail value. Interior breakpoints use the
left span so span-local third derivatives match derivative designs.
pub fn for_each_basis_cubic_at<F>( &self, value: f64, visit: F, ) -> Result<(), String>
Trait Implementations§
Source§impl Clone for DeviationRuntime
impl Clone for DeviationRuntime
Source§fn clone(&self) -> DeviationRuntime
fn clone(&self) -> DeviationRuntime
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DeviationRuntime
impl RefUnwindSafe for DeviationRuntime
impl Send for DeviationRuntime
impl Sync for DeviationRuntime
impl Unpin for DeviationRuntime
impl UnsafeUnpin for DeviationRuntime
impl UnwindSafe for DeviationRuntime
Blanket Implementations§
impl<T> Allocation for T
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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,
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.