1 | // Copyright (C) 2004, International Business Machines and others. |
---|
2 | // All Rights Reserved. |
---|
3 | // This code is published under the Common Public License. |
---|
4 | // |
---|
5 | // $Id: IpConvCheck.hpp 2 2004-10-21 01:03:09Z andreasw $ |
---|
6 | // |
---|
7 | // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13 |
---|
8 | |
---|
9 | #ifndef __IPCONVCHECK_HPP__ |
---|
10 | #define __IPCONVCHECK_HPP__ |
---|
11 | |
---|
12 | #include "IpUtils.hpp" |
---|
13 | #include "IpAlgStrategy.hpp" |
---|
14 | |
---|
15 | namespace Ipopt |
---|
16 | { |
---|
17 | |
---|
18 | /** Base class for checking the algorithm |
---|
19 | * termination criteria. |
---|
20 | */ |
---|
21 | class ConvergenceCheck : public AlgorithmStrategyObject |
---|
22 | { |
---|
23 | public: |
---|
24 | /**@name Constructors/Destructors */ |
---|
25 | //@{ |
---|
26 | /** Constructor */ |
---|
27 | ConvergenceCheck() |
---|
28 | {} |
---|
29 | |
---|
30 | /** Default destructor */ |
---|
31 | virtual ~ConvergenceCheck() |
---|
32 | {} |
---|
33 | //@} |
---|
34 | |
---|
35 | /** Convergence return enum */ |
---|
36 | enum ConvergenceStatus { |
---|
37 | CONTINUE, |
---|
38 | CONVERGED, |
---|
39 | MAXITER_EXCEEDED, |
---|
40 | FAILED |
---|
41 | }; |
---|
42 | |
---|
43 | /** overloaded from AlgorithmStrategyObject */ |
---|
44 | virtual bool InitializeImpl(const OptionsList& options, |
---|
45 | const std::string& prefix) = 0; |
---|
46 | |
---|
47 | /** Pure virtual method for performing the convergence test */ |
---|
48 | virtual ConvergenceStatus CheckConvergence()=0; |
---|
49 | |
---|
50 | private: |
---|
51 | /**@name Default Compiler Generated Methods |
---|
52 | * (Hidden to avoid implicit creation/calling). |
---|
53 | * These methods are not implemented and |
---|
54 | * we do not want the compiler to implement |
---|
55 | * them for us, so we declare them private |
---|
56 | * and do not define them. This ensures that |
---|
57 | * they will not be implicitly created/called. */ |
---|
58 | //@{ |
---|
59 | /** Default Constructor */ |
---|
60 | // ConvergenceCheck(); |
---|
61 | |
---|
62 | /** Copy Constructor */ |
---|
63 | ConvergenceCheck(const ConvergenceCheck&); |
---|
64 | |
---|
65 | /** Overloaded Equals Operator */ |
---|
66 | void operator=(const ConvergenceCheck&); |
---|
67 | //@} |
---|
68 | |
---|
69 | }; |
---|
70 | |
---|
71 | } // namespace Ipopt |
---|
72 | |
---|
73 | #endif |
---|