IpIterativeSolverTerminationTester.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: IpIterativeSolverTerminationTester.hpp 1861 2010-12-21 21:34:47Z andreasw $
6 //
7 // Authors: Andreas Waechter IBM 2008-09-19
8 
9 #ifndef __IPITERATIVESOLVERTERMINATIONTESTER_HPP__
10 #define __IPITERATIVESOLVERTERMINATIONTESTER_HPP__
11 
12 #include "IpAlgStrategy.hpp"
13 #include "IpInexactCq.hpp"
14 
15 namespace Ipopt
16 {
17 
22  {
23  public:
38  };
39 
45  {}
46 
49  {}
51 
52  /* overloaded from AlgorithmStrategyObject */
53  virtual bool InitializeImpl(const OptionsList& options,
54  const std::string& prefix) = 0;
55 
56 
59  virtual bool InitializeSolve() = 0;
60 
67  virtual ETerminationTest TestTermination(Index ndim, const Number* sol,
68  const Number* resid, Index iter,
69  Number norm2_rhs) = 0;
70 
73  virtual void Clear() = 0;
74 
76  const Journalist& GetJnlst() const
77  {
78  return Jnlst();
79  }
80 
83  virtual Index GetSolverIterations() const = 0;
84 
85  protected:
88  void GetVectors(Index ndim, const Number* array,
89  SmartPtr<const Vector>& comp_x,
90  SmartPtr<const Vector>& comp_s,
91  SmartPtr<const Vector>& comp_c,
92  SmartPtr<const Vector>& comp_d);
93 
96  {
97  InexactData& inexact_data =
98  static_cast<InexactData&>(IpData().AdditionalData());
99  DBG_ASSERT(dynamic_cast<InexactData*>(&IpData().AdditionalData()));
100  return inexact_data;
101  }
102 
105  {
106  InexactCq& inexact_cq =
107  static_cast<InexactCq&>(IpCq().AdditionalCq());
108  DBG_ASSERT(dynamic_cast<InexactCq*>(&IpCq().AdditionalCq()));
109  return inexact_cq;
110  }
111 
112  private:
113 
125  };
126 
127 } // namespace Ipopt
128 
129 #endif