pub struct JointResolutionModel { /* private fields */ }Expand description
A sample and its calibrant, sharing one Gaussian resolution.
FitModel::evaluate returns the sample’s predictions followed by the
calibrant’s, so the caller fits against the two spectra concatenated in
that order.
Implementations§
Source§impl JointResolutionModel
impl JointResolutionModel
Sourcepub fn new(
sample: SpectrumSpec,
calibrant: SpectrumSpec,
flight_path_m: f64,
delta_t_sq_index: usize,
delta_l_sq_index: usize,
) -> Result<Self, FittingError>
pub fn new( sample: SpectrumSpec, calibrant: SpectrumSpec, flight_path_m: f64, delta_t_sq_index: usize, delta_l_sq_index: usize, ) -> Result<Self, FittingError>
Build the joint model.
delta_t_sq_index / delta_l_sq_index are the shared slots holding
the squared widths. Everything else about each arm, including whether
its densities and temperature are fitted, is in its
SpectrumSpec — the calibrant’s being known is what makes it a
calibrant.
§Errors
FittingError::InvalidConfig when a spectrum’s grid is empty, when
its density count does not match its isotope count, or when two
parameters share a slot.
Sourcepub fn sample_len(&self) -> usize
pub fn sample_len(&self) -> usize
Number of data points the sample contributes, i.e. where the
calibrant’s predictions start in FitModel::evaluate’s output.
Trait Implementations§
Source§impl FitModel for JointResolutionModel
impl FitModel for JointResolutionModel
Source§fn evaluate(&self, params: &[f64]) -> Result<Vec<f64>, FittingError>
fn evaluate(&self, params: &[f64]) -> Result<Vec<f64>, FittingError>
Source§fn analytical_jacobian(
&self,
_params: &[f64],
_free_param_indices: &[usize],
_y_current: &[f64],
) -> Option<FlatMatrix>
fn analytical_jacobian( &self, _params: &[f64], _free_param_indices: &[usize], _y_current: &[f64], ) -> Option<FlatMatrix>
Auto Trait Implementations§
impl Freeze for JointResolutionModel
impl RefUnwindSafe for JointResolutionModel
impl Send for JointResolutionModel
impl Sync for JointResolutionModel
impl Unpin for JointResolutionModel
impl UnsafeUnpin for JointResolutionModel
impl UnwindSafe for JointResolutionModel
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more