This is a generic class for calling an NLP solver to solve a TNLP. More...
#include <BonTNLPSolver.hpp>
Classes | |
class | UnsolvedError |
We will throw this error when a problem is not solved. More... | |
Public Types | |
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... | |
Public Member Functions | |
virtual UnsolvedError * | newUnsolvedError (int num, Ipopt::SmartPtr< TMINLP2TNLP > problem, std::string name)=0 |
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 Ipopt::SmartPtr < TNLPSolver > | clone ()=0 |
virtual copy constructor More... | |
virtual | ~TNLPSolver () |
Virtual destructor. More... | |
virtual bool | Initialize (std::string params_file)=0 |
Initialize the TNLPSolver (read options from params_file) More... | |
virtual bool | Initialize (std::istream &is)=0 |
Initialize the TNLPSolver (read options from istream is) 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... | |
virtual double | CPUTime ()=0 |
Get the CpuTime of the last optimization. More... | |
virtual int | IterationCount ()=0 |
Get the iteration count of the last optimization. More... | |
virtual void | setOutputToDefault ()=0 |
turn off all output from the solver More... | |
virtual void | forceSolverOutput (int log_level)=0 |
turn on all output from the solver More... | |
virtual std::string & | solverName ()=0 |
Get the solver name. 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... | |
virtual int | errorCode () const =0 |
Error code (solver specific). More... | |
Solve methods | |
virtual ReturnStatus | OptimizeTNLP (const Ipopt::SmartPtr< Ipopt::TNLP > &tnlp)=0 |
Solves a problem expresses as a TNLP. More... | |
virtual ReturnStatus | ReOptimizeTNLP (const Ipopt::SmartPtr< Ipopt::TNLP > &tnlp)=0 |
Resolves a problem expresses as a TNLP. More... | |
virtual bool | setWarmStart (const CoinWarmStart *warm, Ipopt::SmartPtr< TMINLP2TNLP > tnlp)=0 |
Set the warm start in the solver. More... | |
virtual CoinWarmStart * | getUsedWarmStart (Ipopt::SmartPtr< TMINLP2TNLP > tnlp) const =0 |
Get warm start used in last optimization. More... | |
virtual CoinWarmStart * | getWarmStart (Ipopt::SmartPtr< TMINLP2TNLP > tnlp) const =0 |
Get the warm start form the solver. More... | |
virtual CoinWarmStart * | getEmptyWarmStart () const =0 |
Solves a problem expresses as a TNLP. More... | |
virtual bool | warmStartIsValid (const CoinWarmStart *ws) const =0 |
Check that warm start object is valid. More... | |
virtual void | enableWarmStart ()=0 |
Enable the warm start options in the solver. More... | |
virtual void | disableWarmStart ()=0 |
Disable the warm start options in the solver. More... | |
Static Public Member Functions | |
static void | RegisterOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions) |
Register this solver options into passed roptions. More... | |
Protected Member Functions | |
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 | |
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... | |
This is a generic class for calling an NLP solver to solve a TNLP.
A TNLPSolver is able to solve and resolve a problem, it has some options (stored with Ipopt OptionList structure and registeredOptions) it produces some statistics (in SolveStatisctics and sometimes some errorCodes.
Definition at line 26 of file BonTNLPSolver.hpp.
Standard return statuses for a solver.
Definition at line 29 of file BonTNLPSolver.hpp.
Bonmin::TNLPSolver::TNLPSolver | ( | ) |
default Constructor
Definition at line 42 of file BonTNLPSolver.cpp.
Bonmin::TNLPSolver::TNLPSolver | ( | Ipopt::SmartPtr< Bonmin::RegisteredOptions > | roptions, |
Ipopt::SmartPtr< Ipopt::OptionsList > | options, | ||
Ipopt::SmartPtr< Ipopt::Journalist > | journalist, | ||
const std::string & | prefix | ||
) |
Constructor with options initialization.
Definition at line 49 of file BonTNLPSolver.cpp.
|
virtual |
Virtual destructor.
Definition at line 73 of file BonTNLPSolver.cpp.
|
protected |
Copy Constructor.
Definition at line 62 of file BonTNLPSolver.cpp.
|
pure virtual |
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
|
pure virtual |
virtual copy constructor
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Initialize the TNLPSolver (read options from params_file)
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Initialize the TNLPSolver (read options from istream is)
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Solves a problem expresses as a TNLP.
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Resolves a problem expresses as a TNLP.
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Set the warm start in the solver.
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Get warm start used in last optimization.
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Get the warm start form the solver.
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Solves a problem expresses as a TNLP.
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Check that warm start object is valid.
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Enable the warm start options in the solver.
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Disable the warm start options in the solver.
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
inline |
Get a pointer to a journalist.
Definition at line 155 of file BonTNLPSolver.hpp.
|
inline |
Get a pointer to RegisteredOptions (generally used to add new ones)
Definition at line 159 of file BonTNLPSolver.hpp.
|
inline |
Get the options (for getting their values).
Definition at line 163 of file BonTNLPSolver.hpp.
|
inline |
Get the options (for getting and setting their values).
Definition at line 167 of file BonTNLPSolver.hpp.
|
inline |
Get the prefix.
Definition at line 171 of file BonTNLPSolver.hpp.
|
inlinestatic |
Register this solver options into passed roptions.
Definition at line 175 of file BonTNLPSolver.hpp.
|
pure virtual |
Get the CpuTime of the last optimization.
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Get the iteration count of the last optimization.
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
turn off all output from the solver
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
turn on all output from the solver
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
pure virtual |
Get the solver name.
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
bool Bonmin::TNLPSolver::isRecoverable | ( | ReturnStatus & | r | ) |
Say if an optimization status for a problem which failed is recoverable (problem may be solvable).
Definition at line 253 of file BonTNLPSolver.cpp.
|
inline |
Setup for a global time limit for solver.
Definition at line 196 of file BonTNLPSolver.hpp.
|
inline |
Say if return status is an error.
Definition at line 202 of file BonTNLPSolver.hpp.
|
pure virtual |
Error code (solver specific).
Implemented in Bonmin::FilterSolver, Bonmin::BqpdSolver, and Bonmin::IpoptSolver.
|
protected |
Determine if problem is of dimension zero and if it is check if solution is feasible.
Definition at line 78 of file BonTNLPSolver.cpp.
|
protected |
Initializes options and journalist.
Initialize the options and the journalist.
Definition at line 259 of file BonTNLPSolver.cpp.
|
protected |
Storage of Journalist for output.
Definition at line 216 of file BonTNLPSolver.hpp.
|
protected |
List of Options.
Definition at line 219 of file BonTNLPSolver.hpp.
|
protected |
Registered Options.
Definition at line 222 of file BonTNLPSolver.hpp.
|
protected |
Prefix to use for reading bonmin's options.
Definition at line 225 of file BonTNLPSolver.hpp.
|
protected |
Global start time.
Definition at line 227 of file BonTNLPSolver.hpp.
|
protected |
Global time limit.
Definition at line 230 of file BonTNLPSolver.hpp.
|
protected |
To record default log level.
Definition at line 233 of file BonTNLPSolver.hpp.