Ipopt  3.11.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpAlgStrategy.hpp
Go to the documentation of this file.
1 // Copyright (C) 2004, 2006 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpAlgStrategy.hpp 1861 2010-12-21 21:34:47Z andreasw $
6 //
7 // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8 
9 #ifndef __IPALGSTRATEGY_HPP__
10 #define __IPALGSTRATEGY_HPP__
11 
12 #include "IpOptionsList.hpp"
13 #include "IpJournalist.hpp"
15 #include "IpIpoptNLP.hpp"
16 #include "IpIpoptData.hpp"
17 
18 namespace Ipopt
19 {
20 
36  {
37  public:
42  :
43  initialize_called_(false)
44  {}
45 
48  {}
50 
66  bool Initialize(const Journalist& jnlst,
67  IpoptNLP& ip_nlp,
68  IpoptData& ip_data,
70  const OptionsList& options,
71  const std::string& prefix)
72  {
73  initialize_called_ = true;
74  // Copy the pointers for the problem defining objects
75  jnlst_ = &jnlst;
76  ip_nlp_ = &ip_nlp;
77  ip_data_ = &ip_data;
78  ip_cq_ = &ip_cq;
79 
80  bool retval = InitializeImpl(options, prefix);
81  if (!retval) {
82  initialize_called_ = false;
83  }
84 
85  return retval;
86  }
87 
92  bool ReducedInitialize(const Journalist& jnlst,
93  const OptionsList& options,
94  const std::string& prefix)
95  {
96  initialize_called_ = true;
97  // Copy the pointers for the problem defining objects
98  jnlst_ = &jnlst;
99  ip_nlp_ = NULL;
100  ip_data_ = NULL;
101  ip_cq_ = NULL;
102 
103  bool retval = InitializeImpl(options, prefix);
104  if (!retval) {
105  initialize_called_ = false;
106  }
107 
108  return retval;
109  }
110 
111  protected:
114  virtual bool InitializeImpl(const OptionsList& options,
115  const std::string& prefix)=0;
116 
120  const Journalist& Jnlst() const
121  {
123  return *jnlst_;
124  }
125  IpoptNLP& IpNLP() const
126  {
129  return *ip_nlp_;
130  }
131  IpoptData& IpData() const
132  {
135  return *ip_data_;
136  }
138  {
141  return *ip_cq_;
142  }
143  bool HaveIpData() const
144  {
145  return IsValid(ip_data_);
146  }
148 
149  private:
159  //AlgorithmStrategyObject();
160 
161 
164 
166  void operator=(const AlgorithmStrategyObject&);
168 
177 
181  };
182 
183 } // namespace Ipopt
184 
185 #endif