IpInexactLSAcceptor.hpp
Go to the documentation of this file.
1 // Copyright (C) 2008 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpInexactLSAcceptor.hpp 1861 2010-12-21 21:34:47Z andreasw $
6 //
7 // Authors: Andreas Waechter IBM 2008-09-11
8 // derived file from IpPenaltyLSAcceptor.hpp (rev 019)
9 
10 #ifndef __IPINEXACTLSACCEPTOR_HPP__
11 #define __IPINEXACTLSACCEPTOR_HPP__
12 
14 #include "IpInexactCq.hpp"
15 
16 namespace Ipopt
17 {
18 
23  {
24  public:
31 
33  virtual ~InexactLSAcceptor();
35 
37  virtual bool InitializeImpl(const OptionsList& options,
38  const std::string& prefix);
39 
46  virtual void Reset();
47 
51  virtual void InitThisLineSearch(bool in_watchdog);
52 
55  virtual void PrepareRestoPhaseStart();
56 
58  virtual Number CalculateAlphaMin();
59 
65  virtual bool CheckAcceptabilityOfTrialPoint(Number alpha_primal);
66 
71  virtual bool TrySecondOrderCorrection(Number alpha_primal_test,
72  Number& alpha_primal,
73  SmartPtr<IteratesVector>& actual_delta);
74 
81  virtual bool TryCorrector(Number alpha_primal_test,
82  Number& alpha_primal,
83  SmartPtr<IteratesVector>& actual_delta);
84 
89  virtual char UpdateForNextIteration(Number alpha_primal_test);
90 
93  virtual void StartWatchDog();
94 
97  virtual void StopWatchDog();
98 
105  bool IsAcceptableToCurrentIterate(Number trial_barr, Number trial_theta,
106  bool called_from_restoration=false) const;
108 
110  virtual Number ComputeAlphaForY(Number alpha_primal,
111  Number alpha_dual,
112  SmartPtr<IteratesVector>& delta);
113 
116  virtual bool HasComputeAlphaForY() const
117  {
118  return true;
119  }
120 
123  static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
125 
126  protected:
129  {
130  InexactData& inexact_data =
131  static_cast<InexactData&>(IpData().AdditionalData());
132  DBG_ASSERT(dynamic_cast<InexactData*>(&IpData().AdditionalData()));
133  return inexact_data;
134  }
135 
138  {
139  InexactCq& inexact_cq =
140  static_cast<InexactCq&>(IpCq().AdditionalCq());
141  DBG_ASSERT(dynamic_cast<InexactCq*>(&IpCq().AdditionalCq()));
142  return inexact_cq;
143  }
144 
145  private:
156 
158  void operator=(const InexactLSAcceptor&);
160 
162  Number CalcPred(Number alpha);
163 
167  void ResetSlacks();
168 
191 
210 
226 
230  bool in_tt2_;
231 
235 
239  };
240 
241 } // namespace Ipopt
242 
243 #endif