Struct varpro::solvers::levmar::FitResult

source ·
pub struct FitResult<Model, const MRHS: bool>{
    pub problem: LevMarProblem<Model, MRHS>,
    pub minimization_report: MinimizationReport<Model::ScalarType>,
}
Expand description

A helper type that contains the fitting problem after the minimization, as well as a report and some convenience functions

Fields§

§problem: LevMarProblem<Model, MRHS>

the final state of the fitting problem after the minimization finished (regardless of whether fitting was successful or not)

§minimization_report: MinimizationReport<Model::ScalarType>

the minimization report of the underlying solver. It contains information about the minimization process and should be queried to see whether the minimization was considered successful

Implementations§

source§

impl<Model> FitResult<Model, true>

source

pub fn linear_coefficients( &self ) -> Option<MatrixView<'_, Model::ScalarType, Dyn, Dyn>>

Note This implementation is for fitting problems with multiple right hand sides.

Convenience function to get the linear coefficients after the fit has finished. Will return None if there was an error during fitting.

The coefficients vectors for the individual members of the datasets are the colums of the returned matrix. That means one coefficient vector for each right hand side.

source

pub fn best_fit(&self) -> Option<OMatrix<Model::ScalarType, Dyn, Dyn>>

Note This implementation is for fitting problems with a single right hand side.

Calculate the values of the model at the best fit parameters. Returns None if there was an error during fitting. Since this is for single right hand sides, the output is a column vector.

source§

impl<Model> FitResult<Model, false>

source

pub fn linear_coefficients( &self ) -> Option<VectorView<'_, Model::ScalarType, Dyn>>

Note This implementation is for fitting problems with a single right hand side.

Convenience function to get the linear coefficients after the fit has finished. Will return None if there was an error during fitting. The coefficients are given as a single vector.

source

pub fn best_fit(&self) -> Option<OVector<Model::ScalarType, Dyn>>

Note This implementation is for fitting problems with multiple right hand sides

Calculate the values of the model at the best fit parameters. Returns None if there was an error during fitting. Since this is for single right hand sides, the output is a matrix containing composed of column vectors for the right hand sides.

source§

impl<Model, const MRHS: bool> FitResult<Model, MRHS>

source

pub fn nonlinear_parameters(&self) -> OVector<Model::ScalarType, Dyn>

convenience function to get the nonlinear parameters of the model after the fitting process has finished.

source

pub fn was_successful(&self) -> bool

whether the fit was deemeed successful. The fit might still be not be optimal for numerical reasons, but the minimization process terminated successfully.

Trait Implementations§

source§

impl<Model, const MRHS: bool> Debug for FitResult<Model, MRHS>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Model, const MRHS: bool> Freeze for FitResult<Model, MRHS>
where <Model as SeparableNonlinearModel>::ScalarType: Sized + Freeze, Model: Freeze,

§

impl<Model, const MRHS: bool> RefUnwindSafe for FitResult<Model, MRHS>

§

impl<Model, const MRHS: bool> Send for FitResult<Model, MRHS>
where <Model as SeparableNonlinearModel>::ScalarType: Sized, Model: Send,

§

impl<Model, const MRHS: bool> Sync for FitResult<Model, MRHS>
where <Model as SeparableNonlinearModel>::ScalarType: Sized, Model: Sync,

§

impl<Model, const MRHS: bool> Unpin for FitResult<Model, MRHS>
where <Model as SeparableNonlinearModel>::ScalarType: Sized + Unpin, Model: Unpin,

§

impl<Model, const MRHS: bool> UnwindSafe for FitResult<Model, MRHS>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.