Ipopt 3.11.9
Loading...
Searching...
No Matches
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// $Id: IpBacktrackingLineSearch.hpp 1861 2010-12-21 21:34:47Z andreasw $
6//
7// Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8// Andreas Waechter IBM 2005-10-13
9// derived file from IpFilterLineSearch.hpp
10
11#ifndef __IPBACKTRACKINGLINESEARCH_HPP__
12#define __IPBACKTRACKINGLINESEARCH_HPP__
13
14#include "IpLineSearch.hpp"
16#include "IpRestoPhase.hpp"
17#include "IpConvCheck.hpp"
18
19namespace Ipopt
20{
21
37 {
38 public:
49 const SmartPtr<RestorationPhase>& resto_phase,
50 const SmartPtr<ConvergenceCheck>& conv_check
51 );
52
56
58 virtual bool InitializeImpl(const OptionsList& options,
59 const std::string& prefix);
60
65
72 virtual void Reset();
73
85 virtual void SetRigorousLineSearch(bool rigorous)
86 {
87 rigorous_ = rigorous;
88 }
89
95 {
97 }
98
102
107
108 private:
119
123
128 bool DoBacktrackingLineSearch(bool skip_first_trial_point,
129 Number& alpha_primal,
130 bool& corr_taken,
131 bool& soc_taken,
132 Index& n_steps,
133 bool& evaluation_error,
134 SmartPtr<IteratesVector>& actual_delta);
135
139
143
150
156 void PerformDualStep(Number alpha_primal,
157 Number alpha_dual,
159
170 bool &satisfies_original_criterion);
171
183 bool TrySecondOrderCorrection(Number alpha_primal_test,
184 Number& alpha_primal,
185 SmartPtr<IteratesVector>& actual_delta);
186
193 bool TryCorrector(Number alpha_primal_test,
194 Number& alpha_primal,
195 SmartPtr<IteratesVector>& actual_delta);
196
202
207
210
214
220
226
246
250
259
284
287
293
298
303
321
328
332
338
342
348
352
356
360
367 };
368
369} // namespace Ipopt
370
371#endif
General implementation of a backtracking line search.
SmartPtr< const IteratesVector > watchdog_delta_
Watchdog search direction at reference point.
Index watchdog_shortened_iter_trigger_
Number of shortened iterations that trigger the watchdog.
Number tiny_step_y_tol_
Tolerance for y variables for the tiny step stopping heuristic.
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.
void operator=(const BacktrackingLineSearch &)
Overloaded Equals Operator.
Number tiny_step_tol_
Tolerance for detecting tiny steps.
Number alpha_red_factor_
factor by which search direction is to be shortened if trial point is rejected.
bool CheckAcceptabilityOfTrialPoint(Number alpha_primal)
Method for checking if current trial point is acceptable.
Number last_mu_
Barrier parameter value during last line search.
void StoreAcceptablePoint()
Store current iterate as acceptable point.
virtual void FindAcceptableTrialPoint()
Perform the line search.
bool skipped_line_search_
Flag indicating whether no acceptable trial point was found during last line search.
bool in_soft_resto_phase_
Flag indicating whether we are currently in the "soft" restoration phase mode, in which steps are acc...
Index watchdog_trial_iter_max_
Number of watch dog trial steps.
bool start_with_resto_
Indicates whether the algorithm should start directly with the restoratin phase.
SmartPtr< ConvergenceCheck > conv_check_
bool TrySoftRestoStep(SmartPtr< IteratesVector > &actual_delta, bool &satisfies_original_criterion)
Try a step for the soft restoration phase and check if it is acceptable.
Index accept_after_max_steps_
Maximal number of trial steps before we blindly accept trial point.
bool DetectTinyStep()
Detect if the search direction is too small.
bool TrySecondOrderCorrection(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)
Try a second order correction for the constraints.
virtual void SetRigorousLineSearch(bool rigorous)
Set flag indicating whether a very rigorous line search should be performed.
BacktrackingLineSearch(const SmartPtr< BacktrackingLSAcceptor > &acceptor, const SmartPtr< RestorationPhase > &resto_phase, const SmartPtr< ConvergenceCheck > &conv_check)
Constructor.
Number alpha_for_y_tol_
Tolerance for primal step to switch to full equality constraint multiplier steps.
AlphaForYEnum alpha_for_y_
Flag indicating whether the dual step size is to be used for the equality constraint multipliers.
Number soft_resto_pderror_reduction_factor_
Reduction factor for the restoration phase that accepts steps reducing the optimality error ("soft re...
Index count_successive_shortened_steps_
Counter for the number of successive iterations in which the full step was not accepted.
bool expect_infeasible_problem_
Indicates whether problem can be expected to be infeasible.
bool accept_every_trial_step_
Flag indicating whether the line search should always accept the full (fraction-to-the-boundary) step...
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.
bool TryCorrector(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)
Try higher order corrector (for fast local convergence).
SmartPtr< const IteratesVector > acceptable_iterate_
void StopWatchDog(SmartPtr< IteratesVector > &actual_delta)
Method for stopping the watch dog.
Number watchdog_alpha_primal_test_
Step size for Armijo test in watch dog.
virtual ~BacktrackingLineSearch()
Default destructor.
bool rigorous_
Flag indicating whether the line search is to be performed robust (usually this is true,...
SmartPtr< BacktrackingLSAcceptor > acceptor_
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for OptionsList.
BacktrackingLineSearch(const BacktrackingLineSearch &)
Copy Constructor.
bool tiny_step_last_iteration_
Flag indicating if a tiny step was detected in previous iteration.
bool RestoreAcceptablePoint()
Restore acceptable point into the current fields of IpData if found.
bool fallback_activated_
Flag indicating whether the algorithm has asked to immediately switch to the fallback mechanism (rest...
void PerformMagicStep()
Perform magic steps.
Number expect_infeasible_problem_ctol_
Tolerance on constraint violation for expect_infeasible_problem heuristic.
bool in_watchdog_
Flag indicating if the watchdog is active.
virtual void Reset()
Reset the line search.
bool magic_steps_
Flag indicating whether magic steps should be used.
virtual bool CheckSkippedLineSearch()
Check if the line search procedure didn't accept a new iterate during the last call of FindAcceptable...
SmartPtr< const IteratesVector > watchdog_iterate_
Watchdog reference iterate.
SmartPtr< RestorationPhase > resto_phase_
void StartWatchDog()
Method for starting the watch dog.
Index watchdog_shortened_iter_
Counter for shortened iterations.
virtual bool ActivateFallbackMechanism()
Activate fallback mechanism.
Index max_soft_resto_iters_
Maximal number of iterations that can be done in the soft iteration phase before the algorithm revert...
Number expect_infeasible_problem_ytol_
Trigger tolerance on constraint multipliers.
Index soft_resto_counter_
Counter for iteration performed in soft restoration phase in a row.
virtual bool InitializeImpl(const OptionsList &options, const std::string &prefix)
InitializeImpl - overloaded from AlgorithmStrategyObject.
AlphaForYEnum
enumeration for the different alpha_for_y_ settings
Index watchdog_trial_iter_
Counter for watch dog iterations.
bool CurrentIsAcceptable()
Method for determining if the current iterate is acceptable (in the sense of the acceptable_tol optio...
Base class for line search objects.
This class stores a list of user set options.
Template class for Smart Pointers.
int Index
Type of all indices of vectors, matrices etc.
Definition IpTypes.hpp:19
double Number
Type of all numbers.
Definition IpTypes.hpp:17