10 #ifndef IpoptSolver_HPP
11 #define IpoptSolver_HPP
13 #include "IpIpoptApplication.hpp"
29 virtual const std::string&
errorName()
const;
55 const std::string &
prefix);
73 virtual bool Initialize(std::string params_file);
131 Ipopt::IpoptApplication::RegisterAllIpoptOptions(
GetRawPtr(roptions));
virtual ~IpoptSolver()
Virtual destructor.
UnsolvedIpoptError(int errorNum, Ipopt::SmartPtr< TMINLP2TNLP > problem, std::string name)
Ipopt::SmartPtr< Ipopt::Journalist > journalist()
Get a pointer to a journalist.
virtual void setOutputToDefault()
turn off all output from the solver
virtual bool setWarmStart(const CoinWarmStart *warm, Ipopt::SmartPtr< TMINLP2TNLP > tnlp)
Set the warm start in the solver.
Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions()
Get a pointer to RegisteredOptions (generally used to add new ones)
virtual void forceSolverOutput(int log_level)
turn on all output from the solver
virtual TNLPSolver::ReturnStatus OptimizeTNLP(const Ipopt::SmartPtr< Ipopt::TNLP > &tnlp)
Solves a problem expresses as a TNLP.
bool problemHadZeroDimension_
Flag to indicate if last problem solved had 0 dimension.
virtual int IterationCount()
Get the iteration count of the last optimization.
This is a generic class for calling an NLP solver to solve a TNLP.
virtual const std::string & solverName() const
Return the name of the solver.
virtual CoinWarmStart * getEmptyWarmStart() const
Solves a problem expresses as a TNLP.
static std::string solverName_
virtual Ipopt::SmartPtr< TNLPSolver > clone()
virtual copy constructor
void setMinlpDefaults(Ipopt::SmartPtr< Ipopt::OptionsList > Options)
Set default Ipopt parameters for use in a MINLP.
virtual int errorCode() const
Error code (solver specific).
TNLPSolver::ReturnStatus solverReturnStatus(Ipopt::ApplicationReturnStatus optimization_status) const
get Bonmin return status from Ipopt one.
int errorNum() const
Return error number.
virtual CoinWarmStart * getUsedWarmStart(Ipopt::SmartPtr< TMINLP2TNLP > tnlp) const
Get warm start used in last optimization.
virtual bool warmStartIsValid(const CoinWarmStart *ws) const
Check that warm start object is valid.
virtual UnsolvedError * newUnsolvedError(int num, Ipopt::SmartPtr< TMINLP2TNLP > problem, std::string name)
Ipopt::ApplicationReturnStatus optimizationStatus_
return status of last optimization.
virtual std::string & solverName()
Get the solver name.
virtual const std::string & errorName() const
Get the string corresponding to error.
Ipopt::SmartPtr< Ipopt::IpoptApplication > app_
Ipopt application.
virtual ~UnsolvedIpoptError()
virtual double CPUTime()
Get the CpuTime of the last optimization.
static void RegisterOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register this solver options into passed roptions.
static std::string solverName_
bool enable_warm_start_
flag remembering if we want to use warm start option
U * GetRawPtr(const OSSmartPtr< U > &smart_ptr)
void fint fint fint real fint real real real real real real real real real fint real fint fint fint real * ws
ReturnStatus
Standard return statuses for a solver.
Ipopt::IpoptApplication & getIpoptApp()
bool optimized_before_
flag remembering if we have call the Optimize method of the IpoptInterface before ...
virtual void enableWarmStart()
Enable the warm start options in the solver.
Ipopt::SmartPtr< const Ipopt::OptionsList > options() const
Get the options (for getting their values).
IpoptSolver(bool createEmpty=false)
Constructor.
We will throw this error when a problem is not solved.
virtual CoinWarmStart * getWarmStart(Ipopt::SmartPtr< Bonmin::TMINLP2TNLP > tnlp) const
Get the warm start form the solver.
virtual TNLPSolver::ReturnStatus ReOptimizeTNLP(const Ipopt::SmartPtr< Ipopt::TNLP > &tnlp)
Resolves a problem expresses as a TNLP.
virtual bool Initialize(std::string params_file)
Initialize the TNLPSolver (read options from params_file)
static std::string errorNames[17]
int warmStartStrategy_
Warm start strategy :
virtual void disableWarmStart()
Disable the warm start options in the solver.
Ipopt::ApplicationReturnStatus getOptStatus() const
Return status of last optimization.
const char * prefix()
Get the prefix.