Ipopt  3.11.9
Public Member Functions | List of all members
Ipopt::IpoptApplication Class Reference

This is the main application class for making calls to Ipopt. More...

#include <IpIpoptApplication.hpp>

+ Inheritance diagram for Ipopt::IpoptApplication:

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. More...
 
virtual ~IpoptApplication ()
 
virtual SmartPtr< IpoptApplicationclone ()
 Method for creating a new IpoptApplication that uses the same journalist and registered options, and a copy of the options list. More...
 
virtual ApplicationReturnStatus Initialize (std::istream &is)
 Initialization method. More...
 
virtual ApplicationReturnStatus Initialize (std::string params_file)
 Initialization method. More...
 
virtual ApplicationReturnStatus Initialize ()
 Initialize method. More...
 
Solve methods
virtual ApplicationReturnStatus OptimizeTNLP (const SmartPtr< TNLP > &tnlp)
 Solve a problem that inherits from TNLP. More...
 
virtual ApplicationReturnStatus OptimizeNLP (const SmartPtr< NLP > &nlp)
 Solve a problem that inherits from NLP. More...
 
virtual ApplicationReturnStatus OptimizeNLP (const SmartPtr< NLP > &nlp, SmartPtr< AlgorithmBuilder > &alg_builder)
 Solve a problem that inherits from NLP. More...
 
virtual ApplicationReturnStatus ReOptimizeTNLP (const SmartPtr< TNLP > &tnlp)
 Solve a problem (that inherits from TNLP) for a repeated time. More...
 
virtual ApplicationReturnStatus ReOptimizeNLP (const SmartPtr< NLP > &nlp)
 Solve a problem (that inherits from NLP) for a repeated time. More...
 
virtual bool OpenOutputFile (std::string file_name, EJournalLevel print_level)
 Method for opening an output file with given print_level. More...
 
Accessor methods
virtual SmartPtr< JournalistJnlst ()
 Get the Journalist for printing output. More...
 
virtual SmartPtr< RegisteredOptionsRegOptions ()
 Get a pointer to RegisteredOptions object to add new options. More...
 
virtual SmartPtr< OptionsListOptions ()
 Get the options list for setting options. More...
 
virtual SmartPtr< const OptionsListOptions () const
 Get the options list for setting options (const version) More...
 
virtual SmartPtr< SolveStatisticsStatistics ()
 Get the object with the statistics about the most recent optimization run. More...
 
virtual SmartPtr< IpoptNLPIpoptNLPObject ()
 Get the IpoptNLP Object. More...
 
SmartPtr< IpoptDataIpoptDataObject ()
 Get the IpoptData Object. More...
 
virtual SmartPtr< IpoptCalculatedQuantitiesIpoptCQObject ()
 Get the IpoptCQ Object. More...
 
SmartPtr< IpoptAlgorithmAlgorithmObject ()
 Get the Algorithm Object. More...
 
void PrintCopyrightMessage ()
 Method for printing Ipopt copyright message now instead of just before the optimization. More...
 
void RethrowNonIpoptException (bool dorethrow)
 Method to set whether non-ipopt non-bad_alloc exceptions are rethrown by Ipopt. More...
 
- 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

Methods for IpoptTypeInfo
static void RegisterOptions (SmartPtr< RegisteredOptions > roptions)
 
static void RegisterAllIpoptOptions (const SmartPtr< RegisteredOptions > &roptions)
 Method to registering all Ipopt options. More...
 

Private Member Functions

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 &)
 Default Constructor. More...
 
void operator= (const IpoptApplication &)
 Overloaded Equals Operator. More...
 
ApplicationReturnStatus call_optimize ()
 Method for the actual optimize call of the Ipopt algorithm. More...
 

Private Attributes

Variables that customize the application behavior
bool read_params_dat_
 Decide whether or not the ipopt.opt file should be read. More...
 
bool rethrow_nonipoptexception_
 Decide whether non-ipopt non-bad_alloc exceptions should be rethrown. More...
 
SmartPtr< Journalistjnlst_
 Journalist for reporting output. More...
 
SmartPtr< RegisteredOptionsreg_options_
 RegisteredOptions. More...
 
SmartPtr< OptionsListoptions_
 OptionsList used for the application. More...
 
SmartPtr< SolveStatisticsstatistics_
 Object for storing statistics about the most recent optimization run. More...
 
SmartPtr< IpoptAlgorithmalg_
 Object with the algorithm sceleton. More...
 
SmartPtr< IpoptNLPip_nlp_
 IpoptNLP Object for the NLP. More...
 
SmartPtr< IpoptDataip_data_
 IpoptData Object for the NLP. More...
 
SmartPtr< IpoptCalculatedQuantitiesip_cq_
 IpoptCalculatedQuantities Object for the NLP. More...
 
SmartPtr< NLPnlp_adapter_
 Pointer to the TNLPAdapter used to convert the TNLP to an NLP. More...
 
Algorithmic parameters
bool inexact_algorithm_
 Flag indicating if we are to use the inexact linear solver option. More...
 
bool replace_bounds_
 Flag indicating if all bounds should be replaced by inequality constraints. More...
 

Detailed Description

This is the main application class for making calls to Ipopt.

Definition at line 47 of file IpIpoptApplication.hpp.

Constructor & Destructor Documentation

◆ IpoptApplication() [1/3]

Ipopt::IpoptApplication::IpoptApplication ( bool  create_console_out = true,
bool  create_empty = false 
)

◆ IpoptApplication() [2/3]

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.

◆ ~IpoptApplication()

virtual Ipopt::IpoptApplication::~IpoptApplication ( )
virtual

◆ IpoptApplication() [3/3]

Ipopt::IpoptApplication::IpoptApplication ( const IpoptApplication )
private

Default Constructor.

Copy Constructor

Member Function Documentation

◆ clone()

virtual SmartPtr<IpoptApplication> Ipopt::IpoptApplication::clone ( )
virtual

Method for creating a new IpoptApplication that uses the same journalist and registered options, and a copy of the options list.

◆ Initialize() [1/3]

virtual ApplicationReturnStatus Ipopt::IpoptApplication::Initialize ( std::istream &  is)
virtual

Initialization method.

This method reads options from the input stream and initializes the journalists. It returns something other than Solve_Succeeded if there was a problem in the initialization (such as an invalid option). You should call one of the initialization methods at some point before the first optimize call.

◆ Initialize() [2/3]

virtual ApplicationReturnStatus Ipopt::IpoptApplication::Initialize ( std::string  params_file)
virtual

Initialization method.

This method reads options from the params file and initializes the journalists. It returns something other than Solve_Succeeded if there was a problem in the initialization (such as an invalid option). You should call one of the initialization methods at some point before the first optimize call. Note: You can skip the processing of a params file by setting params_file to "".

◆ Initialize() [3/3]

virtual ApplicationReturnStatus Ipopt::IpoptApplication::Initialize ( )
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. It returns something other than Solve_Succeeded if there was a problem in the initialization (such as an invalid option).

◆ OptimizeTNLP()

virtual ApplicationReturnStatus Ipopt::IpoptApplication::OptimizeTNLP ( const SmartPtr< TNLP > &  tnlp)
virtual

Solve a problem that inherits from TNLP.

◆ OptimizeNLP() [1/2]

virtual ApplicationReturnStatus Ipopt::IpoptApplication::OptimizeNLP ( const SmartPtr< NLP > &  nlp)
virtual

Solve a problem that inherits from NLP.

◆ OptimizeNLP() [2/2]

virtual ApplicationReturnStatus Ipopt::IpoptApplication::OptimizeNLP ( const SmartPtr< NLP > &  nlp,
SmartPtr< AlgorithmBuilder > &  alg_builder 
)
virtual

Solve a problem that inherits from NLP.

◆ ReOptimizeTNLP()

virtual ApplicationReturnStatus Ipopt::IpoptApplication::ReOptimizeTNLP ( const SmartPtr< TNLP > &  tnlp)
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, and the structure (number of variables and constraints and position of nonzeros in Jacobian and Hessian must be the same).

◆ ReOptimizeNLP()

virtual ApplicationReturnStatus Ipopt::IpoptApplication::ReOptimizeNLP ( const SmartPtr< NLP > &  nlp)
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, and the structure (number of variables and constraints and position of nonzeros in Jacobian and Hessian must be the same).

◆ OpenOutputFile()

virtual bool Ipopt::IpoptApplication::OpenOutputFile ( std::string  file_name,
EJournalLevel  print_level 
)
virtual

Method for opening an output file with given print_level.

Returns false if there was a problem.

◆ Jnlst()

virtual SmartPtr<Journalist> Ipopt::IpoptApplication::Jnlst ( )
inlinevirtual

Get the Journalist for printing output.

Definition at line 126 of file IpIpoptApplication.hpp.

◆ RegOptions()

virtual SmartPtr<RegisteredOptions> Ipopt::IpoptApplication::RegOptions ( )
inlinevirtual

Get a pointer to RegisteredOptions object to add new options.

Definition at line 133 of file IpIpoptApplication.hpp.

◆ Options() [1/2]

virtual SmartPtr<OptionsList> Ipopt::IpoptApplication::Options ( )
inlinevirtual

Get the options list for setting options.

Definition at line 139 of file IpIpoptApplication.hpp.

◆ Options() [2/2]

virtual SmartPtr<const OptionsList> Ipopt::IpoptApplication::Options ( ) const
inlinevirtual

Get the options list for setting options (const version)

Definition at line 145 of file IpIpoptApplication.hpp.

◆ Statistics()

virtual SmartPtr<SolveStatistics> Ipopt::IpoptApplication::Statistics ( )
virtual

Get the object with the statistics about the most recent optimization run.

◆ IpoptNLPObject()

virtual SmartPtr<IpoptNLP> Ipopt::IpoptApplication::IpoptNLPObject ( )
virtual

Get the IpoptNLP Object.

◆ IpoptDataObject()

SmartPtr<IpoptData> Ipopt::IpoptApplication::IpoptDataObject ( )

Get the IpoptData Object.

◆ IpoptCQObject()

virtual SmartPtr<IpoptCalculatedQuantities> Ipopt::IpoptApplication::IpoptCQObject ( )
virtual

Get the IpoptCQ Object.

◆ AlgorithmObject()

SmartPtr<IpoptAlgorithm> Ipopt::IpoptApplication::AlgorithmObject ( )

Get the Algorithm Object.

◆ PrintCopyrightMessage()

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.

◆ RethrowNonIpoptException()

void Ipopt::IpoptApplication::RethrowNonIpoptException ( bool  dorethrow)
inline

Method to set whether non-ipopt non-bad_alloc exceptions are rethrown by Ipopt.

By default, non-Ipopt and non-std::bad_alloc 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 180 of file IpIpoptApplication.hpp.

◆ RegisterOptions()

static void Ipopt::IpoptApplication::RegisterOptions ( SmartPtr< RegisteredOptions roptions)
static

◆ RegisterAllIpoptOptions()

static void Ipopt::IpoptApplication::RegisterAllIpoptOptions ( const SmartPtr< RegisteredOptions > &  roptions)
static

Method to registering all Ipopt options.

◆ operator=()

void Ipopt::IpoptApplication::operator= ( const IpoptApplication )
private

Overloaded Equals Operator.

◆ call_optimize()

ApplicationReturnStatus Ipopt::IpoptApplication::call_optimize ( )
private

Method for the actual optimize call of the Ipopt algorithm.

This is used both for Optimize and ReOptimize

Member Data Documentation

◆ read_params_dat_

bool Ipopt::IpoptApplication::read_params_dat_
private

Decide whether or not the ipopt.opt file should be read.

Definition at line 220 of file IpIpoptApplication.hpp.

◆ rethrow_nonipoptexception_

bool Ipopt::IpoptApplication::rethrow_nonipoptexception_
private

Decide whether non-ipopt non-bad_alloc exceptions should be rethrown.

Definition at line 223 of file IpIpoptApplication.hpp.

◆ jnlst_

SmartPtr<Journalist> Ipopt::IpoptApplication::jnlst_
private

Journalist for reporting output.

Definition at line 227 of file IpIpoptApplication.hpp.

◆ reg_options_

SmartPtr<RegisteredOptions> Ipopt::IpoptApplication::reg_options_
private

RegisteredOptions.

Definition at line 230 of file IpIpoptApplication.hpp.

◆ options_

SmartPtr<OptionsList> Ipopt::IpoptApplication::options_
private

OptionsList used for the application.

Definition at line 233 of file IpIpoptApplication.hpp.

◆ statistics_

SmartPtr<SolveStatistics> Ipopt::IpoptApplication::statistics_
private

Object for storing statistics about the most recent optimization run.

Definition at line 237 of file IpIpoptApplication.hpp.

◆ alg_

SmartPtr<IpoptAlgorithm> Ipopt::IpoptApplication::alg_
private

Object with the algorithm sceleton.

Definition at line 241 of file IpIpoptApplication.hpp.

◆ ip_nlp_

SmartPtr<IpoptNLP> Ipopt::IpoptApplication::ip_nlp_
private

IpoptNLP Object for the NLP.

We keep this around for a ReOptimize warm start.

Definition at line 245 of file IpIpoptApplication.hpp.

◆ ip_data_

SmartPtr<IpoptData> Ipopt::IpoptApplication::ip_data_
private

IpoptData Object for the NLP.

We keep this around for a ReOptimize warm start.

Definition at line 250 of file IpIpoptApplication.hpp.

◆ ip_cq_

SmartPtr<IpoptCalculatedQuantities> Ipopt::IpoptApplication::ip_cq_
private

IpoptCalculatedQuantities Object for the NLP.

We keep this around for a ReOptimize warm start.

Definition at line 255 of file IpIpoptApplication.hpp.

◆ nlp_adapter_

SmartPtr<NLP> Ipopt::IpoptApplication::nlp_adapter_
private

Pointer to the TNLPAdapter used to convert the TNLP to an NLP.

We keep this around for the ReOptimizerTNLP call.

Definition at line 259 of file IpIpoptApplication.hpp.

◆ inexact_algorithm_

bool Ipopt::IpoptApplication::inexact_algorithm_
private

Flag indicating if we are to use the inexact linear solver option.

Definition at line 264 of file IpIpoptApplication.hpp.

◆ replace_bounds_

bool Ipopt::IpoptApplication::replace_bounds_
private

Flag indicating if all bounds should be replaced by inequality constraints.

This is necessary for the inexact algorithm.

Definition at line 267 of file IpIpoptApplication.hpp.


The documentation for this class was generated from the following file: