Ipopt Documentation  
IpBacktrackingLSAcceptor.hpp
Go to the documentation of this file.
1 // Copyright (C) 2004, 2007 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 __IPBACKTRACKINGLSACCEPTOR_HPP__
10 #define __IPBACKTRACKINGLSACCEPTOR_HPP__
11 
12 #include "IpAlgStrategy.hpp"
13 
14 namespace Ipopt
15 {
16 
19 {
20 public:
22 
25  { }
26 
29  { }
31 
32  virtual bool InitializeImpl(
33  const OptionsList& options,
34  const std::string& prefix
35  ) = 0;
36 
44  virtual void Reset() = 0;
45 
51  virtual void InitThisLineSearch(
52  bool in_watchdog
53  ) = 0;
54 
61  virtual void PrepareRestoPhaseStart() = 0;
62 
69  virtual Number CalculateAlphaMin() = 0;
70 
79  virtual bool CheckAcceptabilityOfTrialPoint(
80  Number alpha_primal
81  ) = 0;
82 
96  virtual bool TrySecondOrderCorrection(
97  Number alpha_primal_test,
98  Number& alpha_primal,
99  SmartPtr<IteratesVector>& actual_delta
100  ) = 0;
101 
109  virtual bool TryCorrector(
110  Number alpha_primal_test,
111  Number& alpha_primal,
112  SmartPtr<IteratesVector>& actual_delta
113  ) = 0;
114 
124  virtual char UpdateForNextIteration(
125  Number alpha_primal_test
126  ) = 0;
127 
129  virtual void StartWatchDog() = 0;
130 
132  virtual void StopWatchDog() = 0;
133 
137  virtual bool RestoredIterate()
138  {
139  return false;
140  }
141 
145  virtual bool NeverRestorationPhase()
146  {
147  return false;
148  }
149 
157  virtual bool DoFallback()
158  {
159  return false;
160  }
161 
168  Number /*alpha_primal*/,
169  Number /*alpha_dual*/,
170  SmartPtr<IteratesVector>& /*delta*/
171  )
172  {
173  THROW_EXCEPTION(OPTION_INVALID, "Value \"acceptor\" for option \"alpha_for_y\" not valid for this line search.");
174  return -1.;
175  }
176 
180  virtual bool HasComputeAlphaForY() const
181  {
182  return false;
183  }
184 
186  static void RegisterOptions(
189  );
191 
192 private:
202 
206  );
207 
209  void operator=(
211  );
213 };
214 
215 } // namespace Ipopt
216 
217 #endif
virtual bool CheckAcceptabilityOfTrialPoint(Number alpha_primal)=0
Method for checking if current trial point is acceptable.
This is the base class for all algorithm strategy objects.
double Number
Type of all numbers.
Definition: IpTypes.hpp:15
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for OptionsList.
Base class for backtracking line search acceptors.
virtual char UpdateForNextIteration(Number alpha_primal_test)=0
Method for ending the current line search.
virtual void StopWatchDog()=0
Method for setting internal data if the watchdog procedure is stopped.
This file contains a base class for all exceptions and a set of macros to help with exceptions...
virtual bool TrySecondOrderCorrection(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)=0
Try a second order correction for the constraints.
virtual void PrepareRestoPhaseStart()=0
Method that is called before the restoration phase is called.
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:171
This class stores a list of user set options.
virtual bool InitializeImpl(const OptionsList &options, const std::string &prefix)=0
Implementation of the initialization method that has to be overloaded by for each derived class...
virtual bool HasComputeAlphaForY() const
Method returning true of ComputeAlphaForY is implemented for this acceptor.
virtual void InitThisLineSearch(bool in_watchdog)=0
Initialization for the next line search.
void operator=(const BacktrackingLSAcceptor &)
Default Assignment Operator.
virtual void StartWatchDog()=0
Method for setting internal data if the watchdog procedure is started.
virtual ~BacktrackingLSAcceptor()
Destructor.
virtual Number CalculateAlphaMin()=0
Method returning the lower bound on the trial step sizes.
virtual bool NeverRestorationPhase()
Method called by BacktrackingLineSearch object to determine whether the restoration phase should neve...
virtual bool TryCorrector(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)=0
Try higher order corrector (for fast local convergence).
virtual void Reset()=0
Reset the acceptor.
virtual Number ComputeAlphaForY(Number, Number, SmartPtr< IteratesVector > &)
Method for computing the step for the constraint multipliers in the line search acceptor method...
#define THROW_EXCEPTION(__except_type, __msg)
virtual bool DoFallback()
Method for doing a fallback approach in case no search direction could be computed.
virtual bool RestoredIterate()
Method for telling the BacktrackingLineSearch object that a previous iterate has been restored...