Ipopt Documentation  
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 // Authors: Andreas Waechter IBM 2005-12-26
6 
7 #ifndef __IPLIMMEMQUASINEWTONUPDATER_HPP__
8 #define __IPLIMMEMQUASINEWTONUPDATER_HPP__
9 
10 #include "IpHessianUpdater.hpp"
12 #include "IpMultiVectorMatrix.hpp"
13 #include "IpDenseVector.hpp"
14 #include "IpDenseGenMatrix.hpp"
15 #include "IpDenseSymMatrix.hpp"
16 
17 namespace Ipopt
18 {
19 
24 {
25 public:
27 
30  bool update_for_resto
31  );
32 
35  { }
37 
38  virtual bool InitializeImpl(
39  const OptionsList& options,
40  const std::string& prefix
41  );
42 
44  virtual void UpdateHessian();
45 
47  static void RegisterOptions(
50  );
52 
53 private:
63 
67  );
68 
70  void operator=(
72  );
74 
77 
79 
82 
85  {
86  BFGS = 0,
88  };
89 
92 
95  {
96  SCALAR1 = 0,
101  };
102 
105 
108 
113 
116 
119 
125 
133  const bool update_for_resto_;
134 
139 
146 
149 
157 
162 
165 
167 
170 
173 
180 
185 
190 
193 
196 
203 
206 
209 
214 
219 
222 
228 
231 
234 
237 
240 
243 
246 
253 
257 
261 
264 
267 
274 
277 
280 
285 
290 
293 
300 
302 
310  bool CheckSkippingBFGS(
311  Vector& s_new,
312  Vector& y_new
313  );
314 
321  bool UpdateInternalData(
322  const Vector& s_new,
323  const Vector& y_new,
324  SmartPtr<Vector> ypart_new
325  );
326 
334  void AugmentMultiVector(
336  const Vector& v_new
337  );
338 
346  void AugmentDenseVector(
348  Number v_new
349  );
350 
360  void AugmentLMatrix(
362  const MultiVectorMatrix& S,
363  const MultiVectorMatrix& Y
364  );
365 
375  void AugmentSdotSMatrix(
377  const MultiVectorMatrix& S
378  );
379 
389  void AugmentSTDRSMatrix(
391  const MultiVectorMatrix& S,
392  const MultiVectorMatrix& DRS
393  );
394 
401  void ShiftMultiVector(
403  const Vector& v_new
404  );
405 
413  void ShiftDenseVector(
415  Number v_new
416  );
417 
426  void ShiftLMatrix(
428  const MultiVectorMatrix& S,
429  const MultiVectorMatrix& Y
430  );
431 
439  void ShiftSdotSMatrix(
441  const MultiVectorMatrix& S
442  );
443 
451  void ShiftSTDRSMatrix(
453  const MultiVectorMatrix& S,
454  const MultiVectorMatrix& DRS
455  );
456 
460  void RecalcY(
461  Number eta,
462  const Vector& DR_x,
464  MultiVectorMatrix& Ypart,
466  );
467 
469  void RecalcD(
473  );
474 
476  void RecalcL(
480  );
481 
495  bool SplitEigenvalues(
496  DenseGenMatrix& Q,
497  const DenseVector& E,
498  SmartPtr<DenseGenMatrix>& Qminus,
500  );
501 
509 
514 
519 
523  void SetW();
525 
526 };
527 
528 } // namespace Ipopt
529 
530 #endif
SmartPtr< DenseGenMatrix > L_old_
Matrix L_k for compact formulation from last update (backup).
SmartPtr< DenseSymMatrix > STDRS_
For efficient implementation, we store the S^T S DR * S.
SmartPtr< Vector > B0_
First term (starting matrix) for the approximation.
SmartPtr< DenseSymMatrix > STDRS_old_
For efficient implementation, we store the S^T S DR * S.
Number sigma_old_
First term (starting matrix) for the approximation.
virtual bool InitializeImpl(const OptionsList &options, const std::string &prefix)
overloaded from AlgorithmStrategyObject
SmartPtr< MultiVectorMatrix > V_old_
V in LowRankUpdateMatrix from last update (backup)
Index curr_lm_memory_old_
current size of limited memory
SmartPtr< const Matrix > last_jac_c_
Jacobian for equality constraints w.r.t x at x_last.
SmartPtr< DenseVector > D_old_
Diagonal elements D_k for compact formulation from last update (backup).
SmartPtr< Vector > B0_old_
First term (starting matrix) for the approximation (backup).
LMInitialization limited_memory_initialization_
How to choose B0 in the low-rank update.
Index limited_memory_max_skipping_
Number of successive iterations of skipped updates after which the approximation is reset...
Number limited_memory_init_val_
Value of B0 (as this multiple of the identity in certain situations).
LMUpdateType
enumeration for the Hessian update type.
Number sigma_safe_min_
Minimal safeguard value for sigma.
SmartPtr< const Vector > curr_red_DR_x_
Current DR_x scaling factors in the restoration phase objective function in the smaller space for the...
double Number
Type of all numbers.
Definition: IpTypes.hpp:15
Vector Base Class.
Definition: IpVector.hpp:47
Index limited_memory_max_history_
Size of memory for limited memory update.
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...
virtual void UpdateHessian()
Update the Hessian based on the current information in IpData.
Dense Vector Implementation.
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)
LMUpdateType limited_memory_update_type_
Type of Hessian update.
SmartPtr< const LowRankUpdateSymMatrixSpace > h_space_
Matrix space for the low-rank Hessian approximation.
void ReleaseInternalDataBackup()
Release anything that we allocated for StoreInternalDataBackup and is no longer needed.
SmartPtr< const Vector > last_x_
Primal variables x from most recent update.
TaggedObject::Tag curr_DR_x_tag_
Tag for curr_DR_x_.
Number sigma_safe_max_
Maximal safeguard value for sigma.
SmartPtr< MultiVectorMatrix > S_old_
s pairs for the recent iterations (backup)
This file contains a base class for all exceptions and a set of macros to help with exceptions...
void RecalcD(MultiVectorMatrix &S, MultiVectorMatrix &Y, SmartPtr< DenseVector > &D)
Method for recomputing D from S and Y.
bool SplitEigenvalues(DenseGenMatrix &Q, const DenseVector &E, SmartPtr< DenseGenMatrix > &Qminus, SmartPtr< DenseGenMatrix > &Qplus)
Split the eigenvectors into negative and positive ones.
bool limited_memory_special_for_resto_
Flag indicating if Hessian approximation should be done in a special manner for the restoration phase...
bool CheckSkippingBFGS(Vector &s_new, Vector &y_new)
Method deciding whether the BFGS update should be skipped.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:171
This class stores a list of user set options.
bool SdotS_uptodate_
Flag indicating whether SdotS_ is update to date from most recent update.
void AugmentSdotSMatrix(SmartPtr< DenseSymMatrix > &V, const MultiVectorMatrix &S)
Given a DenseSymMatrix V, create a new DenseGenMatrixSpace with one more dimension, and return V as a member of that space, consisting of all previous elements, and in addition elements s_i^Ts_j for the new entries, where s are the vectors in the MultiVector S.
void RecalcL(MultiVectorMatrix &S, MultiVectorMatrix &Y, SmartPtr< DenseGenMatrix > &L)
Method for recomputing L from S and Y.
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...
bool SdotS_uptodate_old_
Flag indicating whether SdotS_ is update to date from most recent update (backup).
void StoreInternalDataBackup()
Store a copy of the pointers to the internal data (S, Y, D, L, SdotS, curr_lm_memory).
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...
Index curr_lm_memory_
current size of limited memory
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...
Class for Matrices with few columns that consists of Vectors.
SmartPtr< MultiVectorMatrix > U_
U in LowRankUpdateMatrix from last update.
Implementation of the HessianUpdater for limit-memory quasi-Newton approximation of the Lagrangian He...
SmartPtr< MultiVectorMatrix > V_
V in LowRankUpdateMatrix from last update.
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
SmartPtr< const Vector > last_grad_f_
Gradient of objective function w.r.t.
SmartPtr< MultiVectorMatrix > S_
s pairs for the recent iterations
SmartPtr< DenseVector > D_
Diagonal elements D_k for compact formulation from last update.
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...
SmartPtr< const Matrix > last_jac_d_
Jacobian for inequality constraints w.r.t x at x_last.
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...
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 ...
SmartPtr< DenseSymMatrix > SdotS_
For efficient implementation, we store the pairwise products for s&#39;s.
LMInitialization
enumeration for the Hessian initialization.
SmartPtr< MultiVectorMatrix > Ypart_
For restoration phase update: Y without the quadratic objective function part.
SmartPtr< MultiVectorMatrix > U_old_
U in LowRankUpdateMatrix from last update (backup)
SmartPtr< MultiVectorMatrix > DRS_
DR * S (only for restoration phase)
Index lm_skipped_iter_
Counter for successive iterations in which the update was skipped.
unsigned int Tag
Type for the Tag values.
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_.
Number last_eta_
Most recent value for eta in the restoration phase objective function (only for update_for_resto_ = t...
Class for dense general matrices.
SmartPtr< DenseSymMatrix > SdotS_old_
For efficient implementation, we store the pairwise products for s&#39;s (backup).
void operator=(const LimMemQuasiNewtonUpdater &)
Default Assignment Operator.
Number curr_eta_
Current value of weighing factor eta in the restoration phase objective function (only for update_for...
SmartPtr< MultiVectorMatrix > Ypart_old_
For restoration phase update: Y without the quadratic objective function part (backup) ...
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for OptionsList.
void RestoreInternalDataBackup()
Restore the copy of the pointers to the internal data most recently stored with StoreInternalDataBack...
SmartPtr< MultiVectorMatrix > Y_old_
y 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_...
SmartPtr< DenseGenMatrix > L_
Matrix L_k for compact formulation from last update.
Abstract base class for objects responsible for updating the Hessian information. ...
SmartPtr< const Vector > curr_DR_x_
Current DR_x scaling factors in the restoration phase objective function (only for update_for_resto_ ...
LimMemQuasiNewtonUpdater(bool update_for_resto)
Default Constructor.
void AugmentSTDRSMatrix(SmartPtr< DenseSymMatrix > &V, const MultiVectorMatrix &S, const MultiVectorMatrix &DRS)
Given a DenseSymMatrix V, create a new DenseGenMatrixSpace with one more dimension, and return V as a member of that space, consisting of all previous elements, and in addition elements s_i^TDRs_j for the new entries, where s are the vectors in the MultiVector S, and DRs are the vectors in DRS.
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< MultiVectorMatrix > DRS_old_
DR * S (only for restoration phase) (backup)
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...
SmartPtr< MultiVectorMatrix > Y_
y pairs for the recent iterations.