Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Bonmin::IpoptSolver Class Reference

#include <BonIpoptSolver.hpp>

Inheritance diagram for Bonmin::IpoptSolver:
Inheritance graph
[legend]
Collaboration diagram for Bonmin::IpoptSolver:
Collaboration graph
[legend]

Classes

class  UnsolvedIpoptError
 

Public Member Functions

virtual UnsolvedErrornewUnsolvedError (int num, Ipopt::SmartPtr< TMINLP2TNLP > problem, std::string name)
 
 IpoptSolver (bool createEmpty=false)
 Constructor. More...
 
 IpoptSolver (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions, Ipopt::SmartPtr< Ipopt::OptionsList > options, Ipopt::SmartPtr< Ipopt::Journalist > journalist, const std::string &prefix)
 Constructor with Passed in journalist, registered options, options. More...
 
 IpoptSolver (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions, Ipopt::SmartPtr< Ipopt::OptionsList > options, Ipopt::SmartPtr< Ipopt::Journalist > journalist)
 Constructor with Passed in journalist, registered options, options. More...
 
 IpoptSolver (const IpoptSolver &other)
 Copy constructor. More...
 
virtual Ipopt::SmartPtr
< TNLPSolver
clone ()
 virtual copy constructor More...
 
virtual ~IpoptSolver ()
 Virtual destructor. More...
 
virtual bool Initialize (std::string params_file)
 Initialize the TNLPSolver (read options from params_file) More...
 
virtual bool Initialize (std::istream &is)
 Initialize the TNLPSolver (read options from istream is) More...
 
virtual double CPUTime ()
 Get the CpuTime of the last optimization. More...
 
virtual int IterationCount ()
 Get the iteration count of the last optimization. More...
 
virtual void setOutputToDefault ()
 turn off all output from the solver More...
 
virtual void forceSolverOutput (int log_level)
 turn on all output from the solver More...
 
virtual std::string & solverName ()
 Get the solver name. More...
 
Ipopt::ApplicationReturnStatus getOptStatus () const
 Return status of last optimization. More...
 
Ipopt::IpoptApplication & getIpoptApp ()
 
virtual int errorCode () const
 Error code (solver specific). More...
 
Solve methods
virtual TNLPSolver::ReturnStatus OptimizeTNLP (const Ipopt::SmartPtr< Ipopt::TNLP > &tnlp)
 Solves a problem expresses as a TNLP. More...
 
virtual TNLPSolver::ReturnStatus ReOptimizeTNLP (const Ipopt::SmartPtr< Ipopt::TNLP > &tnlp)
 Resolves a problem expresses as a TNLP. More...
 
virtual bool setWarmStart (const CoinWarmStart *warm, Ipopt::SmartPtr< TMINLP2TNLP > tnlp)
 Set the warm start in the solver. More...
 
virtual CoinWarmStart * getUsedWarmStart (Ipopt::SmartPtr< TMINLP2TNLP > tnlp) const
 Get warm start used in last optimization. More...
 
virtual CoinWarmStart * getWarmStart (Ipopt::SmartPtr< Bonmin::TMINLP2TNLP > tnlp) const
 Get the warm start form the solver. More...
 
virtual CoinWarmStart * getEmptyWarmStart () const
 Solves a problem expresses as a TNLP. More...
 
virtual bool warmStartIsValid (const CoinWarmStart *ws) const
 Check that warm start object is valid. More...
 
virtual void enableWarmStart ()
 Enable the warm start options in the solver. More...
 
virtual void disableWarmStart ()
 Disable the warm start options in the solver. More...
 
- Public Member Functions inherited from Bonmin::TNLPSolver
 TNLPSolver ()
 default Constructor More...
 
 TNLPSolver (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions, Ipopt::SmartPtr< Ipopt::OptionsList > options, Ipopt::SmartPtr< Ipopt::Journalist > journalist, const std::string &prefix)
 Constructor with options initialization. More...
 
virtual ~TNLPSolver ()
 Virtual destructor. More...
 
Ipopt::SmartPtr
< Ipopt::Journalist > 
journalist ()
 Get a pointer to a journalist. More...
 
Ipopt::SmartPtr
< Bonmin::RegisteredOptions
roptions ()
 Get a pointer to RegisteredOptions (generally used to add new ones) More...
 
Ipopt::SmartPtr< const
Ipopt::OptionsList > 
options () const
 Get the options (for getting their values). More...
 
Ipopt::SmartPtr
< Ipopt::OptionsList > 
options ()
 Get the options (for getting and setting their values). More...
 
const char * prefix ()
 Get the prefix. More...
 
bool isRecoverable (ReturnStatus &r)
 Say if an optimization status for a problem which failed is recoverable (problem may be solvable). More...
 
void setup_global_time_limit (double time_limit)
 Setup for a global time limit for solver. More...
 
bool isError (ReturnStatus &r)
 Say if return status is an error. More...
 

Static Public Member Functions

static void RegisterOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
 Register this solver options into passed roptions. More...
 
- Static Public Member Functions inherited from Bonmin::TNLPSolver
static void RegisterOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
 Register this solver options into passed roptions. More...
 

Private Member Functions

void setMinlpDefaults (Ipopt::SmartPtr< Ipopt::OptionsList > Options)
 Set default Ipopt parameters for use in a MINLP. More...
 
TNLPSolver::ReturnStatus solverReturnStatus (Ipopt::ApplicationReturnStatus optimization_status) const
 get Bonmin return status from Ipopt one. More...
 

Private Attributes

Ipopt::SmartPtr
< Ipopt::IpoptApplication > 
app_
 Ipopt application. More...
 
Ipopt::ApplicationReturnStatus optimizationStatus_
 return status of last optimization. More...
 
bool problemHadZeroDimension_
 Flag to indicate if last problem solved had 0 dimension. More...
 
int warmStartStrategy_
 Warm start strategy : More...
 
bool enable_warm_start_
 flag remembering if we want to use warm start option More...
 
bool optimized_before_
 flag remembering if we have call the Optimize method of the IpoptInterface before More...
 

Static Private Attributes

static std::string solverName_ = "Ipopt"
 

Additional Inherited Members

- Public Types inherited from Bonmin::TNLPSolver
enum  ReturnStatus {
  iterationLimit = -3, timeLimit = 5, doesNotConverge = -8, computationError = -2,
  notEnoughFreedom = -1, illDefinedProblem = -4, illegalOption =-5, externalException =-6,
  exception =-7, solvedOptimal = 1, solvedOptimalTol =2, provenInfeasible =3,
  unbounded = 4, numReturnCodes
}
 Standard return statuses for a solver. More...
 
- Protected Member Functions inherited from Bonmin::TNLPSolver
bool zeroDimension (const Ipopt::SmartPtr< Ipopt::TNLP > &tnlp, ReturnStatus &optimization_status)
 Determine if problem is of dimension zero and if it is check if solution is feasible. More...
 
void initializeOptionsAndJournalist ()
 Initializes options and journalist. More...
 
 TNLPSolver (const TNLPSolver &other)
 Copy Constructor. More...
 
- Protected Attributes inherited from Bonmin::TNLPSolver
Ipopt::SmartPtr
< Ipopt::Journalist > 
journalist_
 Storage of Journalist for output. More...
 
Ipopt::SmartPtr
< Ipopt::OptionsList > 
options_
 List of Options. More...
 
Ipopt::SmartPtr
< Bonmin::RegisteredOptions
roptions_
 Registered Options. More...
 
std::string prefix_
 Prefix to use for reading bonmin's options. More...
 
double start_time_
 Global start time. More...
 
double time_limit_
 Global time limit. More...
 
int default_log_level_
 To record default log level. More...
 

Detailed Description

Definition at line 18 of file BonIpoptSolver.hpp.

Constructor & Destructor Documentation

IpoptSolver::IpoptSolver ( bool  createEmpty = false)

Constructor.

Definition at line 27 of file BonIpoptSolver.cpp.

IpoptSolver::IpoptSolver ( Ipopt::SmartPtr< Bonmin::RegisteredOptions roptions,
Ipopt::SmartPtr< Ipopt::OptionsList >  options,
Ipopt::SmartPtr< Ipopt::Journalist >  journalist,
const std::string &  prefix 
)

Constructor with Passed in journalist, registered options, options.

Definition at line 42 of file BonIpoptSolver.cpp.

IpoptSolver::IpoptSolver ( Ipopt::SmartPtr< Bonmin::RegisteredOptions roptions,
Ipopt::SmartPtr< Ipopt::OptionsList >  options,
Ipopt::SmartPtr< Ipopt::Journalist >  journalist 
)

Constructor with Passed in journalist, registered options, options.

Definition at line 60 of file BonIpoptSolver.cpp.

IpoptSolver::IpoptSolver ( const IpoptSolver other)

Copy constructor.

Definition at line 79 of file BonIpoptSolver.cpp.

IpoptSolver::~IpoptSolver ( )
virtual

Virtual destructor.

Definition at line 76 of file BonIpoptSolver.cpp.

Member Function Documentation

virtual UnsolvedError* Bonmin::IpoptSolver::newUnsolvedError ( int  num,
Ipopt::SmartPtr< TMINLP2TNLP problem,
std::string  name 
)
inlinevirtual

Implements Bonmin::TNLPSolver.

Definition at line 39 of file BonIpoptSolver.hpp.

Ipopt::SmartPtr< TNLPSolver > IpoptSolver::clone ( )
virtual

virtual copy constructor

virtual constructor

Implements Bonmin::TNLPSolver.

Definition at line 94 of file BonIpoptSolver.cpp.

bool IpoptSolver::Initialize ( std::string  params_file)
virtual

Initialize the TNLPSolver (read options from params_file)

Implements Bonmin::TNLPSolver.

Definition at line 104 of file BonIpoptSolver.cpp.

bool IpoptSolver::Initialize ( std::istream &  is)
virtual

Initialize the TNLPSolver (read options from istream is)

Implements Bonmin::TNLPSolver.

Definition at line 118 of file BonIpoptSolver.cpp.

TNLPSolver::ReturnStatus IpoptSolver::OptimizeTNLP ( const Ipopt::SmartPtr< Ipopt::TNLP > &  tnlp)
virtual

Solves a problem expresses as a TNLP.

Implements Bonmin::TNLPSolver.

Definition at line 132 of file BonIpoptSolver.cpp.

TNLPSolver::ReturnStatus IpoptSolver::ReOptimizeTNLP ( const Ipopt::SmartPtr< Ipopt::TNLP > &  tnlp)
virtual

Resolves a problem expresses as a TNLP.

Implements Bonmin::TNLPSolver.

Definition at line 177 of file BonIpoptSolver.cpp.

bool IpoptSolver::setWarmStart ( const CoinWarmStart *  warm,
Ipopt::SmartPtr< TMINLP2TNLP tnlp 
)
virtual

Set the warm start in the solver.

Implements Bonmin::TNLPSolver.

Definition at line 362 of file BonIpoptSolver.cpp.

CoinWarmStart * IpoptSolver::getUsedWarmStart ( Ipopt::SmartPtr< TMINLP2TNLP tnlp) const
virtual

Get warm start used in last optimization.

Implements Bonmin::TNLPSolver.

Definition at line 339 of file BonIpoptSolver.cpp.

CoinWarmStart * IpoptSolver::getWarmStart ( Ipopt::SmartPtr< Bonmin::TMINLP2TNLP tnlp) const
virtual

Get the warm start form the solver.

Get warmstarting information.

Implements Bonmin::TNLPSolver.

Definition at line 350 of file BonIpoptSolver.cpp.

CoinWarmStart * IpoptSolver::getEmptyWarmStart ( ) const
virtual

Solves a problem expresses as a TNLP.

Implements Bonmin::TNLPSolver.

Definition at line 405 of file BonIpoptSolver.cpp.

bool IpoptSolver::warmStartIsValid ( const CoinWarmStart *  ws) const
virtual

Check that warm start object is valid.

Implements Bonmin::TNLPSolver.

Definition at line 396 of file BonIpoptSolver.cpp.

void IpoptSolver::enableWarmStart ( )
virtual

Enable the warm start options in the solver.

Implements Bonmin::TNLPSolver.

Definition at line 411 of file BonIpoptSolver.cpp.

void IpoptSolver::disableWarmStart ( )
virtual

Disable the warm start options in the solver.

Implements Bonmin::TNLPSolver.

Definition at line 418 of file BonIpoptSolver.cpp.

double IpoptSolver::CPUTime ( )
virtual

Get the CpuTime of the last optimization.

Implements Bonmin::TNLPSolver.

Definition at line 221 of file BonIpoptSolver.cpp.

int IpoptSolver::IterationCount ( )
virtual

Get the iteration count of the last optimization.

Implements Bonmin::TNLPSolver.

Definition at line 241 of file BonIpoptSolver.cpp.

void IpoptSolver::setOutputToDefault ( )
virtual

turn off all output from the solver

Implements Bonmin::TNLPSolver.

Definition at line 426 of file BonIpoptSolver.cpp.

void IpoptSolver::forceSolverOutput ( int  log_level)
virtual

turn on all output from the solver

Implements Bonmin::TNLPSolver.

Definition at line 433 of file BonIpoptSolver.cpp.

virtual std::string& Bonmin::IpoptSolver::solverName ( )
inlinevirtual

Get the solver name.

Implements Bonmin::TNLPSolver.

Definition at line 123 of file BonIpoptSolver.hpp.

static void Bonmin::IpoptSolver::RegisterOptions ( Ipopt::SmartPtr< Bonmin::RegisteredOptions roptions)
inlinestatic

Register this solver options into passed roptions.

Definition at line 129 of file BonIpoptSolver.hpp.

Ipopt::ApplicationReturnStatus Bonmin::IpoptSolver::getOptStatus ( ) const
inline

Return status of last optimization.

Definition at line 137 of file BonIpoptSolver.hpp.

Ipopt::IpoptApplication& Bonmin::IpoptSolver::getIpoptApp ( )
inline

Definition at line 142 of file BonIpoptSolver.hpp.

virtual int Bonmin::IpoptSolver::errorCode ( ) const
inlinevirtual

Error code (solver specific).

Implements Bonmin::TNLPSolver.

Definition at line 147 of file BonIpoptSolver.hpp.

void IpoptSolver::setMinlpDefaults ( Ipopt::SmartPtr< Ipopt::OptionsList >  Options)
private

Set default Ipopt parameters for use in a MINLP.

Definition at line 262 of file BonIpoptSolver.cpp.

TNLPSolver::ReturnStatus IpoptSolver::solverReturnStatus ( Ipopt::ApplicationReturnStatus  optimization_status) const
private

get Bonmin return status from Ipopt one.

Are there a numerical difficulties?

Definition at line 296 of file BonIpoptSolver.cpp.

Member Data Documentation

Ipopt::SmartPtr<Ipopt::IpoptApplication> Bonmin::IpoptSolver::app_
private

Ipopt application.

Definition at line 159 of file BonIpoptSolver.hpp.

Ipopt::ApplicationReturnStatus Bonmin::IpoptSolver::optimizationStatus_
private

return status of last optimization.

Definition at line 161 of file BonIpoptSolver.hpp.

bool Bonmin::IpoptSolver::problemHadZeroDimension_
private

Flag to indicate if last problem solved had 0 dimension.

(in this case Ipopt was not called).

Definition at line 166 of file BonIpoptSolver.hpp.

int Bonmin::IpoptSolver::warmStartStrategy_
private

Warm start strategy :

  1. no warm start,
  2. simple warm start (optimal point),
  3. more elaborate strategies (interior point...).

Definition at line 175 of file BonIpoptSolver.hpp.

bool Bonmin::IpoptSolver::enable_warm_start_
private

flag remembering if we want to use warm start option

Definition at line 178 of file BonIpoptSolver.hpp.

bool Bonmin::IpoptSolver::optimized_before_
private

flag remembering if we have call the Optimize method of the IpoptInterface before

Definition at line 182 of file BonIpoptSolver.hpp.

std::string IpoptSolver::solverName_ = "Ipopt"
staticprivate

Definition at line 184 of file BonIpoptSolver.hpp.


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