Skip to main content

DifferentiableBackground

Trait DifferentiableBackground 

Source
pub trait DifferentiableBackground {
    // Required methods
    fn background_id(&self) -> &str;
    fn parameter_names(&self) -> Vec<String>;
    fn coefficients(&self) -> Vec<f64>;
    fn parameter_bounds(&self) -> Vec<ParameterBounds>;
    fn basis(&self, x_deg: &[f64]) -> Result<BackgroundBasis, BackgroundError>;
    fn calculate(&self, x_deg: &[f64]) -> Result<Vec<f64>, BackgroundError>;
    fn replace_coefficients(
        &self,
        coefficients: &[f64],
    ) -> Result<Self, BackgroundError>
       where Self: Sized;
    fn basis_is_invariant(&self) -> bool;
}
Expand description

Shared immutable analytical-background contract.

Required Methods§

Source

fn background_id(&self) -> &str

Stable model identifier.

Source

fn parameter_names(&self) -> Vec<String>

Stable parameter names in coefficient order.

Source

fn coefficients(&self) -> Vec<f64>

Current physical coefficients in derivative-column order.

Source

fn parameter_bounds(&self) -> Vec<ParameterBounds>

Physical parameter bounds in coefficient order.

Source

fn basis(&self, x_deg: &[f64]) -> Result<BackgroundBasis, BackgroundError>

Evaluate sample-by-parameter analytical derivatives.

§Errors

Returns BackgroundError for an invalid grid or allocation overflow.

Source

fn calculate(&self, x_deg: &[f64]) -> Result<Vec<f64>, BackgroundError>

Evaluate the background on an ordered finite grid.

§Errors

Returns BackgroundError for an invalid grid or allocation overflow.

Source

fn replace_coefficients( &self, coefficients: &[f64], ) -> Result<Self, BackgroundError>
where Self: Sized,

Return the same model with replacement coefficients.

§Errors

Returns BackgroundError for shape, finiteness, or model-bound failures.

Source

fn basis_is_invariant(&self) -> bool

Return whether the analytical basis is coefficient-invariant.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§