Ipopt Documentation  
IpBacktrackingLineSearch.hpp
Go to the documentation of this file.
1 // Copyright (C) 2004, 2009 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
6 // Andreas Waechter IBM 2005-10-13
7 // derived file from IpFilterLineSearch.hpp
8 
9 #ifndef __IPBACKTRACKINGLINESEARCH_HPP__
10 #define __IPBACKTRACKINGLINESEARCH_HPP__
11 
12 #include "IpLineSearch.hpp"
14 #include "IpRestoPhase.hpp"
15 #include "IpConvCheck.hpp"
16 
17 namespace Ipopt
18 {
19 
36 {
37 public:
51  const SmartPtr<BacktrackingLSAcceptor>& acceptor,
52  const SmartPtr<RestorationPhase>& resto_phase,
53  const SmartPtr<ConvergenceCheck>& conv_check
54  );
55 
57  virtual ~BacktrackingLineSearch();
59 
61  virtual bool InitializeImpl(
62  const OptionsList& options,
63  const std::string& prefix
64  );
65 
70  virtual void FindAcceptableTrialPoint();
71 
79  virtual void Reset();
80 
94  virtual void SetRigorousLineSearch(
95  bool rigorous
96  )
97  {
98  rigorous_ = rigorous;
99  }
100 
104  virtual bool CheckSkippedLineSearch()
105  {
106  return skipped_line_search_;
107  }
108 
113  virtual bool ActivateFallbackMechanism();
114 
117  static void RegisterOptions(
119  );
121 
122 private:
136  );
137 
139  void operator=(
141  );
143 
152  bool skip_first_trial_point,
153  Number& alpha_primal,
154  bool& corr_taken,
155  bool& soc_taken,
156  Index& n_steps,
157  bool& evaluation_error,
158  SmartPtr<IteratesVector>& actual_delta
159  );
160 
165  void StartWatchDog();
166 
171  void StopWatchDog(
172  SmartPtr<IteratesVector>& actual_delta
173  );
174 
182  Number alpha_primal
183  );
184 
193  void PerformDualStep(
194  Number alpha_primal,
195  Number alpha_dual,
197  );
198 
211  bool TrySoftRestoStep(
212  SmartPtr<IteratesVector>& actual_delta,
213  bool& satisfies_original_criterion
214  );
215 
230  Number alpha_primal_test,
231  Number& alpha_primal,
232  SmartPtr<IteratesVector>& actual_delta
233  );
234 
242  bool TryCorrector(
243  Number alpha_primal_test,
244  Number& alpha_primal,
245  SmartPtr<IteratesVector>& actual_delta
246  );
247 
254  void PerformMagicStep();
255 
262  bool DetectTinyStep();
263 
265  void StoreAcceptablePoint();
266 
271  bool RestoreAcceptablePoint();
272 
280  bool CurrentIsAcceptable();
281 
290 
293  {
304  };
312 
317 
329 
365 
368 
377 
382 
388 
406 
413 
418 
423  bool rigorous_;
424 
429 
436 
439 
444 
447 
454 };
455 
456 } // namespace Ipopt
457 
458 #endif
Ipopt::BacktrackingLineSearch::ActivateFallbackMechanism
virtual bool ActivateFallbackMechanism()
Activate fallback mechanism.
Ipopt::BacktrackingLineSearch::operator=
void operator=(const BacktrackingLineSearch &)
Default Assignment Operator.
Ipopt::BacktrackingLineSearch::fallback_activated_
bool fallback_activated_
Flag indicating whether the algorithm has asked to immediately switch to the fallback mechanism (rest...
Definition: IpBacktrackingLineSearch.hpp:417
Ipopt::BacktrackingLineSearch::watchdog_alpha_primal_test_
Number watchdog_alpha_primal_test_
Step size for Armijo test in watch dog.
Definition: IpBacktrackingLineSearch.hpp:398
Ipopt::BacktrackingLineSearch::CurrentIsAcceptable
bool CurrentIsAcceptable()
Method for determining if the current iterate is acceptable (in the sense of the acceptable_tol optio...
Ipopt::BacktrackingLineSearch::watchdog_shortened_iter_trigger_
Index watchdog_shortened_iter_trigger_
Number of shortened iterations that trigger the watchdog.
Definition: IpBacktrackingLineSearch.hpp:381
Ipopt::BacktrackingLineSearch::tiny_step_y_tol_
Number tiny_step_y_tol_
Tolerance for y variables for the tiny step stopping heuristic.
Definition: IpBacktrackingLineSearch.hpp:376
Ipopt::BacktrackingLineSearch::PRIMAL_AND_FULL_ALPHA_FOR_Y
@ PRIMAL_AND_FULL_ALPHA_FOR_Y
Definition: IpBacktrackingLineSearch.hpp:301
Ipopt::BacktrackingLineSearch::DetectTinyStep
bool DetectTinyStep()
Detect if the search direction is too small.
Ipopt::BacktrackingLineSearch::expect_infeasible_problem_
bool expect_infeasible_problem_
Indicates whether problem can be expected to be infeasible.
Definition: IpBacktrackingLineSearch.hpp:349
Ipopt::BacktrackingLineSearch::accept_after_max_steps_
Index accept_after_max_steps_
Maximal number of trial steps before we blindly accept trial point.
Definition: IpBacktrackingLineSearch.hpp:342
Ipopt::BacktrackingLineSearch::FindAcceptableTrialPoint
virtual void FindAcceptableTrialPoint()
Perform the line search.
Ipopt::BacktrackingLineSearch::resto_phase_
SmartPtr< RestorationPhase > resto_phase_
Definition: IpBacktrackingLineSearch.hpp:451
Ipopt::BacktrackingLineSearch::soft_resto_counter_
Index soft_resto_counter_
Counter for iteration performed in soft restoration phase in a row.
Definition: IpBacktrackingLineSearch.hpp:438
Ipopt::BacktrackingLineSearch::DUAL_AND_FULL_ALPHA_FOR_Y
@ DUAL_AND_FULL_ALPHA_FOR_Y
Definition: IpBacktrackingLineSearch.hpp:302
Ipopt::BacktrackingLineSearch::RestoreAcceptablePoint
bool RestoreAcceptablePoint()
Restore acceptable point into the current fields of IpData if found.
Ipopt::BacktrackingLineSearch::soft_resto_pderror_reduction_factor_
Number soft_resto_pderror_reduction_factor_
Reduction factor for the restoration phase that accepts steps reducing the optimality error ("soft re...
Definition: IpBacktrackingLineSearch.hpp:323
Ipopt
This file contains a base class for all exceptions and a set of macros to help with exceptions.
Definition: IpInexactAlgBuilder.hpp:13
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:15
Ipopt::BacktrackingLineSearch::conv_check_
SmartPtr< ConvergenceCheck > conv_check_
Definition: IpBacktrackingLineSearch.hpp:452
Ipopt::BacktrackingLineSearch::start_with_resto_
bool start_with_resto_
Indicates whether the algorithm should start directly with the restoration phase.
Definition: IpBacktrackingLineSearch.hpp:386
Ipopt::BacktrackingLineSearch::TrySoftRestoStep
bool TrySoftRestoStep(SmartPtr< IteratesVector > &actual_delta, bool &satisfies_original_criterion)
Try a step for the soft restoration phase and check if it is acceptable.
Ipopt::BacktrackingLineSearch
General implementation of a backtracking line search.
Definition: IpBacktrackingLineSearch.hpp:35
Ipopt::BacktrackingLineSearch::alpha_red_factor_
Number alpha_red_factor_
factor by which search direction is to be shortened if trial point is rejected.
Definition: IpBacktrackingLineSearch.hpp:289
Ipopt::LineSearch
Base class for line search objects.
Definition: IpLineSearch.hpp:17
Ipopt::BacktrackingLineSearch::accept_every_trial_step_
bool accept_every_trial_step_
Flag indicating whether the line search should always accept the full (fraction-to-the-boundary) step...
Definition: IpBacktrackingLineSearch.hpp:335
IpBacktrackingLSAcceptor.hpp
Ipopt::BacktrackingLineSearch::alpha_for_y_tol_
Number alpha_for_y_tol_
Tolerance for primal step to switch to full equality constraint multiplier steps.
Definition: IpBacktrackingLineSearch.hpp:316
Ipopt::BacktrackingLineSearch::watchdog_trial_iter_max_
Index watchdog_trial_iter_max_
Number of watch dog trial steps.
Definition: IpBacktrackingLineSearch.hpp:379
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
Ipopt::BacktrackingLineSearch::BacktrackingLineSearch
BacktrackingLineSearch(const SmartPtr< BacktrackingLSAcceptor > &acceptor, const SmartPtr< RestorationPhase > &resto_phase, const SmartPtr< ConvergenceCheck > &conv_check)
Constructor.
Ipopt::BacktrackingLineSearch::Reset
virtual void Reset()
Reset the line search.
Ipopt::BacktrackingLineSearch::expect_infeasible_problem_ytol_
Number expect_infeasible_problem_ytol_
Trigger tolerance on constraint multipliers.
Definition: IpBacktrackingLineSearch.hpp:364
Ipopt::BacktrackingLineSearch::FULL_STEP_FOR_Y
@ FULL_STEP_FOR_Y
Definition: IpBacktrackingLineSearch.hpp:298
Ipopt::BacktrackingLineSearch::watchdog_delta_
SmartPtr< const IteratesVector > watchdog_delta_
Watchdog search direction at reference point.
Definition: IpBacktrackingLineSearch.hpp:402
Ipopt::BacktrackingLineSearch::watchdog_shortened_iter_
Index watchdog_shortened_iter_
Counter for shortened iterations.
Definition: IpBacktrackingLineSearch.hpp:394
IpRestoPhase.hpp
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:171
Ipopt::BacktrackingLineSearch::rigorous_
bool rigorous_
Flag indicating whether the line search is to be performed robust (usually this is true,...
Definition: IpBacktrackingLineSearch.hpp:423
Ipopt::BacktrackingLineSearch::max_soft_resto_iters_
Index max_soft_resto_iters_
Maximal number of iterations that can be done in the soft iteration phase before the algorithm revert...
Definition: IpBacktrackingLineSearch.hpp:328
Ipopt::BacktrackingLineSearch::StoreAcceptablePoint
void StoreAcceptablePoint()
Store current iterate as acceptable point.
Ipopt::BacktrackingLineSearch::SetRigorousLineSearch
virtual void SetRigorousLineSearch(bool rigorous)
Set flag indicating whether a very rigorous line search should be performed.
Definition: IpBacktrackingLineSearch.hpp:94
Ipopt::BacktrackingLineSearch::watchdog_iterate_
SmartPtr< const IteratesVector > watchdog_iterate_
Watchdog reference iterate.
Definition: IpBacktrackingLineSearch.hpp:400
Ipopt::BacktrackingLineSearch::DoBacktrackingLineSearch
bool DoBacktrackingLineSearch(bool skip_first_trial_point, Number &alpha_primal, bool &corr_taken, bool &soc_taken, Index &n_steps, bool &evaluation_error, SmartPtr< IteratesVector > &actual_delta)
Method performing the backtracking line search.
Ipopt::BacktrackingLineSearch::CheckAcceptabilityOfTrialPoint
bool CheckAcceptabilityOfTrialPoint(Number alpha_primal)
Method for checking if current trial point is acceptable.
Ipopt::BacktrackingLineSearch::StopWatchDog
void StopWatchDog(SmartPtr< IteratesVector > &actual_delta)
Method for stopping the watch dog.
Ipopt::BacktrackingLineSearch::TrySecondOrderCorrection
bool TrySecondOrderCorrection(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)
Try a second order correction for the constraints.
Ipopt::BacktrackingLineSearch::MIN_DUAL_INFEAS_ALPHA_FOR_Y
@ MIN_DUAL_INFEAS_ALPHA_FOR_Y
Definition: IpBacktrackingLineSearch.hpp:299
Ipopt::BacktrackingLineSearch::acceptable_iterate_
SmartPtr< const IteratesVector > acceptable_iterate_
Definition: IpBacktrackingLineSearch.hpp:410
Ipopt::BacktrackingLineSearch::CheckSkippedLineSearch
virtual bool CheckSkippedLineSearch()
Check if the line search procedure didn't accept a new iterate during the last call of FindAcceptable...
Definition: IpBacktrackingLineSearch.hpp:104
Ipopt::BacktrackingLineSearch::StartWatchDog
void StartWatchDog()
Method for starting the watch dog.
Ipopt::BacktrackingLineSearch::PerformDualStep
void PerformDualStep(Number alpha_primal, Number alpha_dual, SmartPtr< IteratesVector > &delta)
Method for setting the dual variables in the trial fields in IpData, given the search direction.
Ipopt::BacktrackingLineSearch::MAX_ALPHA_FOR_Y
@ MAX_ALPHA_FOR_Y
Definition: IpBacktrackingLineSearch.hpp:297
Ipopt::BacktrackingLineSearch::AlphaForYEnum
AlphaForYEnum
enumeration for the different alpha_for_y_ settings
Definition: IpBacktrackingLineSearch.hpp:292
Ipopt::BacktrackingLineSearch::alpha_for_y_
AlphaForYEnum alpha_for_y_
Flag indicating whether the dual step size is to be used for the equality constraint multipliers.
Definition: IpBacktrackingLineSearch.hpp:311
Ipopt::BacktrackingLineSearch::RegisterOptions
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for OptionsList.
Ipopt::BacktrackingLineSearch::magic_steps_
bool magic_steps_
Flag indicating whether magic steps should be used.
Definition: IpBacktrackingLineSearch.hpp:331
IpLineSearch.hpp
Ipopt::BacktrackingLineSearch::expect_infeasible_problem_ctol_
Number expect_infeasible_problem_ctol_
Tolerance on constraint violation for expect_infeasible_problem heuristic.
Definition: IpBacktrackingLineSearch.hpp:357
Ipopt::BacktrackingLineSearch::tiny_step_last_iteration_
bool tiny_step_last_iteration_
Flag indicating if a tiny step was detected in previous iteration.
Definition: IpBacktrackingLineSearch.hpp:446
Ipopt::BacktrackingLineSearch::DUAL_ALPHA_FOR_Y
@ DUAL_ALPHA_FOR_Y
Definition: IpBacktrackingLineSearch.hpp:295
Ipopt::BacktrackingLineSearch::TryCorrector
bool TryCorrector(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)
Try higher order corrector (for fast local convergence).
IpConvCheck.hpp
Ipopt::BacktrackingLineSearch::PRIMAL_ALPHA_FOR_Y
@ PRIMAL_ALPHA_FOR_Y
Definition: IpBacktrackingLineSearch.hpp:294
Ipopt::BacktrackingLineSearch::watchdog_trial_iter_
Index watchdog_trial_iter_
Counter for watch dog iterations.
Definition: IpBacktrackingLineSearch.hpp:396
Ipopt::BacktrackingLineSearch::acceptable_iteration_number_
Index acceptable_iteration_number_
Definition: IpBacktrackingLineSearch.hpp:411
Ipopt::BacktrackingLineSearch::in_soft_resto_phase_
bool in_soft_resto_phase_
Flag indicating whether we are currently in the "soft" restoration phase mode, in which steps are acc...
Definition: IpBacktrackingLineSearch.hpp:435
Ipopt::BacktrackingLineSearch::skipped_line_search_
bool skipped_line_search_
Flag indicating whether no acceptable trial point was found during last line search.
Definition: IpBacktrackingLineSearch.hpp:428
Ipopt::BacktrackingLineSearch::~BacktrackingLineSearch
virtual ~BacktrackingLineSearch()
Destructor.
Ipopt::BacktrackingLineSearch::in_watchdog_
bool in_watchdog_
Flag indicating if the watchdog is active.
Definition: IpBacktrackingLineSearch.hpp:392
Ipopt::OptionsList
This class stores a list of user set options.
Definition: IpOptionsList.hpp:32
Ipopt::BacktrackingLineSearch::SAFE_MIN_DUAL_INFEAS_ALPHA_FOR_Y
@ SAFE_MIN_DUAL_INFEAS_ALPHA_FOR_Y
Definition: IpBacktrackingLineSearch.hpp:300
Ipopt::BacktrackingLineSearch::tiny_step_tol_
Number tiny_step_tol_
Tolerance for detecting tiny steps.
Definition: IpBacktrackingLineSearch.hpp:367
Ipopt::BacktrackingLineSearch::MIN_ALPHA_FOR_Y
@ MIN_ALPHA_FOR_Y
Definition: IpBacktrackingLineSearch.hpp:296
Ipopt::BacktrackingLineSearch::LSACCEPTOR_ALPHA_FOR_Y
@ LSACCEPTOR_ALPHA_FOR_Y
Definition: IpBacktrackingLineSearch.hpp:303
Ipopt::BacktrackingLineSearch::count_successive_shortened_steps_
Index count_successive_shortened_steps_
Counter for the number of successive iterations in which the full step was not accepted.
Definition: IpBacktrackingLineSearch.hpp:443
Ipopt::BacktrackingLineSearch::last_mu_
Number last_mu_
Barrier parameter value during last line search.
Definition: IpBacktrackingLineSearch.hpp:404
Ipopt::BacktrackingLineSearch::PerformMagicStep
void PerformMagicStep()
Perform magic steps.
Ipopt::BacktrackingLineSearch::acceptor_
SmartPtr< BacktrackingLSAcceptor > acceptor_
Definition: IpBacktrackingLineSearch.hpp:450
Ipopt::BacktrackingLineSearch::InitializeImpl
virtual bool InitializeImpl(const OptionsList &options, const std::string &prefix)
InitializeImpl - overloaded from AlgorithmStrategyObject.