Ipopt  3.11.9
IpLimMemQuasiNewtonUpdater.hpp
Go to the documentation of this file.
1 // Copyright (C) 2005, 2010 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpLimMemQuasiNewtonUpdater.hpp 1861 2010-12-21 21:34:47Z andreasw $
6 //
7 // Authors: Andreas Waechter IBM 2005-12-26
8 
9 #ifndef __IPLIMMEMQUASINEWTONUPDATER_HPP__
10 #define __IPLIMMEMQUASINEWTONUPDATER_HPP__
11 
12 #include "IpHessianUpdater.hpp"
14 #include "IpMultiVectorMatrix.hpp"
15 #include "IpDenseVector.hpp"
16 #include "IpDenseGenMatrix.hpp"
17 #include "IpDenseSymMatrix.hpp"
18 
19 namespace Ipopt
20 {
21 
26  {
27  public:
31  LimMemQuasiNewtonUpdater(bool update_for_resto);
32 
35  {}
37 
39  virtual bool InitializeImpl(const OptionsList& options,
40  const std::string& prefix);
41 
44  virtual void UpdateHessian();
45 
50 
51  private:
62 
66 
69 
76  {
77  BFGS=0,
78  SR1
79  };
84  {
89  CONSTANT
90  };
107 
113  const bool update_for_resto_;
131 
135 
221 
228  bool CheckSkippingBFGS(Vector& s_new, Vector& y_new);
233  bool UpdateInternalData(const Vector& s_new, const Vector& y_new,
234  SmartPtr<Vector> ypart_new);
241  const Vector& v_new);
248  Number v_new);
257  const MultiVectorMatrix& S,
258  const MultiVectorMatrix& Y);
266  const MultiVectorMatrix& S);
275  const MultiVectorMatrix& S,
276  const MultiVectorMatrix& DRS);
277 
296  const MultiVectorMatrix& S,
297  const MultiVectorMatrix& Y);
304  const MultiVectorMatrix& S);
311  const MultiVectorMatrix& S,
312  const MultiVectorMatrix& DRS);
315  void RecalcY(Number eta, const Vector& DR_x,
317  MultiVectorMatrix& Ypart,
337  SmartPtr<DenseGenMatrix>& Qminus,
338  SmartPtr<DenseGenMatrix>& Qplus);
351  void SetW();
353 
354  };
355 
356 } // namespace Ipopt
357 
358 #endif
Class for dense general matrices.
Dense Vector Implementation.
Abstract base class for objects responsible for updating the Hessian information.
Implementation of the HessianUpdater for limit-memory quasi-Newton approximation of the Lagrangian He...
void StoreInternalDataBackup()
Store a copy of the pointers to the internal data (S, Y, D, L, SdotS, curr_lm_memory) This is called ...
void ShiftDenseVector(SmartPtr< DenseVector > &V, Number v_new)
Given a DenseVector V, get rid of the first element, shift all other elements one position to the top...
void AugmentSTDRSMatrix(SmartPtr< DenseSymMatrix > &V, const MultiVectorMatrix &S, const MultiVectorMatrix &DRS)
Given a DenseSymMatrix V, create a new DenseGenMatrixSpace with one more dimension,...
SmartPtr< DenseSymMatrix > STDRS_
For efficient implementation, we store the S^T S DR * S.
SmartPtr< DenseSymMatrix > SdotS_old_
For efficient implementation, we store the pairwise products for s's (backup).
SmartPtr< const Matrix > last_jac_c_
Jacobian for equality constraints w.r.t x at x_last.
Index limited_memory_max_skipping_
Number of successive iterations of skipped updates after which the approximation is reset.
Index lm_skipped_iter_
Counter for successive iterations in which the update was skipped.
SmartPtr< MultiVectorMatrix > Ypart_old_
For restoration phase update: Y without the quadratic objective function part (backup)
void AugmentMultiVector(SmartPtr< MultiVectorMatrix > &V, const Vector &v_new)
Given a MutliVector V, create a new MultiVectorSpace with one more column, and return V as a member o...
SmartPtr< MultiVectorMatrix > S_
s pairs for the recent iterations
void ShiftSdotSMatrix(SmartPtr< DenseSymMatrix > &V, const MultiVectorMatrix &S)
Given a DenseSymMatrix V, shift everything up one row and column, and fill the new entries as s_i^Ts_...
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for OptionsList.
void AugmentDenseVector(SmartPtr< DenseVector > &V, Number v_new)
Given a DenseVector V, create a new DenseVectorSpace with one more row, and return V as a member of t...
void ReleaseInternalDataBackup()
Release anything that we allocated for StoreInternalDataBackup and is no longer needed.
SmartPtr< const Matrix > last_jac_d_
Jacobian for inequality constraints w.r.t x at x_last.
void operator=(const LimMemQuasiNewtonUpdater &)
Overloaded Equals Operator.
bool SplitEigenvalues(DenseGenMatrix &Q, const DenseVector &E, SmartPtr< DenseGenMatrix > &Qminus, SmartPtr< DenseGenMatrix > &Qplus)
Split the eigenvectors into negative and positive ones.
void ShiftLMatrix(SmartPtr< DenseGenMatrix > &V, const MultiVectorMatrix &S, const MultiVectorMatrix &Y)
Given a strictly-lower triangular square DenseGenMatrix V, shift everything one row and column up,...
bool UpdateInternalData(const Vector &s_new, const Vector &y_new, SmartPtr< Vector > ypart_new)
Update the internal data, such as the S, Y, L, D etc matrices and vectors that are required for compu...
SmartPtr< MultiVectorMatrix > Ypart_
For restoration phase update: Y without the quadratic objective function part.
Number sigma_safe_min_
Minimal safeguard value for sigma.
SmartPtr< DenseSymMatrix > SdotS_
For efficient implementation, we store the pairwise products for s's.
Number sigma_
First term (starting matrix) for the approximation.
void SetW()
Set the W field in IpData based on the current values of B0_, V_, and U_.
const bool update_for_resto_
Flag indicating if the update is to be done for the original NLP or for the restoration phase NLP.
SmartPtr< const Vector > curr_red_DR_x_
Current DR_x scaling factors in the restoration phase objective function in the smaller space for the...
SmartPtr< MultiVectorMatrix > U_
U in LowRankUpdateMatrix from last update.
bool CheckSkippingBFGS(Vector &s_new, Vector &y_new)
Method deciding whether the BFGS update should be skipped.
SmartPtr< MultiVectorMatrix > DRS_old_
DR * S (only for restoration phase) (backup)
SmartPtr< MultiVectorMatrix > Y_old_
y pairs for the recent iterations.
SmartPtr< DenseVector > D_old_
Diagonal elements D_k for compact formulation from last update (backup).
bool SdotS_uptodate_old_
Flag indicating whether SdotS_ is update to date from most recent update (backup).
SmartPtr< Vector > B0_old_
First term (starting matrix) for the approximation (backup).
Index limited_memory_max_history_
Size of memory for limited memory update.
Number curr_eta_
Current value of weighing factor eta in the restoration phase objective function (only for update_for...
virtual void UpdateHessian()
Update the Hessian based on the current information in IpData.
void ShiftSTDRSMatrix(SmartPtr< DenseSymMatrix > &V, const MultiVectorMatrix &S, const MultiVectorMatrix &DRS)
Given a DenseSymMatrix V, shift everything up one row and column, and fill the new entries as s_i^TDR...
TaggedObject::Tag curr_DR_x_tag_
Tag for curr_DR_x_.
Number sigma_safe_max_
Maximal safeguard value for sigma.
SmartPtr< MultiVectorMatrix > V_
V in LowRankUpdateMatrix from last update.
LMInitialization
enumeration for the Hessian initialization.
LimMemQuasiNewtonUpdater(const LimMemQuasiNewtonUpdater &)
Copy Constructor.
bool limited_memory_special_for_resto_
Flag indicating if Hessian approximation should be done in a special manner for the restoration phase...
SmartPtr< const Vector > last_grad_f_
Gradient of objective function w.r.t.
void RestoreInternalDataBackup()
Restore the copy of the pointers to the internal data most recently stored with StoreInternalDataBack...
LimMemQuasiNewtonUpdater(bool update_for_resto)
Default Constructor.
virtual ~LimMemQuasiNewtonUpdater()
Default destructor.
void RecalcY(Number eta, const Vector &DR_x, MultiVectorMatrix &S, MultiVectorMatrix &Ypart, SmartPtr< MultiVectorMatrix > &Y)
Method for recomputing Y from scratch, using Ypart (only for restoration phase)
SmartPtr< DenseVector > D_
Diagonal elements D_k for compact formulation from last update.
Number sigma_old_
First term (starting matrix) for the approximation.
void AugmentLMatrix(SmartPtr< DenseGenMatrix > &V, const MultiVectorMatrix &S, const MultiVectorMatrix &Y)
Given a strictly-lower triangular square DenseGenMatrix V, create a new DenseGenMatrixSpace with one ...
LMInitialization limited_memory_initialization_
How to choose B0 in the low-rank update.
void AugmentSdotSMatrix(SmartPtr< DenseSymMatrix > &V, const MultiVectorMatrix &S)
Given a DenseSymMatrix V, create a new DenseGenMatrixSpace with one more dimension,...
virtual bool InitializeImpl(const OptionsList &options, const std::string &prefix)
overloaded from AlgorithmStrategyObject
SmartPtr< DenseGenMatrix > L_old_
Matrix L_k for compact formulation from last update (backup).
LMUpdateType limited_memory_update_type_
Type of Hessian update.
SmartPtr< DenseGenMatrix > L_
Matrix L_k for compact formulation from last update.
Index curr_lm_memory_
current size of limited memory
void ShiftMultiVector(SmartPtr< MultiVectorMatrix > &V, const Vector &v_new)
Given a MutliVector V, get rid of the first column, shift all other columns to the left,...
LMUpdateType
enumeration for the Hessian update type.
SmartPtr< const Vector > last_x_
Primal variables x from most recent update.
SmartPtr< MultiVectorMatrix > U_old_
U in LowRankUpdateMatrix from last update (backup)
void RecalcD(MultiVectorMatrix &S, MultiVectorMatrix &Y, SmartPtr< DenseVector > &D)
Method for recomputing D from S and Y.
SmartPtr< DenseSymMatrix > STDRS_old_
For efficient implementation, we store the S^T S DR * S.
SmartPtr< MultiVectorMatrix > DRS_
DR * S (only for restoration phase)
SmartPtr< MultiVectorMatrix > S_old_
s pairs for the recent iterations (backup)
SmartPtr< MultiVectorMatrix > Y_
y pairs for the recent iterations.
SmartPtr< const LowRankUpdateSymMatrixSpace > h_space_
Matrix space for the low-rank Hessian approximation.
Number limited_memory_init_val_
Value of B0 (as this multiple of the identity in certain situations.)
bool SdotS_uptodate_
Flag indicating whether SdotS_ is update to date from most recent update.
Number last_eta_
Most recent value for eta in the restoration phase objective function (only for update_for_resto_ = t...
Index curr_lm_memory_old_
current size of limited memory
void RecalcL(MultiVectorMatrix &S, MultiVectorMatrix &Y, SmartPtr< DenseGenMatrix > &L)
Method for recomputing L from S and Y.
SmartPtr< Vector > B0_
First term (starting matrix) for the approximation.
SmartPtr< const Vector > curr_DR_x_
Current DR_x scaling factors in the restoration phase objective function (only for update_for_resto_ ...
SmartPtr< MultiVectorMatrix > V_old_
V in LowRankUpdateMatrix from last update (backup)
Class for Matrices with few columns that consists of Vectors.
This class stores a list of user set options.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:183
unsigned int Tag
Type for the Tag values.
Vector Base Class.
Definition: IpVector.hpp:48
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
double Number
Type of all numbers.
Definition: IpTypes.hpp:17