42 #ifndef MATRIX_SYM_POS_DEF_LBFGS_H
43 #define MATRIX_SYM_POS_DEF_LBFGS_H
47 #include "AbstractLinAlgPack_MatrixSymSecant.hpp"
48 #include "AbstractLinAlgPack_MatrixSymAddDelUpdateable.hpp"
49 #include "AbstractLinAlgPack/src/MatrixSymWithOpFactorized.hpp"
50 #include "DenseLinAlgPack_DMatrixAsTriSym.hpp"
53 namespace ConstrainedOptPack {
119 class MatrixSymPosDefLBFGS
120 :
public MatrixSymWithOpFactorized
121 ,
public MatrixSymSecant
122 ,
public MatrixSymAddDelUpdateable
135 ,
bool auto_rescaling =
false
186 ,
bool auto_rescaling =
false
201 const DMatrixSlice
S()
const;
203 const DMatrixSlice
Y()
const;
222 std::ostream&
output(std::ostream& out)
const;
227 ,
const DVectorSlice& vs_rhs2, value_type beta)
const;
237 ,
const DVectorSlice& vs_rhs2)
const;
255 void secant_update(DVectorSlice* s, DVectorSlice* y, DVectorSlice* Bs);
271 const DMatrixSliceSym &A
273 ,
bool force_factorization
275 ,PivotTolerances pivot_tols
292 const DVectorSlice *t
294 ,
bool force_refactorization
295 ,EEigenValType add_eigen_val
296 ,PivotTolerances pivot_tols
301 ,
bool force_refactorization
302 ,EEigenValType drop_eigen_val
303 ,PivotTolerances pivot_tols
316 bool maintain_original_;
317 bool original_is_updated_;
318 bool maintain_inverse_;
319 bool inverse_is_updated_;
341 mutable bool Q_updated_;
344 mutable DVector work_;
352 const DMatrixSliceTri R()
const;
354 const DMatrixSliceTri Lb()
const;
358 const DMatrixSlice STY()
const;
360 DMatrixSliceSym STS();
362 const DMatrixSliceSym STS()
const;
364 DMatrixSliceSym YTY();
366 const DMatrixSliceSym YTY()
const;
368 void V_invQtV( DVectorSlice* y,
const DVectorSlice& x )
const;
370 void Vp_DtV( DVectorSlice* y,
const DVectorSlice& x )
const;
375 void update_Q()
const;
378 void assert_initialized()
const;
412 return S_(1,n_,1,m_bar_);
418 return Y_(1,n_,1,m_bar_);
424 return maintain_original_;
430 return maintain_inverse_;
436 return num_secant_updates_;
442 #endif // MATRIX_SYM_POS_DEF_LBFGS_H
void init_identity(const VectorSpace &space_diag, value_type alpha)
bool maintain_original() const
void secant_update(VectorMutable *s, VectorMutable *y, VectorMutable *Bs)
void initial_setup(size_type m=10, bool maintain_original=true, bool maintain_inverse=true, bool auto_rescaling=false)
Initial setup for the matrix.
void V_InvMtV(VectorMutable *v_lhs, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2) const
void initialize(value_type alpha, size_type max_size)
This is fine as long as alpha > 0.0.
MatrixSymPosDefLBFGS(size_type m=10, bool maintain_original=true, bool maintain_inverse=true, bool auto_rescaling=false)
Calls this->initial_setup()
void delete_update(size_type jd, bool force_refactorization, EEigenValType drop_eigen_val, PivotTolerances pivot_tols)
Should always succeed unless user gives a wrong value for drop_eigen_val.
void init_diagonal(const Vector &diag)
Actually this calls init_identity( diag.space(), diag.norm_inf() ).
const multi_vec_ptr_t S() const
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, auto_rescaling)
Set whether automatic rescaling is used or not.
const multi_vec_ptr_t Y() const
std::ostream & output(std::ostream &out) const
Inertia inertia() const
Returns (0,0,rows())
void Vp_StMtV(VectorMutable *v_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta) const
bool maintain_inverse() const
size_type num_secant_updates() const
Returns the total number of successful secant updates performed since this->init_identity() was calle...
MatrixOp & operator=(const MatrixOp &mwo)
value_type gamma_k() const
void augment_update(const DVectorSlice *t, value_type alpha, bool force_refactorization, EEigenValType add_eigen_val, PivotTolerances pivot_tols)
Augment the matrix to add a row and column.
void set_uninitialized()
Will set rows() == 0.
size_type max_size() const