KrisLibrary  1.0.0
QuasiNewton.h
1 #ifndef QUASI_NEWTON_H
2 #define QUASI_NEWTON_H
3 
4 #include "LDL.h"
5 
6 namespace Math {
7 
20 {
23  void SetHessian(const Matrix& H) { ldl.set(H); }
25  void GetHessian(Matrix& H) const { ldl.getA(H); }
27  void BackSub(const Vector& b,Vector& x) const { ldl.backSub(b,x); }
28  bool IsValidUpdate(const Vector& s,const Vector& q) { return (s.dot(q)>0); }
29  bool UpdateBFGS(const Vector& s,const Vector& q);
30  bool UpdateDFS(const Vector& s,const Vector& q);
31  bool IsPositiveDefinite(Real tol=0) const;
32  void MakePositiveDefinite(Real resetValue=1);
33 
35  int verbose;
36  Real tolerance;
37 
38  //temporary
39  Vector temp,Hs,upd;
40  Matrix tempLDL;
41 };
42 
43 
44 } //namespace Math
45 
46 #endif
void GetHessian(Matrix &H) const
form the hessian matrix
Definition: QuasiNewton.h:25
Maintains the Cholesky decomposition of the hessian H over Quasi-Newton steps.
Definition: QuasiNewton.h:19
void BackSub(const Vector &b, Vector &x) const
solve x=H^-1*b
Definition: QuasiNewton.h:27
Contains all definitions in the Math package.
Definition: WorkspaceBound.h:12
void SetHessian(const Matrix &H)
set the initial hessian matrix
Definition: QuasiNewton.h:23