Ipopt  3.12.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpCGPenaltyLSAcceptor.hpp
Go to the documentation of this file.
1 // Copyright (C) 2005, 2008 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpCGPenaltyLSAcceptor.hpp 1861 2010-12-21 21:34:47Z andreasw $
6 //
7 // Authors: Andreas Waechter IBM 2005-10-13
8 
9 #ifndef __IPCGPENALTYLSACCEPTOR_HPP__
10 #define __IPCGPENALTYLSACCEPTOR_HPP__
11 
12 #include "IpPiecewisePenalty.hpp"
14 #include "IpPDSystemSolver.hpp"
15 #include "IpIpoptAlg.hpp"
16 #include "IpCGPenaltyCq.hpp"
17 
18 namespace Ipopt
19 {
20 
24  {
25  public:
32 
34  virtual ~CGPenaltyLSAcceptor();
36 
38  virtual bool InitializeImpl(const OptionsList& options,
39  const std::string& prefix);
40 
47  virtual void Reset();
48 
52  virtual void InitThisLineSearch(bool in_watchdog);
53 
57  virtual void PrepareRestoPhaseStart();
58 
63  virtual Number CalculateAlphaMin();
64 
70  virtual bool CheckAcceptabilityOfTrialPoint(Number alpha_primal);
71 
84  virtual bool TrySecondOrderCorrection(Number alpha_primal_test,
85  Number& alpha_primal,
86  SmartPtr<IteratesVector>& actual_delta);
87 
94  virtual bool TryCorrector(Number alpha_primal_test,
95  Number& alpha_primal,
96  SmartPtr<IteratesVector>& actual_delta);
97 
102  virtual char UpdateForNextIteration(Number alpha_primal_test);
103 
106  virtual void StartWatchDog();
107 
110  virtual void StopWatchDog();
111 
114  virtual bool RestoredIterate();
117  virtual bool NeverRestorationPhase();
118 
122  virtual bool DoFallback();
123 
126  static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
128 
129  private:
140 
142  void operator=(const CGPenaltyLSAcceptor&);
144 
147  {
148  CGPenaltyData& cg_pen_data =
149  static_cast<CGPenaltyData&>(IpData().AdditionalData());
150  DBG_ASSERT(dynamic_cast<CGPenaltyData*>(&IpData().AdditionalData()));
151  return cg_pen_data;
152  }
153 
156  {
157  CGPenaltyCq& cg_pen_cq =
158  static_cast<CGPenaltyCq&>(IpCq().AdditionalCq());
159  DBG_ASSERT(dynamic_cast<CGPenaltyCq*>(&IpCq().AdditionalCq()));
160  return cg_pen_cq;
161  }
162 
164  bool IsAcceptableToPiecewisePenalty(Number alpha_primal_test);
165 
167  bool ArmijoHolds(Number alpha_primal_test);
168 
170  //ToDo This should probably not be a static member function if we want to
171  // allow for different relaxation parameters values
172  static bool Compare_le(Number lhs, Number rhs, Number BasVal);
173 
174  bool CurrentIsBest();
175  void StoreBestPoint();
176  bool RestoreBestPoint();
177  bool MultipliersDiverged();
178  char UpdatePenaltyParameter();
179 
204 
208  // Number used to indicate that mu has been decreased
210 
213 
218 
221 
223  /*Initial constraint violation*/
226 
233 
238 
248 
268 
270  // piecewise penalty list
274 
276 
281  };
282 
283 
284 
285 
286 
287 } // namespace Ipopt
288 
289 #endif
virtual void StopWatchDog()
Method for setting internal data if the watchdog procedure is stopped.
Number piecewisepenalty_gamma_obj_
Parameters for piecewise penalty acceptor.
CGPenaltyData & CGPenData()
Method to easily access CGPenalty data.
bool IsAcceptableToPiecewisePenalty(Number alpha_primal_test)
Check if the trial point is acceptable to the piecewise penalty list.
static bool Compare_le(Number lhs, Number rhs, Number BasVal)
Check comparison &quot;lhs &lt;= rhs&quot;, using machine precision based on BasVal.
Number penalty_update_infeasibility_tol_
Tolerance for infeasibility part in penalty parameter update rule.
Number theta_min_
Parameters deciding when the piecewise penalty acceptor shall be closed.
virtual void Reset()
Reset the acceptor.
Index max_soc_
Maximal number of second order correction steps.
Number reference_penalty_function_
Penalty function at the point with respect to which progress is to be made.
virtual bool InitializeImpl(const OptionsList &options, const std::string &prefix)
InitializeImpl - overloaded from AlgorithmStrategyObject.
Number eta_penalty_
Relaxation factor in the Armijo condition for the penalty function.
virtual bool RestoredIterate()
Method for telling the BacktrackingLineSearch object that a previous iterate has been restored...
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
virtual ~CGPenaltyLSAcceptor()
Default destructor.
Base class for backtracking line search acceptors.
bool never_use_piecewise_penalty_ls_
Flag for whether or not use piecewise penalty line search.
Index ls_counter_
counter for cut backs in the line search
virtual Number CalculateAlphaMin()
Method returning the lower bound on the trial step sizes.
Number kappa_soc_
Required reduction in constraint violation before trying multiple second order correction steps ...
virtual char UpdateForNextIteration(Number alpha_primal_test)
Method for ending the current line search.
SmartPtr< const IteratesVector > watchdog_delta_cgpen_
Backup for the Chen-Goldfarb search direction (needed in the update rule for the penalty parameter...
Number mult_diverg_feasibility_tol_
Check if the multpliers are diverging.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
virtual void StartWatchDog()
Method for setting internal data if the watchdog procedure is started.
This class stores a list of user set options.
Class to organize all the additional data required by the Chen-Goldfarb penalty function algorithm...
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for OptionsList.
bool ArmijoHolds(Number alpha_primal_test)
Check if the trial point is acceptable by the Armijo condition.
virtual bool NeverRestorationPhase()
Method for telling the BacktrackingLineSearch object that the restoration is not needed.
Class for all Chen-Goldfarb penalty method specific calculated quantities.
virtual bool TryCorrector(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)
Try higher order corrector (for fast local convergence).
IpoptAdditionalData & AdditionalData()
Get access to additional data object.
bool reset_piecewise_penalty_
Flag indicating whether PiecewisePenalty has to be initiailized.
CGPenaltyCq & CGPenCq()
Method to easily access CGPenalty calculated quantities.
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Number eta_min_
Minimal tolerance for step part in penalty parameter update rule.
Number watchdog_direct_deriv_penalty_function_
Directional derivative of penalty function at the point with respect to which progress is to be made ...
CGPenaltyLSAcceptor(const SmartPtr< PDSystemSolver > &pd_solver)
Constructor.
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
SmartPtr< PDSystemSolver > pd_solver_
virtual bool CheckAcceptabilityOfTrialPoint(Number alpha_primal)
Method for checking if current trial point is acceptable.
Number pen_theta_max_
Upper bound on infeasibility.
void operator=(const CGPenaltyLSAcceptor &)
Overloaded Equals Operator.
Number watchdog_penalty_function_
Penalty function at the point with respect to which progress is to be made (at watchdog point) ...
Number min_alpha_primal_
Min step size that triggers nonmonotone method.
virtual bool TrySecondOrderCorrection(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)
Try a second order correction for the constraints.
Number penalty_update_compl_tol_
Tolerance for complementarity part in penalty parameter update rule.
Line search acceptor, based on the Chen-Goldfarb penalty function approach.
virtual void PrepareRestoPhaseStart()
Method that is called before the restoration phase is called.
IpoptCalculatedQuantities & IpCq() const
virtual bool DoFallback()
Method for doing a fallback approach in case no search direction could be computed.
Number reference_direct_deriv_penalty_function_
Directional derivative of penalty function at the point with respect to which progress is to be made...
virtual void InitThisLineSearch(bool in_watchdog)
Initialization for the next line search.
SmartPtr< const IteratesVector > best_iterate_
Store the iterate with best KKT error found so far.
Number best_KKT_error_
Record the lease KKT error found so far.
Index counter_first_type_penalty_updates_
Counter for increases of penalty parameter.
bool accepted_by_Armijo_
Flag indicating whether the trial point is accepted by the Armijo condition or the PLPF condition...
Class for the Piecewise Penalty.