Ipopt 3.11.9
Loading...
Searching...
No Matches
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// $Id: IpBacktrackingLSAcceptor.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 __IPBACKTRACKINGLSACCEPTOR_HPP__
12#define __IPBACKTRACKINGLSACCEPTOR_HPP__
13
14#include "IpAlgStrategy.hpp"
15
16namespace Ipopt
17{
18
22 {
23 public:
29
32 {}
34
36 virtual bool InitializeImpl(const OptionsList& options,
37 const std::string& prefix)=0;
38
45 virtual void Reset()=0;
46
50 virtual void InitThisLineSearch(bool in_watchdog)=0;
51
56 virtual void PrepareRestoPhaseStart()=0;
57
63
71 virtual bool CheckAcceptabilityOfTrialPoint(Number alpha_primal)=0;
72
84 virtual bool TrySecondOrderCorrection(Number alpha_primal_test,
85 Number& alpha_primal,
86 SmartPtr<IteratesVector>& actual_delta)=0;
87
94 virtual bool TryCorrector(Number alpha_primal_test,
95 Number& alpha_primal,
96 SmartPtr<IteratesVector>& actual_delta)=0;
97
103 virtual char UpdateForNextIteration(Number alpha_primal_test)=0;
104
107 virtual void StartWatchDog()=0;
108
111 virtual void StopWatchDog()=0;
112
115 virtual bool RestoredIterate()
116 {
117 return false;
118 }
119
123 {
124 return false;
125 }
126
131 virtual bool DoFallback()
132 {
133 return false;
134 }
135
139 virtual Number ComputeAlphaForY(Number alpha_primal,
140 Number alpha_dual,
142 {
143 THROW_EXCEPTION(OPTION_INVALID,
144 "Value \"acceptor\" for option \"alpha_for_y\" not valid for this line search.");
145 return -1.;
146 }
147
150 virtual bool HasComputeAlphaForY() const
151 {
152 return false;
153 }
154
159
160 private:
171
175 };
176
177} // namespace Ipopt
178
179#endif
#define THROW_EXCEPTION(__except_type, __msg)
This is the base class for all algorithm strategy objects.
Base class for backtracking line search acceptors.
virtual Number ComputeAlphaForY(Number alpha_primal, Number alpha_dual, SmartPtr< IteratesVector > &delta)
Method for computing the step for the constraint multipliers in the line search acceptor method.
virtual void InitThisLineSearch(bool in_watchdog)=0
Initialization for the next line search.
virtual bool TrySecondOrderCorrection(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)=0
Try a second order correction for the constraints.
virtual bool RestoredIterate()
Method for telling the BacktrackingLineSearch object that a previous iterate has been restored.
virtual char UpdateForNextIteration(Number alpha_primal_test)=0
Method for ending the current line search.
virtual void PrepareRestoPhaseStart()=0
Method that is called before the restoration phase is called.
virtual bool TryCorrector(Number alpha_primal_test, Number &alpha_primal, SmartPtr< IteratesVector > &actual_delta)=0
Try higher order corrector (for fast local convergence).
virtual bool HasComputeAlphaForY() const
Method returning true of ComputeAlphaForY is implemented for this acceptor.
virtual bool InitializeImpl(const OptionsList &options, const std::string &prefix)=0
InitializeImpl - overloaded from AlgorithmStrategyObject.
BacktrackingLSAcceptor(const BacktrackingLSAcceptor &)
Copy Constructor.
virtual void Reset()=0
Reset the acceptor.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for OptionsList.
virtual void StartWatchDog()=0
Method for setting internal data if the watchdog procedure is started.
virtual ~BacktrackingLSAcceptor()
Default destructor.
virtual Number CalculateAlphaMin()=0
Method returning the lower bound on the trial step sizes.
void operator=(const BacktrackingLSAcceptor &)
Overloaded Equals Operator.
virtual void StopWatchDog()=0
Method for setting internal data if the watchdog procedure is stopped.
virtual bool DoFallback()
Method for doing a fallback approach in case no search direction could be computed.
virtual bool CheckAcceptabilityOfTrialPoint(Number alpha_primal)=0
Method for checking if current trial point is acceptable.
virtual bool NeverRestorationPhase()
Method called by BacktrackingLineSearch object to determine whether the restoration phase should neve...
This class stores a list of user set options.
Template class for Smart Pointers.
double Number
Type of all numbers.
Definition IpTypes.hpp:17