#include <BonTNLPSolver.hpp>
Inheritance diagram for Bonmin::TNLPSolver:
Public Types | |
iterationLimit = -3 | |
doesNotConverge = -8 | |
computationError = -2 | |
notEnoughFreedom = -1 | |
illDefinedProblem = -4 | |
illegalOption = -5 | |
externalException = -6 | |
exception = -7 | |
solvedOptimal = 1 | |
solvedOptimalTol = 2 | |
provenInfeasible = 3 | |
unbounded = 4 | |
numReturnCodes | |
Fake member to know size. | |
enum | ReturnStatus { iterationLimit = -3, 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 | |
TNLPSolver (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions, Ipopt::SmartPtr< Ipopt::OptionsList > options, Ipopt::SmartPtr< Ipopt::Journalist > journalist) | |
Constructor with options initialization. | |
virtual Ipopt::SmartPtr< TNLPSolver > | clone ()=0 |
virtual copy constructor | |
virtual | ~TNLPSolver () |
Virtual destructor. | |
virtual bool | Initialize (std::string params_file)=0 |
Initialize the TNLPSolver (read options from params_file). | |
virtual bool | Initialize (std::istream &is)=0 |
Initialize the TNLPSolver (read options from istream is). | |
Ipopt::SmartPtr< Ipopt::Journalist > | journalist () |
Get a pointer to a journalist. | |
Ipopt::SmartPtr< Bonmin::RegisteredOptions > | roptions () |
Get a pointer to RegisteredOptions (generally used to add new ones). | |
Ipopt::SmartPtr< const Ipopt::OptionsList > | options () const |
Get the options (for getting their values). | |
Ipopt::SmartPtr< Ipopt::OptionsList > | options () |
Get the options (for getting and setting their values). | |
virtual double | CPUTime ()=0 |
Get the CpuTime of the last optimization. | |
virtual int | IterationCount ()=0 |
Get the iteration count of the last optimization. | |
virtual void | turnOffOutput ()=0 |
turn off all output from the solver | |
virtual void | turnOnOutput ()=0 |
turn on all output from the solver | |
virtual std::string & | solverName ()=0 |
Get the solver name. | |
bool | isRecoverable (ReturnStatus &r) |
Say if an optimization status for a problem which failed is recoverable (problem may be solvable). | |
virtual int | errorCode () const =0 |
Error code (solver specific). | |
Solve methods | |
virtual ReturnStatus | OptimizeTNLP (const Ipopt::SmartPtr< Ipopt::TNLP > &tnlp)=0 |
Solves a problem expresses as a TNLP. | |
virtual ReturnStatus | ReOptimizeTNLP (const Ipopt::SmartPtr< Ipopt::TNLP > &tnlp)=0 |
Resolves a problem expresses as a TNLP. | |
virtual bool | setWarmStart (const CoinWarmStart *warm, Ipopt::SmartPtr< TMINLP2TNLP > tnlp)=0 |
Set the warm start in the solver. | |
virtual CoinWarmStart * | getUsedWarmStart (Ipopt::SmartPtr< TMINLP2TNLP > tnlp) const =0 |
Get warm start used in last optimization. | |
virtual CoinWarmStart * | getWarmStart (Ipopt::SmartPtr< TMINLP2TNLP > tnlp) const =0 |
Get the warm start form the solver. | |
virtual CoinWarmStart * | getEmptyWarmStart () const =0 |
Solves a problem expresses as a TNLP. | |
virtual bool | warmStartIsValid (const CoinWarmStart *ws) const =0 |
Check that warm start object is valid. | |
virtual void | enableWarmStart ()=0 |
Enable the warm start options in the solver. | |
virtual void | disableWarmStart ()=0 |
Disable the warm start options in the solver. | |
Static Public Member Functions | |
static void | RegisterOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions) |
Register this solver options into passed roptions. | |
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. | |
void | initializeOptionsAndJournalist () |
Initializes options and journalist. | |
Protected Attributes | |
Ipopt::SmartPtr< Ipopt::Journalist > | journalist_ |
Storage of Journalist for output. | |
Ipopt::SmartPtr< Ipopt::OptionsList > | options_ |
List of Options. | |
Ipopt::SmartPtr< Bonmin::RegisteredOptions > | roptions_ |
Registered Options. | |
Private Member Functions | |
TNLPSolver (TNLPSolver &other) | |
There is no copy constructor for this class. | |
Classes | |
class | UnsolvedError |
We will throw this error when a problem is not solved. More... |
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 25 of file BonTNLPSolver.hpp.
Standard return statuses for a solver.
Definition at line 28 of file BonTNLPSolver.hpp.
Bonmin::TNLPSolver::TNLPSolver | ( | ) |
default Constructor
Bonmin::TNLPSolver::TNLPSolver | ( | Ipopt::SmartPtr< Bonmin::RegisteredOptions > | roptions, | |
Ipopt::SmartPtr< Ipopt::OptionsList > | options, | |||
Ipopt::SmartPtr< Ipopt::Journalist > | journalist | |||
) |
Constructor with options initialization.
virtual Bonmin::TNLPSolver::~TNLPSolver | ( | ) | [virtual] |
Virtual destructor.
Bonmin::TNLPSolver::TNLPSolver | ( | TNLPSolver & | other | ) | [private] |
There is no copy constructor for this class.
virtual UnsolvedError* Bonmin::TNLPSolver::newUnsolvedError | ( | int | num, | |
Ipopt::SmartPtr< TMINLP2TNLP > | problem, | |||
std::string | name | |||
) | [pure virtual] |
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual Ipopt::SmartPtr<TNLPSolver> Bonmin::TNLPSolver::clone | ( | ) | [pure virtual] |
virtual copy constructor
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual bool Bonmin::TNLPSolver::Initialize | ( | std::string | params_file | ) | [pure virtual] |
Initialize the TNLPSolver (read options from params_file).
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual bool Bonmin::TNLPSolver::Initialize | ( | std::istream & | is | ) | [pure virtual] |
Initialize the TNLPSolver (read options from istream is).
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual ReturnStatus Bonmin::TNLPSolver::OptimizeTNLP | ( | const Ipopt::SmartPtr< Ipopt::TNLP > & | tnlp | ) | [pure virtual] |
Solves a problem expresses as a TNLP.
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual ReturnStatus Bonmin::TNLPSolver::ReOptimizeTNLP | ( | const Ipopt::SmartPtr< Ipopt::TNLP > & | tnlp | ) | [pure virtual] |
Resolves a problem expresses as a TNLP.
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual bool Bonmin::TNLPSolver::setWarmStart | ( | const CoinWarmStart * | warm, | |
Ipopt::SmartPtr< TMINLP2TNLP > | tnlp | |||
) | [pure virtual] |
Set the warm start in the solver.
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual CoinWarmStart* Bonmin::TNLPSolver::getUsedWarmStart | ( | Ipopt::SmartPtr< TMINLP2TNLP > | tnlp | ) | const [pure virtual] |
Get warm start used in last optimization.
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual CoinWarmStart* Bonmin::TNLPSolver::getWarmStart | ( | Ipopt::SmartPtr< TMINLP2TNLP > | tnlp | ) | const [pure virtual] |
Get the warm start form the solver.
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual CoinWarmStart* Bonmin::TNLPSolver::getEmptyWarmStart | ( | ) | const [pure virtual] |
Solves a problem expresses as a TNLP.
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual bool Bonmin::TNLPSolver::warmStartIsValid | ( | const CoinWarmStart * | ws | ) | const [pure virtual] |
Check that warm start object is valid.
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual void Bonmin::TNLPSolver::enableWarmStart | ( | ) | [pure virtual] |
Enable the warm start options in the solver.
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual void Bonmin::TNLPSolver::disableWarmStart | ( | ) | [pure virtual] |
Disable the warm start options in the solver.
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
Ipopt::SmartPtr<Ipopt::Journalist> Bonmin::TNLPSolver::journalist | ( | ) | [inline] |
Get a pointer to a journalist.
Definition at line 152 of file BonTNLPSolver.hpp.
References journalist_.
Ipopt::SmartPtr<Bonmin::RegisteredOptions> Bonmin::TNLPSolver::roptions | ( | ) | [inline] |
Get a pointer to RegisteredOptions (generally used to add new ones).
Definition at line 156 of file BonTNLPSolver.hpp.
References roptions_.
Referenced by Bonmin::IpoptSolver::RegisterOptions().
Ipopt::SmartPtr<const Ipopt::OptionsList> Bonmin::TNLPSolver::options | ( | ) | const [inline] |
Get the options (for getting their values).
Definition at line 160 of file BonTNLPSolver.hpp.
References Ipopt::ConstPtr(), and options_.
Referenced by Bonmin::FilterSolver::cachedInfo::cachedInfo(), and Bonmin::BqpdSolver::cachedInfo::cachedInfo().
Ipopt::SmartPtr<Ipopt::OptionsList> Bonmin::TNLPSolver::options | ( | ) | [inline] |
Get the options (for getting and setting their values).
Definition at line 164 of file BonTNLPSolver.hpp.
References options_.
static void Bonmin::TNLPSolver::RegisterOptions | ( | Ipopt::SmartPtr< Bonmin::RegisteredOptions > | roptions | ) | [inline, static] |
Register this solver options into passed roptions.
Reimplemented in Bonmin::IpoptSolver.
Definition at line 168 of file BonTNLPSolver.hpp.
virtual double Bonmin::TNLPSolver::CPUTime | ( | ) | [pure virtual] |
Get the CpuTime of the last optimization.
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual int Bonmin::TNLPSolver::IterationCount | ( | ) | [pure virtual] |
Get the iteration count of the last optimization.
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual void Bonmin::TNLPSolver::turnOffOutput | ( | ) | [pure virtual] |
turn off all output from the solver
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual void Bonmin::TNLPSolver::turnOnOutput | ( | ) | [pure virtual] |
turn on all output from the solver
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
virtual std::string& Bonmin::TNLPSolver::solverName | ( | ) | [pure virtual] |
Get the solver name.
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, 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).
virtual int Bonmin::TNLPSolver::errorCode | ( | ) | const [pure virtual] |
Error code (solver specific).
Implemented in Bonmin::BqpdSolver, Bonmin::FilterSolver, and Bonmin::IpoptSolver.
bool Bonmin::TNLPSolver::zeroDimension | ( | const Ipopt::SmartPtr< Ipopt::TNLP > & | tnlp, | |
ReturnStatus & | optimization_status | |||
) | [protected] |
Determine if problem is of dimension zero and if it is check if solution is feasible.
void Bonmin::TNLPSolver::initializeOptionsAndJournalist | ( | ) | [protected] |
Initializes options and journalist.
Storage of Journalist for output.
Definition at line 200 of file BonTNLPSolver.hpp.
Referenced by journalist().
Registered Options.
Definition at line 206 of file BonTNLPSolver.hpp.
Referenced by Bonmin::FilterSolver::registerOptions(), Bonmin::BqpdSolver::registerOptions(), and roptions().