1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use nalgebra::{
storage::{IsContiguous, RawStorageMut, Storage},
ComplexField, Dim, Matrix, Vector,
};
pub trait LeastSquaresProblem<F, M, N>
where
F: ComplexField + Copy,
N: Dim,
M: Dim,
{
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;
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<Matrix<F, M, N, Self::JacobianStorage>>;
}