This is the main application class for making calls to Ipopt. More...
#include <IpIpoptApplication.hpp>
Public Member Functions | |
IpoptApplication (bool create_console_out=true, bool create_empty=false) | |
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. | |
virtual | ~IpoptApplication () |
virtual SmartPtr< IpoptApplication > | clone () |
Method for creating a new IpoptApplication that uses the same journalist and registered options, and a copy of the options list. | |
virtual ApplicationReturnStatus | Initialize (std::istream &is, bool allow_clobber=false) |
Initialization method. | |
virtual ApplicationReturnStatus | Initialize (std::string params_file, bool allow_clobber=false) |
Initialization method. | |
virtual ApplicationReturnStatus | Initialize (const char *params_file, bool allow_clobber=false) |
Initialization method. | |
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. | |
void | PrintCopyrightMessage () |
Method for printing Ipopt copyright message now instead of just before the optimization. | |
bool | RethrowNonIpoptException (bool dorethrow) |
Method to set whether non-ipopt non-bad_alloc non-overflow_error exceptions are rethrown by Ipopt. | |
Solve methods | |
virtual ApplicationReturnStatus | OptimizeTNLP (const SmartPtr< TNLP > &tnlp) |
Solve a problem that inherits from TNLP. | |
virtual ApplicationReturnStatus | OptimizeNLP (const SmartPtr< NLP > &nlp) |
Solve a problem that inherits from NLP. | |
virtual ApplicationReturnStatus | OptimizeNLP (const SmartPtr< NLP > &nlp, SmartPtr< AlgorithmBuilder > &alg_builder) |
Solve a problem that inherits from NLP. | |
virtual ApplicationReturnStatus | ReOptimizeTNLP (const SmartPtr< TNLP > &tnlp) |
Solve a problem (that inherits from TNLP) for a repeated time. | |
virtual ApplicationReturnStatus | ReOptimizeNLP (const SmartPtr< NLP > &nlp) |
Solve a problem (that inherits from NLP) for a repeated time. | |
Accessor methods | |
virtual SmartPtr< Journalist > | Jnlst () |
Get the Journalist for printing output. | |
virtual SmartPtr< RegisteredOptions > | RegOptions () |
Get a pointer to RegisteredOptions object to add new options. | |
virtual SmartPtr< OptionsList > | Options () |
Get the options list for setting options. | |
virtual SmartPtr< const OptionsList > | Options () const |
Get the options list for setting options (const version) | |
virtual SmartPtr< SolveStatistics > | Statistics () |
Get the object with the statistics about the most recent optimization run. | |
virtual SmartPtr< IpoptNLP > | IpoptNLPObject () |
Get the IpoptNLP Object. | |
SmartPtr< IpoptData > | IpoptDataObject () |
Get the IpoptData Object. | |
virtual SmartPtr< IpoptCalculatedQuantities > | IpoptCQObject () |
Get the IpoptCQ Object. | |
SmartPtr< IpoptAlgorithm > | AlgorithmObject () |
Get the Algorithm Object. | |
Public Member Functions inherited from Ipopt::ReferencedObject | |
ReferencedObject () | |
virtual | ~ReferencedObject () |
Index | ReferenceCount () const |
void | AddRef (const Referencer *referencer) const |
void | ReleaseRef (const Referencer *referencer) const |
Static Public Member Functions | |
static void | RegisterOptions (SmartPtr< RegisteredOptions > roptions) |
static void | RegisterAllIpoptOptions (const SmartPtr< RegisteredOptions > &roptions) |
Method to register all Ipopt options. | |
Private Member Functions | |
ApplicationReturnStatus | call_optimize () |
Method for the actual optimize call of the Ipopt algorithm. | |
Default Compiler Generated Methods | |
(Hidden to avoid implicit creation/calling). These methods are not implemented and we do not want the compiler to implement them for us, so we declare them private and do not define them. This ensures that they will not be implicitly created/called. | |
IpoptApplication (const IpoptApplication &) | |
Copy Constructor. | |
void | operator= (const IpoptApplication &) |
Default Assignment Operator. | |
Private Attributes | |
SmartPtr< Journalist > | jnlst_ |
Journalist for reporting output. | |
SmartPtr< RegisteredOptions > | reg_options_ |
RegisteredOptions. | |
SmartPtr< OptionsList > | options_ |
OptionsList used for the application. | |
SmartPtr< SolveStatistics > | statistics_ |
Object for storing statistics about the most recent optimization run. | |
SmartPtr< IpoptAlgorithm > | alg_ |
Object with the algorithm skeleton. | |
SmartPtr< IpoptNLP > | ip_nlp_ |
IpoptNLP Object for the NLP. | |
SmartPtr< IpoptData > | ip_data_ |
IpoptData Object for the NLP. | |
SmartPtr< IpoptCalculatedQuantities > | ip_cq_ |
IpoptCalculatedQuantities Object for the NLP. | |
SmartPtr< NLP > | nlp_adapter_ |
Pointer to the TNLPAdapter used to convert the TNLP to an NLP. | |
Variables that customize the application behavior | |
bool | read_params_dat_ |
Decide whether or not the ipopt.opt file should be read. | |
bool | rethrow_nonipoptexception_ |
Decide whether non-ipopt non-bad_alloc non-overflow_error exceptions should be rethrown. | |
Algorithmic parameters | |
bool | inexact_algorithm_ |
Flag indicating if we are to use the inexact linear solver option. | |
bool | replace_bounds_ |
Flag indicating if all bounds should be replaced by inequality constraints. | |
This is the main application class for making calls to Ipopt.
Definition at line 32 of file IpIpoptApplication.hpp.
Ipopt::IpoptApplication::IpoptApplication | ( | bool | create_console_out = true , |
bool | create_empty = false |
||
) |
Ipopt::IpoptApplication::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.
|
virtual |
|
private |
Copy Constructor.
|
virtual |
Method for creating a new IpoptApplication that uses the same journalist and registered options, and a copy of the options list.
|
virtual |
Initialization method.
This method reads options from the input stream and initializes the journalists.
You should call one of the initialization methods at some point before the first optimize call. Set
|
virtual |
Initialization method.
This method reads options from the params file and initializes the journalists.
You should call one of the initialization methods at some point before the first optimize call.
Set
|
inlinevirtual |
Initialization method.
This method reads options from the params file and initializes the journalists.
You should call one of the initialization methods at some point before the first optimize call.
Set
Definition at line 113 of file IpIpoptApplication.hpp.
|
virtual |
Initialize method.
This method reads the options file specified by the option_file_name option and initializes the journalists.
You should call this method at some point before the first optimize call.
Set
|
virtual |
Solve a problem that inherits from TNLP.
|
virtual |
Solve a problem that inherits from NLP.
|
virtual |
Solve a problem that inherits from NLP.
|
virtual |
Solve a problem (that inherits from TNLP) for a repeated time.
The OptimizeTNLP method must have been called before. The TNLP must be the same object. The IpoptAlgorithm object from the previous solve will be reused.
|
virtual |
Solve a problem (that inherits from NLP) for a repeated time.
The OptimizeNLP method must have been called before. The NLP must be the same object. The IpoptAlgorithm object from the previous solve will be reused.
|
virtual |
Method for opening an output file with given print_level.
file_name | name of file to open |
print_level | print level to be used |
file_append | whether to append to file or truncate (since 3.14.13) |
|
inlinevirtual |
Get the Journalist for printing output.
Definition at line 191 of file IpIpoptApplication.hpp.
|
inlinevirtual |
Get a pointer to RegisteredOptions object to add new options.
Definition at line 197 of file IpIpoptApplication.hpp.
|
inlinevirtual |
Get the options list for setting options.
Definition at line 203 of file IpIpoptApplication.hpp.
|
inlinevirtual |
Get the options list for setting options (const version)
Definition at line 209 of file IpIpoptApplication.hpp.
|
virtual |
Get the object with the statistics about the most recent optimization run.
Get the IpoptNLP Object.
|
virtual |
Get the IpoptCQ Object.
SmartPtr< IpoptAlgorithm > Ipopt::IpoptApplication::AlgorithmObject | ( | ) |
Get the Algorithm Object.
void Ipopt::IpoptApplication::PrintCopyrightMessage | ( | ) |
Method for printing Ipopt copyright message now instead of just before the optimization.
If you want to have the copy right message printed earlier than by default, call this method at the convenient time.
Method to set whether non-ipopt non-bad_alloc non-overflow_error exceptions are rethrown by Ipopt.
By default, non-Ipopt and non-bad_alloc and non-overflow_error exceptions are caught by Ipopts initialization and optimization methods and the status NonIpopt_Exception_Thrown is returned. This function allows to enable rethrowing of such exceptions.
Definition at line 254 of file IpIpoptApplication.hpp.
|
static |
|
static |
Method to register all Ipopt options.
|
private |
Default Assignment Operator.
|
private |
Method for the actual optimize call of the Ipopt algorithm.
This is used both for Optimize and ReOptimize
|
private |
Decide whether or not the ipopt.opt file should be read.
Definition at line 302 of file IpIpoptApplication.hpp.
|
private |
Decide whether non-ipopt non-bad_alloc non-overflow_error exceptions should be rethrown.
Definition at line 305 of file IpIpoptApplication.hpp.
|
private |
Journalist for reporting output.
Definition at line 309 of file IpIpoptApplication.hpp.
|
private |
Definition at line 312 of file IpIpoptApplication.hpp.
|
private |
OptionsList used for the application.
Definition at line 315 of file IpIpoptApplication.hpp.
|
private |
Object for storing statistics about the most recent optimization run.
Definition at line 320 of file IpIpoptApplication.hpp.
|
private |
Object with the algorithm skeleton.
Definition at line 324 of file IpIpoptApplication.hpp.
We keep this around for a ReOptimize warm start.
Definition at line 330 of file IpIpoptApplication.hpp.
We keep this around for a ReOptimize warm start.
Definition at line 336 of file IpIpoptApplication.hpp.
|
private |
IpoptCalculatedQuantities Object for the NLP.
We keep this around for a ReOptimize warm start.
Definition at line 342 of file IpIpoptApplication.hpp.
Pointer to the TNLPAdapter used to convert the TNLP to an NLP.
We keep this around for the ReOptimizerTNLP call.
Definition at line 348 of file IpIpoptApplication.hpp.
|
private |
Flag indicating if we are to use the inexact linear solver option.
Definition at line 353 of file IpIpoptApplication.hpp.
|
private |
Flag indicating if all bounds should be replaced by inequality constraints.
This is necessary for the inexact algorithm.
Definition at line 360 of file IpIpoptApplication.hpp.