TooN::WLSCholesky< Size > Class Template Reference

#include <wls_cholesky.h>

List of all members.

Public Member Functions

 WLSCholesky ()
 Default constructor.
 WLSCholesky (double prior)
 Construct using a given regularisation prior.
 WLSCholesky (const WLSCholesky &w)
void clear (double prior=0)
void add_prior (double val)
template<class Accessor>
void add_prior (double val, const FixedVector< Size, Accessor > &pos)
template<class Accessor>
void add_prior (const FixedVector< Size, Accessor > &v)
template<class Accessor>
void add_prior (const FixedMatrix< Size, Size, Accessor > &m)
template<class Accessor>
void add_df (double m, const FixedVector< Size, Accessor > &J, double weight=1)
template<int N, class Accessor1, class Accessor2, class Accessor3>
void add_df (const FixedVector< N, Accessor1 > &m, const FixedMatrix< Size, N, Accessor2 > &J, const FixedMatrix< N, N, Accessor3 > &invcov)
void compute ()
void operator+= (const WLSCholesky &meas)
void operator= (const WLSCholesky &w)
Matrix< Size, Size,
RowMajor > & 
get_C_inv ()
 Returns the inverse covariance matrix.
const Matrix< Size,
Size, RowMajor > & 
get_C_inv () const
 Returns the inverse covariance matrix.
Vector< Size > & get_mu ()
const Vector< Size > & get_mu () const
Vector< Size > & get_vector ()
const Vector< Size > & get_vector () const
double get_residual ()
void add_extra (double e)
double get_extra ()
 WLSCholesky ()
 Default constructor.
 WLSCholesky (double prior)
 Construct using a given regularisation prior.
 WLSCholesky (const WLSCholesky &w)
void clear (double prior=0)
void add_prior (double val)
template<class Accessor>
void add_prior (double val, const FixedVector< Size, Accessor > &pos)
template<class Accessor>
void add_prior (const FixedVector< Size, Accessor > &v)
template<class Accessor>
void add_prior (const FixedMatrix< Size, Size, Accessor > &m)
template<class Accessor>
void add_df (double m, const FixedVector< Size, Accessor > &J, double weight=1)
template<int N, class Accessor1, class Accessor2, class Accessor3>
void add_df (const FixedVector< N, Accessor1 > &m, const FixedMatrix< Size, N, Accessor2 > &J, const FixedMatrix< N, N, Accessor3 > &invcov)
void compute ()
void operator+= (const WLSCholesky &meas)
void operator= (const WLSCholesky &w)
Matrix< Size, Size,
RowMajor > & 
get_C_inv ()
 Returns the inverse covariance matrix.
const Matrix< Size,
Size, RowMajor > & 
get_C_inv () const
 Returns the inverse covariance matrix.
Vector< Size > & get_mu ()
const Vector< Size > & get_mu () const
Vector< Size > & get_vector ()
const Vector< Size > & get_vector () const
double get_residual ()
void add_extra (double e)
double get_extra ()


Detailed Description

template<int Size = -1>
class TooN::WLSCholesky< Size >

Performs weighted least squares using Cholesky decomposition and sparse JtJ. Much faster (but less robust) than the standard WLS. Also stores the sum squares error and can compute the residual.
Parameters:
The number of parameters in the system

Definition at line 39 of file wls_cholesky.h.


Constructor & Destructor Documentation

template<int Size = -1>
TooN::WLSCholesky< Size >::WLSCholesky ( const WLSCholesky< Size > &  w  )  [inline]

Copy constructor

Parameters:
w The decomposition object to copy

Definition at line 47 of file wls_cholesky.h.

References TooN::WLSCholesky< Size >::my_C_inv, TooN::WLSCholesky< Size >::my_err, TooN::WLSCholesky< Size >::my_extra, and TooN::WLSCholesky< Size >::my_vector.

template<int Size = -1>
TooN::WLSCholesky< Size >::WLSCholesky ( const WLSCholesky< Size > &  w  )  [inline]

Copy constructor

Parameters:
w The decomposition object to copy

Definition at line 47 of file wls_cholesky.h.


Member Function Documentation

template<int Size = -1>
void TooN::WLSCholesky< Size >::clear ( double  prior = 0  )  [inline]

Clear all the measurements and apply a constant regularisation term. Equates to a prior that says all the parameters are zero with $\sigma^2 = \frac{1}{\text{val}}$.

Parameters:
prior The strength of the prior

Definition at line 57 of file wls_cholesky.h.

References TooN::Identity().

Referenced by TooN::WLSCholesky<-1 >::WLSCholesky(), and TooN::WLSCholesky< Size >::WLSCholesky().

template<int Size = -1>
void TooN::WLSCholesky< Size >::add_prior ( double  val  )  [inline]

Applies a constant regularisation term. Equates to a prior that says all the parameters are zero with $\sigma^2 = \frac{1}{\text{val}}$.

Parameters:
val The strength of the prior

Definition at line 69 of file wls_cholesky.h.

template<int Size = -1>
template<class Accessor>
void TooN::WLSCholesky< Size >::add_prior ( double  val,
const FixedVector< Size, Accessor > &  pos 
) [inline]

Applies a constant regularisation term about a non-zero postion Equates to a prior that says the parameters are equal to pos with $\sigma^2 = \frac{1}{\text{val}}$.

Parameters:
val The strength of the prior
pos The position

Definition at line 80 of file wls_cholesky.h.

template<int Size = -1>
template<class Accessor>
void TooN::WLSCholesky< Size >::add_prior ( const FixedVector< Size, Accessor > &  v  )  [inline]

Applies a regularisation term with a different strength for each parameter value. Equates to a prior that says all the parameters are zero with $\sigma_i^2 = \frac{1}{\text{v}_i}$.

Parameters:
v The vector of priors

Definition at line 92 of file wls_cholesky.h.

template<int Size = -1>
template<class Accessor>
void TooN::WLSCholesky< Size >::add_prior ( const FixedMatrix< Size, Size, Accessor > &  m  )  [inline]

Applies a whole-matrix regularisation term. This is the same as adding the $m$ to the inverse covariance matrix.

Parameters:
m The inverse covariance matrix to add

Definition at line 102 of file wls_cholesky.h.

template<int Size = -1>
template<class Accessor>
void TooN::WLSCholesky< Size >::add_df ( double  m,
const FixedVector< Size, Accessor > &  J,
double  weight = 1 
) [inline]

Add a single measurement

Parameters:
m The value of the measurement
J The Jacobian for the measurement $\frac{\partial\text{m}}{\partial\text{param}_i}$
weight The inverse variance of the measurement (default = 1)

Definition at line 111 of file wls_cholesky.h.

template<int Size = -1>
template<int N, class Accessor1, class Accessor2, class Accessor3>
void TooN::WLSCholesky< Size >::add_df ( const FixedVector< N, Accessor1 > &  m,
const FixedMatrix< Size, N, Accessor2 > &  J,
const FixedMatrix< N, N, Accessor3 > &  invcov 
) [inline]

Add multiple measurements at once (much more efficiently)

Parameters:
N The number of measurements
m The measurements to add
J The Jacobian matrix $\frac{\partial\text{m}_i}{\partial\text{param}_j}$
invcov The inverse covariance of the measurement values

Definition at line 128 of file wls_cholesky.h.

template<int Size = -1>
void TooN::WLSCholesky< Size >::operator+= ( const WLSCholesky< Size > &  meas  )  [inline]

Combine measurements from two WLS systems

Parameters:
meas The measurements to combine with

Definition at line 166 of file wls_cholesky.h.

References TooN::WLSCholesky< Size >::my_C_inv, TooN::WLSCholesky< Size >::my_err, TooN::WLSCholesky< Size >::my_extra, and TooN::WLSCholesky< Size >::my_vector.

template<int Size = -1>
void TooN::WLSCholesky< Size >::operator= ( const WLSCholesky< Size > &  w  )  [inline]

Copy measurements from another WLS system

Parameters:
w The measurements to copy

Definition at line 175 of file wls_cholesky.h.

References TooN::WLSCholesky< Size >::my_C_inv, TooN::WLSCholesky< Size >::my_err, TooN::WLSCholesky< Size >::my_extra, and TooN::WLSCholesky< Size >::my_vector.

template<int Size = -1>
void TooN::WLSCholesky< Size >::clear ( double  prior = 0  )  [inline]

Clear all the measurements and apply a constant regularisation term. Equates to a prior that says all the parameters are zero with $\sigma^2 = \frac{1}{\text{val}}$.

Parameters:
prior The strength of the prior

Definition at line 57 of file wls_cholesky.h.

References TooN::Identity().

template<int Size = -1>
void TooN::WLSCholesky< Size >::add_prior ( double  val  )  [inline]

Applies a constant regularisation term. Equates to a prior that says all the parameters are zero with $\sigma^2 = \frac{1}{\text{val}}$.

Parameters:
val The strength of the prior

Definition at line 69 of file wls_cholesky.h.

template<int Size = -1>
template<class Accessor>
void TooN::WLSCholesky< Size >::add_prior ( double  val,
const FixedVector< Size, Accessor > &  pos 
) [inline]

Applies a constant regularisation term about a non-zero postion Equates to a prior that says the parameters are equal to pos with $\sigma^2 = \frac{1}{\text{val}}$.

Parameters:
val The strength of the prior
pos The position

Definition at line 80 of file wls_cholesky.h.

template<int Size = -1>
template<class Accessor>
void TooN::WLSCholesky< Size >::add_prior ( const FixedVector< Size, Accessor > &  v  )  [inline]

Applies a regularisation term with a different strength for each parameter value. Equates to a prior that says all the parameters are zero with $\sigma_i^2 = \frac{1}{\text{v}_i}$.

Parameters:
v The vector of priors

Definition at line 92 of file wls_cholesky.h.

template<int Size = -1>
template<class Accessor>
void TooN::WLSCholesky< Size >::add_prior ( const FixedMatrix< Size, Size, Accessor > &  m  )  [inline]

Applies a whole-matrix regularisation term. This is the same as adding the $m$ to the inverse covariance matrix.

Parameters:
m The inverse covariance matrix to add

Definition at line 102 of file wls_cholesky.h.

template<int Size = -1>
template<class Accessor>
void TooN::WLSCholesky< Size >::add_df ( double  m,
const FixedVector< Size, Accessor > &  J,
double  weight = 1 
) [inline]

Add a single measurement

Parameters:
m The value of the measurement
J The Jacobian for the measurement $\frac{\partial\text{m}}{\partial\text{param}_i}$
weight The inverse variance of the measurement (default = 1)

Definition at line 111 of file wls_cholesky.h.

template<int Size = -1>
template<int N, class Accessor1, class Accessor2, class Accessor3>
void TooN::WLSCholesky< Size >::add_df ( const FixedVector< N, Accessor1 > &  m,
const FixedMatrix< Size, N, Accessor2 > &  J,
const FixedMatrix< N, N, Accessor3 > &  invcov 
) [inline]

Add multiple measurements at once (much more efficiently)

Parameters:
N The number of measurements
m The measurements to add
J The Jacobian matrix $\frac{\partial\text{m}_i}{\partial\text{param}_j}$
invcov The inverse covariance of the measurement values

Definition at line 128 of file wls_cholesky.h.

template<int Size = -1>
void TooN::WLSCholesky< Size >::operator+= ( const WLSCholesky< Size > &  meas  )  [inline]

Combine measurements from two WLS systems

Parameters:
meas The measurements to combine with

Definition at line 166 of file wls_cholesky.h.

template<int Size = -1>
void TooN::WLSCholesky< Size >::operator= ( const WLSCholesky< Size > &  w  )  [inline]

Copy measurements from another WLS system

Parameters:
w The measurements to copy

Definition at line 175 of file wls_cholesky.h.


The documentation for this class was generated from the following files:
Generated on Fri Feb 22 18:26:57 2008 for QVision by  doxygen 1.5.3