KrisLibrary  1.0.0
LDL.h
1 #ifndef MATH_LDL_H
2 #define MATH_LDL_H
3 
4 #include "matrix.h"
5 
6 namespace Math {
7 
15 template <class T>
17 {
18  typedef MatrixTemplate<T> MatrixT;
19  typedef VectorTemplate<T> VectorT;
20 
22  LDLDecomposition(const MatrixT& A);
23 
24  void set(const MatrixT& A);
25  bool backSub(const VectorT& b, VectorT& x) const;
26  void LBackSub(const VectorT& b, VectorT& x) const;
27  void LTBackSub(const VectorT& b, VectorT& x) const;
28  bool DBackSub(const VectorT& b, VectorT& x) const;
29  bool backSub(const MatrixT& B, MatrixT& X) const;
30  bool getInverse(MatrixT& Ainv) const;
31  void getPseudoInverse(MatrixT& Ainv) const;
32  void getL(MatrixT& L) const;
33  void getD(VectorT& d) const;
34  void getA(MatrixT& A) const;
35  void mulL(const Vector& x,Vector& y) const;
36  void mulLT(const Vector& x,Vector& y) const;
37  void mulD(const Vector& x,Vector& y) const;
38 
40  void update(const VectorT& x);
42  bool downdate(const VectorT& x);
43 
44  MatrixT LDL;
45  T zeroTolerance;
46  int verbose;
47 };
48 
49 } // namespace Math
50 
51 #endif
void update(const VectorT &x)
Update the LDL decomposition for A + xx^t.
Definition: LDL.cpp:265
bool downdate(const VectorT &x)
"Downdate" the LDL decomposition for A - xx^t (on failure, LDL is undefined)
Definition: LDL.cpp:288
Performs the LDL^t decompositoin of a symmetric matrix A.
Definition: LDL.h:16
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