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