30 #ifndef TOON_INCLUDE_WLS_H
31 #define TOON_INCLUDE_WLS_H
47 template<
int DecompSize,
class DecompPrecision>
class Decomposition = Cholesky>
71 for(
int i=0; i<
my_C_inv.num_rows(); i++){
82 for(
int i=0; i<
my_C_inv.num_rows(); i++){
103 for(
int r=0; r <
my_C_inv.num_rows(); r++)
105 double Jw = weight * J[r];
107 for(
int c=r; c <
my_C_inv.num_rows(); c++)
116 template<
int N,
class B1,
class B2,
class B3>
129 template<
int N,
class B1,
class B2,
class B3>
143 template<
int N,
int S1,
class B1,
class B2,
class B3>
148 const int size1 = J1.num_cols();
149 my_C_inv.slice(index1, index1, size1, size1) += temp1 * J1;
150 my_vector.slice(index1, size1) += temp1 * m;
160 template<
int N,
int S1,
int S2,
class B1,
class B2,
class B3,
class B4>
168 const int size1 = J1.num_cols();
169 const int size2 = J2.num_cols();
170 my_C_inv.slice(index1, index1, size1, size1) += temp1 * J1;
171 my_C_inv.slice(index2, index2, size2, size2) += temp2 * J2;
172 my_C_inv.slice(index1, index2, size1, size2) += mixed;
173 my_C_inv.slice(index2, index1, size2, size1) += mixed.T();
174 my_vector.slice(index1, size1) += temp1 * m;
175 my_vector.slice(index2, size2) += temp2 * m;
183 for(
int r=1; r <
my_C_inv.num_rows(); r++)
184 for(
int c=0; c < r; c++)
void clear()
Clear all the measurements and apply a constant regularisation term.
void add_prior(const Matrix< Size, Size, Precision, B2 > &m)
void add_mJ_rows(const Vector< N, Precision, B1 > &m, const Matrix< N, Size, Precision, B2 > &J, const Matrix< N, N, Precision, B3 > &invcov)
void operator+=(const WLS &meas)
Decomposition< Size, Precision > & get_decomposition()
Return the decomposition object used to compute .
Everything lives inside this namespace.
int operator=(WLS ©of)
void add_sparse_mJ_rows(const Vector< N, Precision, B1 > &m, const Matrix< N, S1, Precision, B2 > &J1, const int index1, const Matrix< N, N, Precision, B3 > &invcov)
static const int Dynamic
Template size value used to indicate dynamically sized vectors and matrices.
static void test(int s1, int s2)
const Vector< Size, Precision > & get_vector() const
Returns the vector .
void add_mJ(Precision m, const Vector< Size, Precision, B2 > &J, Precision weight=1)
double DefaultPrecision
All TooN classes default to using this precision for computations and storage.
void add_prior(const Vector< Size, Precision, B2 > &v)
const Decomposition< Size, Precision > & get_decomposition() const
Return the decomposition object used to compute .
Vector< Size, Precision > & get_mu()
Returns the update. With no prior, this is the result of .
Matrix< Size, Size, Precision > & get_C_inv()
Returns the inverse covariance matrix.
Vector< Size, Precision > my_vector
Vector< Size, Precision > & get_vector()
Returns the vector .
WLS(int size=0)
Default constructor or construct with the number of dimensions for the Dynamic case.
Vector< Size, Precision > my_mu
const Vector< Size, Precision > & get_mu() const
Returns the update. With no prior, this is the result of .
void add_mJ(const Vector< N, Precision, B1 > &m, const Matrix< Size, N, Precision, B2 > &J, const Matrix< N, N, Precision, B3 > &invcov)
const Matrix< Size, Size, Precision > & get_C_inv() const
Returns the inverse covariance matrix.
Decomposition< Size, Precision > my_decomposition
void add_prior(Precision val)
Matrix< Size, Size, Precision > my_C_inv
static Operator< Internal::Zero > Zeros
void add_sparse_mJ_rows(const Vector< N, Precision, B1 > &m, const Matrix< N, S1, Precision, B2 > &J1, const int index1, const Matrix< N, S2, Precision, B3 > &J2, const int index2, const Matrix< N, N, Precision, B4 > &invcov)