Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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
21 class IterativeSolverTerminationTester: public AlgorithmStrategyObject
22 {
23 public:
25 enum ETerminationTest {
27 CONTINUE,
29 TEST_1_SATISFIED,
31 TEST_2_SATISFIED,
33 TEST_3_SATISFIED,
35 MODIFY_HESSIAN,
37 OTHER_SATISFIED
38 };
39
44 IterativeSolverTerminationTester()
45 {}
46
48 virtual ~IterativeSolverTerminationTester()
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
95 InexactData& InexData()
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
104 InexactCq& InexCq()
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
123 IterativeSolverTerminationTester& operator=(const IterativeSolverTerminationTester&);
125 };
126
127 } // namespace Ipopt
128
129 #endif
Ipopt::IterativeSolverTerminationTester::GetSolverIterations
virtual Index GetSolverIterations() const =0
Return the number of iterative solver iteration from the most recent solve.
IpAlgStrategy.hpp
Ipopt::IterativeSolverTerminationTester::InitializeImpl
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...
Ipopt::IterativeSolverTerminationTester
This base class is for the termination tests for the iterative linear solver in the inexact version o...
Definition: IpIterativeSolverTerminationTester.hpp:21
Ipopt::AlgorithmStrategyObject
This is the base class for all algorithm strategy objects.
Definition: IpAlgStrategy.hpp:35
Ipopt::IterativeSolverTerminationTester::IterativeSolverTerminationTester
IterativeSolverTerminationTester()
Default constructor.
Definition: IpIterativeSolverTerminationTester.hpp:44
Ipopt::IterativeSolverTerminationTester::MODIFY_HESSIAN
Hessian matrix should be modified.
Definition: IpIterativeSolverTerminationTester.hpp:35
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::IpoptCalculatedQuantities::AdditionalCq
IpoptAdditionalCq & AdditionalCq()
Definition: IpIpoptCalculatedQuantities.hpp:452
Ipopt::IterativeSolverTerminationTester::OTHER_SATISFIED
Some other termination criterion satisfied.
Definition: IpIterativeSolverTerminationTester.hpp:37
Ipopt::IterativeSolverTerminationTester::TestTermination
virtual ETerminationTest TestTermination(Index ndim, const Number *sol, const Number *resid, Index iter, Number norm2_rhs)=0
This method checks if the current soltion of the iterative linear solver is good enough (by returning...
Ipopt::IterativeSolverTerminationTester::Clear
virtual void Clear()=0
This method can be called after the Solve is over and we can delete anything that has been allocated ...
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::OptionsList
This class stores a list of user set options.
Definition: IpOptionsList.hpp:32
Ipopt::IterativeSolverTerminationTester::GetJnlst
const Journalist & GetJnlst() const
An easy way to get the journalist if accessed from the outside.
Definition: IpIterativeSolverTerminationTester.hpp:76
Ipopt::IterativeSolverTerminationTester::InexData
InexactData & InexData()
Method to easily access Inexact data.
Definition: IpIterativeSolverTerminationTester.hpp:95
Ipopt::IpoptData::AdditionalData
IpoptAdditionalData & AdditionalData()
Get access to additional data object.
Definition: IpIpoptData.hpp:502
Ipopt::IterativeSolverTerminationTester::InitializeSolve
virtual bool InitializeSolve()=0
Method for initializing for the next iterative solve.
Ipopt::IterativeSolverTerminationTester::operator=
IterativeSolverTerminationTester & operator=(const IterativeSolverTerminationTester &)
Overloaded Equals Operator.
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::IterativeSolverTerminationTester::GetVectors
void GetVectors(Index ndim, const Number *array, SmartPtr< const Vector > &comp_x, SmartPtr< const Vector > &comp_s, SmartPtr< const Vector > &comp_c, SmartPtr< const Vector > &comp_d)
Method for copying a long augmented system array into Vectors in Ipopt notation.
Ipopt::IterativeSolverTerminationTester::TEST_1_SATISFIED
Termination Test 1 is satisfied.
Definition: IpIterativeSolverTerminationTester.hpp:29
DBG_ASSERT
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
Ipopt::IterativeSolverTerminationTester::CONTINUE
The current solution is not yet good enough.
Definition: IpIterativeSolverTerminationTester.hpp:27
Ipopt::InexactCq
Class for all Chen-Goldfarb penalty method specific calculated quantities.
Definition: IpInexactCq.hpp:22
Ipopt::InexactData
Class to organize all the additional data required by the Chen-Goldfarb penalty function algorithm...
Definition: IpInexactData.hpp:19
Ipopt::IterativeSolverTerminationTester::InexCq
InexactCq & InexCq()
Method to easily access Inexact calculated quantities.
Definition: IpIterativeSolverTerminationTester.hpp:104
Ipopt::IterativeSolverTerminationTester::TEST_2_SATISFIED
Termination Test 2 is satisfied.
Definition: IpIterativeSolverTerminationTester.hpp:31
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:134
Ipopt::IterativeSolverTerminationTester::~IterativeSolverTerminationTester
virtual ~IterativeSolverTerminationTester()
Default destructor.
Definition: IpIterativeSolverTerminationTester.hpp:48
Ipopt::AlgorithmStrategyObject::IpData
IpoptData & IpData() const
Definition: IpAlgStrategy.hpp:131
IpInexactCq.hpp
Ipopt::AlgorithmStrategyObject::IpCq
IpoptCalculatedQuantities & IpCq() const
Definition: IpAlgStrategy.hpp:137
Ipopt::IterativeSolverTerminationTester::ETerminationTest
ETerminationTest
Enum to report result of termination test.
Definition: IpIterativeSolverTerminationTester.hpp:25
Ipopt::IterativeSolverTerminationTester::TEST_3_SATISFIED
Termination Test 3 is satisfied.
Definition: IpIterativeSolverTerminationTester.hpp:33
Ipopt::AlgorithmStrategyObject::Jnlst
const Journalist & Jnlst() const
Definition: IpAlgStrategy.hpp:120