pub trait LeastSquaresProblem<F, M, N>{
type ResidualStorage: RawStorageMut<F, M> + Storage<F, M> + IsContiguous;
type ParameterStorage: RawStorageMut<F, N> + Storage<F, N> + IsContiguous + Clone;
// Required methods
fn set_params(&mut self, x: &Vector<F, N, Self::ParameterStorage>);
fn params(&self) -> Vector<F, N, Self::ParameterStorage>;
fn residuals(&self) -> Option<Vector<F, M, Self::ResidualStorage>>;
fn jacobian(&self) -> Option<SparseJacobian<F>>;
}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 ParameterStorage: RawStorageMut<F, N> + Storage<F, N> + IsContiguous + Clone
Required Methods§
Sourcefn set_params(&mut self, x: &Vector<F, N, Self::ParameterStorage>)
fn set_params(&mut self, x: &Vector<F, N, Self::ParameterStorage>)
Set the stored parameters $\vec{x}$.
Sourcefn params(&self) -> Vector<F, N, Self::ParameterStorage>
fn params(&self) -> Vector<F, N, Self::ParameterStorage>
Get the current parameter vector $\vec{x}$.
Sourcefn residuals(&self) -> Option<Vector<F, M, Self::ResidualStorage>>
fn residuals(&self) -> Option<Vector<F, M, Self::ResidualStorage>>
Compute the residual vector.
Sourcefn jacobian(&self) -> Option<SparseJacobian<F>>
fn jacobian(&self) -> Option<SparseJacobian<F>>
Compute the Jacobian of the residual vector.