Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

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"
13 #include "IpBacktrackingLSAcceptor.hpp"
14 #include "IpPDSystemSolver.hpp"
15 #include "IpIpoptAlg.hpp"
16 #include "IpCGPenaltyCq.hpp"
17
18 namespace Ipopt
19 {
20
23 class CGPenaltyLSAcceptor : public BacktrackingLSAcceptor
24 {
25 public:
31 CGPenaltyLSAcceptor(const SmartPtr<PDSystemSolver>& pd_solver);
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:
139 CGPenaltyLSAcceptor(const CGPenaltyLSAcceptor&);
140
142 void operator=(const CGPenaltyLSAcceptor&);
144
146 CGPenaltyData& CGPenData()
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
155 CGPenaltyCq& CGPenCq()
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
183 Number eta_penalty_;
186 Number penalty_update_infeasibility_tol_;
189 Number eta_min_;
192 Number penalty_update_compl_tol_;
193 Number chi_hat_;
194 Number chi_tilde_;
195 Number chi_cup_;
196 Number gamma_hat_;
197 Number gamma_tilde_;
198 Number penalty_max_;
199 Number epsilon_c_;
201 Number piecewisepenalty_gamma_obj_;
202 Number piecewisepenalty_gamma_infeasi_;
204
205 Number pen_theta_max_;
206 Number pen_theta_max_fact_;
208 // Number used to indicate that mu has been decreased
209 Number pen_curr_mu_;
210
212 Number theta_min_;
213
217 bool accepted_by_Armijo_;
218
220 Number min_alpha_primal_;
221
223 /*Initial constraint violation*/
224 Number reference_theta_;
226
227 Index max_soc_;
231 Number kappa_soc_;
233
234 Index counter_first_type_penalty_updates_;
235 Index counter_second_type_penalty_updates_;
237 Number curr_eta_;
238
240 Index ls_counter_;
242 Number best_KKT_error_;
244 SmartPtr<const IteratesVector> best_iterate_;
246 Number mult_diverg_feasibility_tol_;
247 Number mult_diverg_y_tol_;
248
253 Number reference_penalty_function_;
256 Number reference_direct_deriv_penalty_function_;
257 Number reference_curr_direct_f_nrm_;
260 Number watchdog_penalty_function_;
263 Number watchdog_direct_deriv_penalty_function_;
266 SmartPtr<const IteratesVector> watchdog_delta_cgpen_;
268
269 bool never_use_piecewise_penalty_ls_;
270 // piecewise penalty list
271 PiecewisePenalty PiecewisePenalty_;
273 bool reset_piecewise_penalty_;
274
275 Index jump_for_tiny_step_;
276
279 SmartPtr<PDSystemSolver> pd_solver_;
281 };
282
283
284
285
286
287 } // namespace Ipopt
288
289 #endif
Ipopt::CGPenaltyLSAcceptor::StopWatchDog
virtual void StopWatchDog()
Method for setting internal data if the watchdog procedure is stopped.
Ipopt::CGPenaltyLSAcceptor::piecewisepenalty_gamma_obj_
Number piecewisepenalty_gamma_obj_
Parameters for piecewise penalty acceptor.
Definition: IpCGPenaltyLSAcceptor.hpp:201
Ipopt::CGPenaltyLSAcceptor::CGPenData
CGPenaltyData & CGPenData()
Method to easily access CGPenalty data.
Definition: IpCGPenaltyLSAcceptor.hpp:146
Ipopt::CGPenaltyLSAcceptor::IsAcceptableToPiecewisePenalty
bool IsAcceptableToPiecewisePenalty(Number alpha_primal_test)
Check if the trial point is acceptable to the piecewise penalty list.
Ipopt::CGPenaltyLSAcceptor::Compare_le
static bool Compare_le(Number lhs, Number rhs, Number BasVal)
Check comparison &quot;lhs &lt;= rhs&quot;, using machine precision based on BasVal.
Ipopt::CGPenaltyLSAcceptor::penalty_update_infeasibility_tol_
Number penalty_update_infeasibility_tol_
Tolerance for infeasibility part in penalty parameter update rule.
Definition: IpCGPenaltyLSAcceptor.hpp:186
Ipopt::CGPenaltyLSAcceptor::theta_min_
Number theta_min_
Parameters deciding when the piecewise penalty acceptor shall be closed.
Definition: IpCGPenaltyLSAcceptor.hpp:212
Ipopt::CGPenaltyLSAcceptor::Reset
virtual void Reset()
Reset the acceptor.
Ipopt::CGPenaltyLSAcceptor::mult_diverg_y_tol_
Number mult_diverg_y_tol_
Definition: IpCGPenaltyLSAcceptor.hpp:247
IpIpoptAlg.hpp
Ipopt::CGPenaltyLSAcceptor::max_soc_
Index max_soc_
Maximal number of second order correction steps.
Definition: IpCGPenaltyLSAcceptor.hpp:227
Ipopt::CGPenaltyLSAcceptor::UpdatePenaltyParameter
char UpdatePenaltyParameter()
Ipopt::CGPenaltyLSAcceptor::reference_penalty_function_
Number reference_penalty_function_
Penalty function at the point with respect to which progress is to be made.
Definition: IpCGPenaltyLSAcceptor.hpp:253
IpPDSystemSolver.hpp
Ipopt::CGPenaltyLSAcceptor::InitializeImpl
virtual bool InitializeImpl(const OptionsList &options, const std::string &prefix)
InitializeImpl - overloaded from AlgorithmStrategyObject.
Ipopt::CGPenaltyLSAcceptor::eta_penalty_
Number eta_penalty_
Relaxation factor in the Armijo condition for the penalty function.
Definition: IpCGPenaltyLSAcceptor.hpp:183
Ipopt::CGPenaltyLSAcceptor::RestoredIterate
virtual bool RestoredIterate()
Method for telling the BacktrackingLineSearch object that a previous iterate has been restored...
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::CGPenaltyLSAcceptor::RestoreBestPoint
bool RestoreBestPoint()
Ipopt::CGPenaltyLSAcceptor::~CGPenaltyLSAcceptor
virtual ~CGPenaltyLSAcceptor()
Default destructor.
Ipopt::BacktrackingLSAcceptor
Base class for backtracking line search acceptors.
Definition: IpBacktrackingLSAcceptor.hpp:21
Ipopt::CGPenaltyLSAcceptor::never_use_piecewise_penalty_ls_
bool never_use_piecewise_penalty_ls_
Flag for whether or not use piecewise penalty line search.
Definition: IpCGPenaltyLSAcceptor.hpp:269
Ipopt::CGPenaltyLSAcceptor::ls_counter_
Index ls_counter_
counter for cut backs in the line search
Definition: IpCGPenaltyLSAcceptor.hpp:240
Ipopt::CGPenaltyLSAcceptor::chi_hat_
Number chi_hat_
Definition: IpCGPenaltyLSAcceptor.hpp:193
Ipopt::CGPenaltyLSAcceptor::MultipliersDiverged
bool MultipliersDiverged()
Ipopt::CGPenaltyLSAcceptor::CalculateAlphaMin
virtual Number CalculateAlphaMin()
Method returning the lower bound on the trial step sizes.
Ipopt::CGPenaltyLSAcceptor::epsilon_c_
Number epsilon_c_
Definition: IpCGPenaltyLSAcceptor.hpp:199
Ipopt::IpoptCalculatedQuantities::AdditionalCq
IpoptAdditionalCq & AdditionalCq()
Definition: IpIpoptCalculatedQuantities.hpp:452
Ipopt::CGPenaltyLSAcceptor::kappa_soc_
Number kappa_soc_
Required reduction in constraint violation before trying multiple second order correction steps ...
Definition: IpCGPenaltyLSAcceptor.hpp:231
Ipopt::CGPenaltyLSAcceptor::gamma_tilde_
Number gamma_tilde_
Definition: IpCGPenaltyLSAcceptor.hpp:197
Ipopt::CGPenaltyLSAcceptor::UpdateForNextIteration
virtual char UpdateForNextIteration(Number alpha_primal_test)
Method for ending the current line search.
Ipopt::CGPenaltyLSAcceptor::jump_for_tiny_step_
Index jump_for_tiny_step_
Definition: IpCGPenaltyLSAcceptor.hpp:275
IpCGPenaltyCq.hpp
Ipopt::CGPenaltyLSAcceptor::watchdog_delta_cgpen_
SmartPtr< const IteratesVector > watchdog_delta_cgpen_
Backup for the Chen-Goldfarb search direction (needed in the update rule for the penalty parameter...
Definition: IpCGPenaltyLSAcceptor.hpp:266
Ipopt::CGPenaltyLSAcceptor::counter_second_type_penalty_updates_
Index counter_second_type_penalty_updates_
Definition: IpCGPenaltyLSAcceptor.hpp:235
Ipopt::CGPenaltyLSAcceptor::mult_diverg_feasibility_tol_
Number mult_diverg_feasibility_tol_
Check if the multpliers are diverging.
Definition: IpCGPenaltyLSAcceptor.hpp:246
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
IpBacktrackingLSAcceptor.hpp
Ipopt::CGPenaltyLSAcceptor::StartWatchDog
virtual void StartWatchDog()
Method for setting internal data if the watchdog procedure is started.
Ipopt::OptionsList
This class stores a list of user set options.
Definition: IpOptionsList.hpp:32
Ipopt::CGPenaltyData
Class to organize all the additional data required by the Chen-Goldfarb penalty function algorithm...
Definition: IpCGPenaltyData.hpp:22
Ipopt::CGPenaltyLSAcceptor::RegisterOptions
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for OptionsList.
Ipopt::CGPenaltyLSAcceptor::curr_eta_
Number curr_eta_
eta parameter
Definition: IpCGPenaltyLSAcceptor.hpp:237
Ipopt::CGPenaltyLSAcceptor::ArmijoHolds
bool ArmijoHolds(Number alpha_primal_test)
Check if the trial point is acceptable by the Armijo condition.
Ipopt::CGPenaltyLSAcceptor::chi_cup_
Number chi_cup_
Definition: IpCGPenaltyLSAcceptor.hpp:195
Ipopt::CGPenaltyLSAcceptor::NeverRestorationPhase
virtual bool NeverRestorationPhase()
Method for telling the BacktrackingLineSearch object that the restoration is not needed.
Ipopt::CGPenaltyCq
Class for all Chen-Goldfarb penalty method specific calculated quantities.
Definition: IpCGPenaltyCq.hpp:22
Ipopt::CGPenaltyLSAcceptor::TryCorrector
virtual bool TryCorrector(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)
Try higher order corrector (for fast local convergence).
Ipopt::IpoptData::AdditionalData
IpoptAdditionalData & AdditionalData()
Get access to additional data object.
Definition: IpIpoptData.hpp:502
Ipopt::CGPenaltyLSAcceptor::reset_piecewise_penalty_
bool reset_piecewise_penalty_
Flag indicating whether PiecewisePenalty has to be initiailized.
Definition: IpCGPenaltyLSAcceptor.hpp:273
Ipopt::CGPenaltyLSAcceptor::CGPenCq
CGPenaltyCq & CGPenCq()
Method to easily access CGPenalty calculated quantities.
Definition: IpCGPenaltyLSAcceptor.hpp:155
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::CGPenaltyLSAcceptor::eta_min_
Number eta_min_
Minimal tolerance for step part in penalty parameter update rule.
Definition: IpCGPenaltyLSAcceptor.hpp:189
Ipopt::CGPenaltyLSAcceptor::pen_curr_mu_
Number pen_curr_mu_
Definition: IpCGPenaltyLSAcceptor.hpp:209
Ipopt::CGPenaltyLSAcceptor::watchdog_direct_deriv_penalty_function_
Number watchdog_direct_deriv_penalty_function_
Directional derivative of penalty function at the point with respect to which progress is to be made ...
Definition: IpCGPenaltyLSAcceptor.hpp:263
Ipopt::CGPenaltyLSAcceptor::gamma_hat_
Number gamma_hat_
Definition: IpCGPenaltyLSAcceptor.hpp:196
Ipopt::CGPenaltyLSAcceptor::CGPenaltyLSAcceptor
CGPenaltyLSAcceptor(const SmartPtr< PDSystemSolver > &pd_solver)
Constructor.
DBG_ASSERT
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
Ipopt::CGPenaltyLSAcceptor::pd_solver_
SmartPtr< PDSystemSolver > pd_solver_
Definition: IpCGPenaltyLSAcceptor.hpp:279
Ipopt::CGPenaltyLSAcceptor::pen_theta_max_fact_
Number pen_theta_max_fact_
Definition: IpCGPenaltyLSAcceptor.hpp:206
Ipopt::CGPenaltyLSAcceptor::CheckAcceptabilityOfTrialPoint
virtual bool CheckAcceptabilityOfTrialPoint(Number alpha_primal)
Method for checking if current trial point is acceptable.
Ipopt::CGPenaltyLSAcceptor::CurrentIsBest
bool CurrentIsBest()
Ipopt::CGPenaltyLSAcceptor::pen_theta_max_
Number pen_theta_max_
Upper bound on infeasibility.
Definition: IpCGPenaltyLSAcceptor.hpp:205
Ipopt::CGPenaltyLSAcceptor::operator=
void operator=(const CGPenaltyLSAcceptor &)
Overloaded Equals Operator.
Ipopt::CGPenaltyLSAcceptor::watchdog_penalty_function_
Number watchdog_penalty_function_
Penalty function at the point with respect to which progress is to be made (at watchdog point) ...
Definition: IpCGPenaltyLSAcceptor.hpp:260
Ipopt::CGPenaltyLSAcceptor::min_alpha_primal_
Number min_alpha_primal_
Min step size that triggers nonmonotone method.
Definition: IpCGPenaltyLSAcceptor.hpp:220
Ipopt::AlgorithmStrategyObject::IpData
IpoptData & IpData() const
Definition: IpAlgStrategy.hpp:131
Ipopt::CGPenaltyLSAcceptor::chi_tilde_
Number chi_tilde_
Definition: IpCGPenaltyLSAcceptor.hpp:194
Ipopt::CGPenaltyLSAcceptor::piecewisepenalty_gamma_infeasi_
Number piecewisepenalty_gamma_infeasi_
Definition: IpCGPenaltyLSAcceptor.hpp:202
Ipopt::CGPenaltyLSAcceptor::TrySecondOrderCorrection
virtual bool TrySecondOrderCorrection(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)
Try a second order correction for the constraints.
Ipopt::CGPenaltyLSAcceptor::StoreBestPoint
void StoreBestPoint()
Ipopt::CGPenaltyLSAcceptor::penalty_max_
Number penalty_max_
Definition: IpCGPenaltyLSAcceptor.hpp:198
Ipopt::CGPenaltyLSAcceptor::penalty_update_compl_tol_
Number penalty_update_compl_tol_
Tolerance for complementarity part in penalty parameter update rule.
Definition: IpCGPenaltyLSAcceptor.hpp:192
Ipopt::CGPenaltyLSAcceptor
Line search acceptor, based on the Chen-Goldfarb penalty function approach.
Definition: IpCGPenaltyLSAcceptor.hpp:23
Ipopt::CGPenaltyLSAcceptor::PrepareRestoPhaseStart
virtual void PrepareRestoPhaseStart()
Method that is called before the restoration phase is called.
Ipopt::AlgorithmStrategyObject::IpCq
IpoptCalculatedQuantities & IpCq() const
Definition: IpAlgStrategy.hpp:137
Ipopt::CGPenaltyLSAcceptor::DoFallback
virtual bool DoFallback()
Method for doing a fallback approach in case no search direction could be computed.
Ipopt::CGPenaltyLSAcceptor::reference_direct_deriv_penalty_function_
Number reference_direct_deriv_penalty_function_
Directional derivative of penalty function at the point with respect to which progress is to be made...
Definition: IpCGPenaltyLSAcceptor.hpp:256
Ipopt::CGPenaltyLSAcceptor::reference_curr_direct_f_nrm_
Number reference_curr_direct_f_nrm_
Definition: IpCGPenaltyLSAcceptor.hpp:257
Ipopt::CGPenaltyLSAcceptor::InitThisLineSearch
virtual void InitThisLineSearch(bool in_watchdog)
Initialization for the next line search.
Ipopt::CGPenaltyLSAcceptor::best_iterate_
SmartPtr< const IteratesVector > best_iterate_
Store the iterate with best KKT error found so far.
Definition: IpCGPenaltyLSAcceptor.hpp:244
Ipopt::CGPenaltyLSAcceptor::PiecewisePenalty_
PiecewisePenalty PiecewisePenalty_
Definition: IpCGPenaltyLSAcceptor.hpp:271
Ipopt::CGPenaltyLSAcceptor::best_KKT_error_
Number best_KKT_error_
Record the lease KKT error found so far.
Definition: IpCGPenaltyLSAcceptor.hpp:242
Ipopt::CGPenaltyLSAcceptor::counter_first_type_penalty_updates_
Index counter_first_type_penalty_updates_
Counter for increases of penalty parameter.
Definition: IpCGPenaltyLSAcceptor.hpp:234
Ipopt::CGPenaltyLSAcceptor::accepted_by_Armijo_
bool accepted_by_Armijo_
Flag indicating whether the trial point is accepted by the Armijo condition or the PLPF condition...
Definition: IpCGPenaltyLSAcceptor.hpp:217
Ipopt::CGPenaltyLSAcceptor::reference_theta_
Number reference_theta_
Definition: IpCGPenaltyLSAcceptor.hpp:224
IpPiecewisePenalty.hpp
Ipopt::PiecewisePenalty
Class for the Piecewise Penalty.
Definition: IpPiecewisePenalty.hpp:39