KrisLibrary  1.0.0
CholeskyDecomposition.h
1 #ifndef MATH_CHOLESKY_DECOMPOSITION_H
2 #define MATH_CHOLESKY_DECOMPOSITION_H
3 
4 #include "matrix.h"
5 
6 namespace Math {
7 
13 template <class T>
15 {
16 public:
17  typedef MatrixTemplate<T> MatrixT;
18  typedef VectorTemplate<T> VectorT;
19 
21  CholeskyDecomposition(const MatrixT& A);
22  CholeskyDecomposition(const MatrixT& A,MatrixT& L);
23 
24  void setDestination(MatrixT& L);
25  bool set(const MatrixT& A);
26  bool setPerturbed(const MatrixT& A,T& lambda);
27  void backSub(const VectorT& b, VectorT& x) const;
28  void LBackSub(const VectorT& b, VectorT& x) const;
29  void LTBackSub(const VectorT& b, VectorT& x) const;
30  void backSub(const MatrixT& B, MatrixT& X) const;
31  void getInverse(MatrixT& Ainv) const;
32 
34  void update(const VectorT& x);
36  bool downdate(const VectorT& x);
37 
38  MatrixT L;
39  T zeroEpsilon;
40 };
41 
42 }
43 #endif
bool downdate(const VectorT &x)
"Downdate" the cholesky decomposition for A - xx^t (on failure, L is undefined)
Definition: CholeskyDecomposition.cpp:207
Performs the Cholesky decomposition.
Definition: CholeskyDecomposition.h:14
void update(const VectorT &x)
Update the cholesky decomposition for A + xx^t.
Definition: CholeskyDecomposition.cpp:185
A matrix over the field T.
Definition: function.h:10
Contains all definitions in the Math package.
Definition: WorkspaceBound.h:12
A vector over the field T.
Definition: function.h:9