Ipopt Documentation  
 
Loading...
Searching...
No Matches
IpIpoptApplication.hpp
Go to the documentation of this file.
1// Copyright (C) 2004, 2010 International Business Machines and others.
2// All Rights Reserved.
3// This code is published under the Eclipse Public License.
4//
5// Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
6
7#ifndef __IPIPOPTAPPLICATION_HPP__
8#define __IPIPOPTAPPLICATION_HPP__
9
10#include <iostream>
11
12#include "IpJournalist.hpp"
13#include "IpTNLP.hpp"
14#include "IpNLP.hpp"
15#include "IpReturnCodes.hpp"
16
17namespace Ipopt
18{
20
21/* forward declarations */
22class IpoptAlgorithm;
23class IpoptNLP;
24class IpoptData;
28class OptionsList;
29class SolveStatistics;
30
33{
34public:
36 bool create_console_out = true,
37 bool create_empty = false
38 );
39
47 );
48
50
55
70 std::istream& is,
71 bool allow_clobber = false
72 );
73
92 std::string params_file,
93 bool allow_clobber = false
94 );
95
114 const char* params_file,
115 bool allow_clobber = false
116 )
117 {
118 return Initialize(std::string(params_file), allow_clobber);
119 }
120
136 bool allow_clobber = false
137 );
138
141
143 const SmartPtr<TNLP>& tnlp
144 );
145
148 const SmartPtr<NLP>& nlp
149 );
150
153 const SmartPtr<NLP>& nlp,
155 );
156
164 const SmartPtr<TNLP>& tnlp
165 );
166
174 const SmartPtr<NLP>& nlp
175 );
177
182 virtual bool OpenOutputFile(
183 std::string file_name,
184 EJournalLevel print_level,
185 bool file_append = false
186 );
187
190
192 {
193 return jnlst_;
194 }
195
198 {
199 return reg_options_;
200 }
201
204 {
205 return options_;
206 }
207
210 {
211 return ConstPtr(options_);
212 }
213
222
225
228
231
235
243
255 bool dorethrow
256 )
257 {
258 bool oldval = rethrow_nonipoptexception_;
259 rethrow_nonipoptexception_ = dorethrow;
260 return oldval;
261 }
262
263 static void RegisterOptions(
265 );
266
268 static void
271 );
272
273private:
282
284 const IpoptApplication&
285 );
286
289 const IpoptApplication&
290 );
292
298
301
303
307
310
313
316
321
325
331
337
343
349
352
354
362};
363
364} // namespace Ipopt
365
367
368#endif
#define DECLARE_STD_EXCEPTION(__except_type)
IPOPTLIB_EXPORT class Ipopt::IpoptApplication *IPOPT_CALLCONV IpoptApplicationFactory()
ApplicationReturnStatus
Return codes for the Optimize call for an application.
#define IPOPT_CALLCONV
Definition IpTypes.h:41
Builder for creating a complete IpoptAlg object.
Templated class which stores one entry for the CachedResult class.
The main ipopt algorithm class.
This is the main application class for making calls to Ipopt.
void operator=(const IpoptApplication &)
Default Assignment Operator.
virtual SmartPtr< SolveStatistics > Statistics()
Get the object with the statistics about the most recent optimization run.
virtual ApplicationReturnStatus ReOptimizeTNLP(const SmartPtr< TNLP > &tnlp)
Solve a problem (that inherits from TNLP) for a repeated time.
ApplicationReturnStatus call_optimize()
Method for the actual optimize call of the Ipopt algorithm.
void PrintCopyrightMessage()
Method for printing Ipopt copyright message now instead of just before the optimization.
static void RegisterAllIpoptOptions(const SmartPtr< RegisteredOptions > &roptions)
Method to register all Ipopt options.
bool rethrow_nonipoptexception_
Decide whether non-ipopt non-bad_alloc non-overflow_error exceptions should be rethrown.
SmartPtr< Journalist > jnlst_
Journalist for reporting output.
virtual ApplicationReturnStatus ReOptimizeNLP(const SmartPtr< NLP > &nlp)
Solve a problem (that inherits from NLP) for a repeated time.
IpoptApplication(const IpoptApplication &)
Copy Constructor.
IpoptApplication(SmartPtr< RegisteredOptions > reg_options, SmartPtr< OptionsList > options, SmartPtr< Journalist > jnlst)
Another constructor that assumes that the code in the (default) constructor has already been executed...
SmartPtr< IpoptNLP > ip_nlp_
IpoptNLP Object for the NLP.
bool inexact_algorithm_
Flag indicating if we are to use the inexact linear solver option.
virtual ApplicationReturnStatus Initialize(bool allow_clobber=false)
Initialize method.
virtual bool OpenOutputFile(std::string file_name, EJournalLevel print_level, bool file_append=false)
Method for opening an output file with given print_level.
virtual SmartPtr< RegisteredOptions > RegOptions()
Get a pointer to RegisteredOptions object to add new options.
SmartPtr< IpoptAlgorithm > AlgorithmObject()
Get the Algorithm Object.
virtual SmartPtr< const OptionsList > Options() const
Get the options list for setting options (const version)
SmartPtr< IpoptData > IpoptDataObject()
Get the IpoptData Object.
virtual ApplicationReturnStatus Initialize(std::string params_file, bool allow_clobber=false)
Initialization method.
bool RethrowNonIpoptException(bool dorethrow)
Method to set whether non-ipopt non-bad_alloc non-overflow_error exceptions are rethrown by Ipopt.
virtual SmartPtr< OptionsList > Options()
Get the options list for setting options.
virtual SmartPtr< IpoptApplication > clone()
Method for creating a new IpoptApplication that uses the same journalist and registered options,...
virtual ApplicationReturnStatus Initialize(const char *params_file, bool allow_clobber=false)
Initialization method.
virtual ApplicationReturnStatus OptimizeNLP(const SmartPtr< NLP > &nlp)
Solve a problem that inherits from NLP.
bool read_params_dat_
Decide whether or not the ipopt.opt file should be read.
IpoptApplication(bool create_console_out=true, bool create_empty=false)
virtual ApplicationReturnStatus OptimizeNLP(const SmartPtr< NLP > &nlp, SmartPtr< AlgorithmBuilder > &alg_builder)
Solve a problem that inherits from NLP.
virtual SmartPtr< IpoptCalculatedQuantities > IpoptCQObject()
Get the IpoptCQ Object.
SmartPtr< IpoptData > ip_data_
IpoptData Object for the NLP.
bool replace_bounds_
Flag indicating if all bounds should be replaced by inequality constraints.
SmartPtr< IpoptCalculatedQuantities > ip_cq_
IpoptCalculatedQuantities Object for the NLP.
SmartPtr< RegisteredOptions > reg_options_
RegisteredOptions.
virtual ApplicationReturnStatus Initialize(std::istream &is, bool allow_clobber=false)
Initialization method.
SmartPtr< SolveStatistics > statistics_
Object for storing statistics about the most recent optimization run.
SmartPtr< OptionsList > options_
OptionsList used for the application.
virtual ApplicationReturnStatus OptimizeTNLP(const SmartPtr< TNLP > &tnlp)
Solve a problem that inherits from TNLP.
SmartPtr< IpoptAlgorithm > alg_
Object with the algorithm skeleton.
SmartPtr< NLP > nlp_adapter_
Pointer to the TNLPAdapter used to convert the TNLP to an NLP.
virtual SmartPtr< IpoptNLP > IpoptNLPObject()
Get the IpoptNLP Object.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
virtual SmartPtr< Journalist > Jnlst()
Get the Journalist for printing output.
Class for all IPOPT specific calculated quantities.
Class to organize all the data required by the algorithm.
This is the abstract base class for classes that map the traditional NLP into something that is more ...
This class stores a list of user set options.
Storing the reference count of all the smart pointers that currently reference it.
Class for storing registered options.
This class collects statistics about an optimization run, such as iteration count,...
#define IPOPTLIB_EXPORT
This file contains a base class for all exceptions and a set of macros to help with exceptions.
SmartPtr< const U > ConstPtr(const SmartPtr< U > &smart_ptr)
EJournalLevel
Print Level Enum.