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:
39 
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 
120  void StopWatchDog();
121 
123  static void RegisterOptions(
126  );
128 
129 private:
139 
143  );
144 
146  void operator=(
148  );
150 
159  bool skip_first_trial_point,
160  Number& alpha_primal,
161  bool& corr_taken,
162  bool& soc_taken,
163  Index& n_steps,
164  bool& evaluation_error,
165  SmartPtr<IteratesVector>& actual_delta
166  );
167 
172  void StartWatchDog();
173 
178  void StopWatchDog(
179  SmartPtr<IteratesVector>& actual_delta
180  );
181 
189  Number alpha_primal
190  );
191 
200  void PerformDualStep(
201  Number alpha_primal,
202  Number alpha_dual,
204  );
205 
218  bool TrySoftRestoStep(
219  SmartPtr<IteratesVector>& actual_delta,
220  bool& satisfies_original_criterion
221  );
222 
237  Number alpha_primal_test,
238  Number& alpha_primal,
239  SmartPtr<IteratesVector>& actual_delta
240  );
241 
249  bool TryCorrector(
250  Number alpha_primal_test,
251  Number& alpha_primal,
252  SmartPtr<IteratesVector>& actual_delta
253  );
254 
261  void PerformMagicStep();
262 
269  bool DetectTinyStep();
270 
272  void StoreAcceptablePoint();
273 
278  bool RestoreAcceptablePoint();
279 
287  bool CurrentIsAcceptable();
288 
293 
297 
300  {
311  };
319 
324 
336 
372 
375 
384 
389 
394 
398 
400 
416 
423 
428 
433  bool rigorous_;
434 
439 
446 
449 
454 
457 
464 };
465 
466 } // namespace Ipopt
467 
468 #endif
bool rigorous_
Flag indicating whether the line search is to be performed robust (usually this is true...
AlphaForYEnum
enumeration for the different alpha_for_y_ settings
bool start_with_resto_
Indicates whether the algorithm should start directly with the restoration phase. ...
Number tiny_step_tol_
Tolerance for detecting tiny steps.
SmartPtr< const IteratesVector > watchdog_delta_
Watchdog search direction at reference point.
Index count_successive_shortened_steps_
Counter for the number of successive iterations in which the full step was not accepted.
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...
void StopWatchDog()
Stop watch dog if started and restore iterate from before watchdog started.
SmartPtr< const IteratesVector > watchdog_iterate_
Watchdog reference iterate.
Number alpha_red_factor_
factor by which search direction is to be shortened if trial point is rejected.
virtual void SetRigorousLineSearch(bool rigorous)
Set flag indicating whether a very rigorous line search should be performed.
Index max_soft_resto_iters_
Maximal number of iterations that can be done in the soft iteration phase before the algorithm revert...
bool TryCorrector(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)
Try higher order corrector (for fast local convergence).
bool tiny_step_last_iteration_
Flag indicating if a tiny step was detected in previous iteration.
bool CheckAcceptabilityOfTrialPoint(Number alpha_primal)
Method for checking if current trial point is acceptable.
bool fallback_activated_
Flag indicating whether the algorithm has asked to immediately switch to the fallback mechanism (rest...
Number tiny_step_y_tol_
Tolerance for y variables for the tiny step stopping heuristic.
Index accept_after_max_steps_
Maximal number of trial steps before we blindly accept trial point.
ipindex Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:20
This file contains a base class for all exceptions and a set of macros to help with exceptions...
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.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:164
SmartPtr< RestorationPhase > resto_phase_
virtual ~BacktrackingLineSearch()
Destructor.
bool TrySecondOrderCorrection(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)
Try a second order correction for the constraints.
This class stores a list of user set options.
SmartPtr< const IteratesVector > acceptable_iterate_
void operator=(const BacktrackingLineSearch &)
Default Assignment Operator.
virtual void Reset()
Reset the line search.
Number last_mu_
Barrier parameter value during last line search.
BacktrackingLineSearch(const SmartPtr< BacktrackingLSAcceptor > &acceptor, const SmartPtr< RestorationPhase > &resto_phase, const SmartPtr< ConvergenceCheck > &conv_check)
Constructor.
void StartWatchDog()
Method for starting the watch dog.
Index watchdog_trial_iter_
Counter for watch dog iterations.
General implementation of a backtracking line search.
Index watchdog_shortened_iter_
Counter for shortened iterations.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for OptionsList.
bool RestoreAcceptablePoint()
Restore acceptable point into the current fields of IpData if found.
bool in_soft_resto_phase_
Flag indicating whether we are currently in the "soft" restoration phase mode, in which steps are acc...
Number alpha_for_y_tol_
Tolerance for primal step to switch to full equality constraint multiplier steps. ...
Number expect_infeasible_problem_ctol_
Tolerance on constraint violation for expect_infeasible_problem heuristic.
ipnumber Number
Type of all numbers.
Definition: IpTypes.hpp:17
bool skipped_line_search_
Flag indicating whether no acceptable trial point was found during last line search.
Index watchdog_shortened_iter_trigger_
Number of shortened iterations that trigger the watchdog.
SmartPtr< ConvergenceCheck > conv_check_
virtual bool InitializeImpl(const OptionsList &options, const std::string &prefix)
InitializeImpl - overloaded from AlgorithmStrategyObject.
Number soft_resto_pderror_reduction_factor_
Reduction factor for the restoration phase that accepts steps reducing the optimality error ("soft re...
bool CurrentIsAcceptable()
Method for determining if the current iterate is acceptable (in the sense of the acceptable_tol optio...
virtual bool CheckSkippedLineSearch()
Check if the line search procedure didn&#39;t accept a new iterate during the last call of FindAcceptable...
Number constr_viol_tol_
unscaled constraint violation tolerance
AlphaForYEnum alpha_for_y_
Flag indicating whether the dual step size is to be used for the equality constraint multipliers...
Index soft_resto_counter_
Counter for iteration performed in soft restoration phase in a row.
Number expect_infeasible_problem_ytol_
Trigger tolerance on constraint multipliers.
void StoreAcceptablePoint()
Store current iterate as acceptable point.
bool in_watchdog_
Flag indicating if the watchdog is active.
Base class for line search objects.
bool DetectTinyStep()
Detect if the search direction is too small.
bool magic_steps_
Flag indicating whether magic steps should be used.
bool TrySoftRestoStep(SmartPtr< IteratesVector > &actual_delta, bool &satisfies_original_criterion)
Try a step for the soft restoration phase and check if it is acceptable.
virtual bool ActivateFallbackMechanism()
Activate fallback mechanism.
SmartPtr< BacktrackingLSAcceptor > acceptor_
Index watchdog_trial_iter_max_
Number of watch dog trial steps.
virtual void FindAcceptableTrialPoint()
Perform the line search.
void PerformMagicStep()
Perform magic steps.
Number watchdog_alpha_primal_test_
Step size for Armijo test in watch dog.
bool accept_every_trial_step_
Flag indicating whether the line search should always accept the full (fraction-to-the-boundary) step...
bool expect_infeasible_problem_
Indicates whether problem can be expected to be infeasible.