#include <wls.h>
Public Member Functions | |
WLS (int size=0) | |
void | clear () |
void | add_prior (Precision val) |
template<class B2 > | |
void | add_prior (const Vector< Size, Precision, B2 > &v) |
template<class B2 > | |
void | add_prior (const Matrix< Size, Size, Precision, B2 > &m) |
template<class B2 > | |
void | add_mJ (Precision m, const Vector< Size, Precision, B2 > &J, Precision weight=1) |
template<int N, class B1 , class B2 , class B3 > | |
void | add_mJ (const Vector< N, Precision, B1 > &m, const Matrix< Size, N, Precision, B2 > &J, const Matrix< N, N, Precision, B3 > &invcov) |
void | compute () |
void | operator+= (const WLS &meas) |
Matrix< Size, Size, Precision > & | get_C_inv () |
const Matrix< Size, Size, Precision > & | get_C_inv () const |
Vector< Size, Precision > & | get_mu () |
const Vector< Size, Precision > & | get_mu () const |
Vector< Size, Precision > & | get_vector () |
const Vector< Size, Precision > & | get_vector () const |
Decomposition< Size, Precision > & | get_decomposition () |
const Decomposition< Size, Precision > & | get_decomposition () const |
Size | The number of dimensions in the system | |
Precision | The numerical precision used (double, float etc) | |
Decomposition | The class used to invert the inverse Covariance matrix (must have one integer size and one typename precision template arguments) this is Cholesky by default, but could also be SQSVD |
WLS | ( | int | size = 0 |
) |
Default constructor or construct with the number of dimensions for the Dynamic case.
void clear | ( | ) |
Clear all the measurements and apply a constant regularisation term.
Reimplemented in IRLS< Size, Precision, Reweight >.
Referenced by WLS< Size, Precision >::WLS().
void add_prior | ( | Precision | val | ) |
Applies a constant regularisation term.
Equates to a prior that says all the parameters are zero with .
val | The strength of the prior |
void add_prior | ( | const Vector< Size, Precision, B2 > & | v | ) |
Applies a regularisation term with a different strength for each parameter value.
Equates to a prior that says all the parameters are zero with .
v | The vector of priors |
void add_prior | ( | const Matrix< Size, Size, Precision, B2 > & | m | ) |
Applies a whole-matrix regularisation term.
This is the same as adding the to the inverse covariance matrix.
m | The inverse covariance matrix to add |
void add_mJ | ( | Precision | m, | |
const Vector< Size, Precision, B2 > & | J, | |||
Precision | weight = 1 | |||
) |
Add a single measurement.
m | The value of the measurement | |
J | The Jacobian for the measurement ![]() | |
weight | The inverse variance of the measurement (default = 1) |
void add_mJ | ( | const Vector< N, Precision, B1 > & | m, | |
const Matrix< Size, N, Precision, B2 > & | J, | |||
const Matrix< N, N, Precision, B3 > & | invcov | |||
) |
Add multiple measurements at once (much more efficiently).
m | The measurements to add | |
J | The Jacobian matrix ![]() | |
invcov | The inverse covariance of the measurement values |
void compute | ( | ) |
Process all the measurements and compute the weighted least squares set of parameter values stores the result internally which can then be accessed by calling get_mu().
void operator+= | ( | const WLS< Size, Precision, Decomposition > & | meas | ) |
Matrix<Size,Size,Precision>& get_C_inv | ( | ) |
Returns the inverse covariance matrix.
const Matrix<Size,Size,Precision>& get_C_inv | ( | ) | const |
Returns the inverse covariance matrix.
Vector<Size,Precision>& get_mu | ( | ) |
Returns the update. With no prior, this is the result of .
const Vector<Size,Precision>& get_mu | ( | ) | const |
Returns the update. With no prior, this is the result of .
Vector<Size,Precision>& get_vector | ( | ) |
Returns the vector .
const Vector<Size,Precision>& get_vector | ( | ) | const |
Returns the vector .
Decomposition<Size,Precision>& get_decomposition | ( | ) |
Return the decomposition object used to compute .
const Decomposition<Size,Precision>& get_decomposition | ( | ) | const |
Return the decomposition object used to compute .