Trait varpro::prelude::LeastSquaresProblem
source · pub trait LeastSquaresProblem<F, M, N>{
type ResidualStorage: RawStorageMut<F, M> + Storage<F, M> + IsContiguous;
type JacobianStorage: RawStorageMut<F, M, N> + Storage<F, M, N> + IsContiguous;
type ParameterStorage: RawStorageMut<F, N> + Storage<F, N> + IsContiguous + Clone;
// Required methods
fn set_params(&mut self, x: &Matrix<F, N, Const<1>, Self::ParameterStorage>);
fn params(&self) -> Matrix<F, N, Const<1>, Self::ParameterStorage>;
fn residuals(&self) -> Option<Matrix<F, M, Const<1>, Self::ResidualStorage>>;
fn jacobian(&self) -> Option<Matrix<F, M, N, Self::JacobianStorage>>;
}
Expand description
A least squares minimization problem.
This is what LevenbergMarquardt
needs
to compute the residuals and the Jacobian. See the module documentation
for a usage example.
Required Associated Types§
sourcetype ResidualStorage: RawStorageMut<F, M> + Storage<F, M> + IsContiguous
type ResidualStorage: RawStorageMut<F, M> + Storage<F, M> + IsContiguous
Storage type used for the residuals. Use nalgebra::storage::Owned<F, M>
if you want to use VectorN
or MatrixMN
.
type JacobianStorage: RawStorageMut<F, M, N> + Storage<F, M, N> + IsContiguous
type ParameterStorage: RawStorageMut<F, N> + Storage<F, N> + IsContiguous + Clone
Required Methods§
sourcefn set_params(&mut self, x: &Matrix<F, N, Const<1>, Self::ParameterStorage>)
fn set_params(&mut self, x: &Matrix<F, N, Const<1>, Self::ParameterStorage>)
Set the stored parameters $\vec{x}$
.
sourcefn params(&self) -> Matrix<F, N, Const<1>, Self::ParameterStorage>
fn params(&self) -> Matrix<F, N, Const<1>, Self::ParameterStorage>
Get the current parameter vector $\vec{x}$
.
sourcefn residuals(&self) -> Option<Matrix<F, M, Const<1>, Self::ResidualStorage>>
fn residuals(&self) -> Option<Matrix<F, M, Const<1>, Self::ResidualStorage>>
Compute the residual vector.
sourcefn jacobian(&self) -> Option<Matrix<F, M, N, Self::JacobianStorage>>
fn jacobian(&self) -> Option<Matrix<F, M, N, Self::JacobianStorage>>
Compute the Jacobian of the residual vector.