17 #include "IpOptionsList.hpp"
18 #include "CoinWarmStart.hpp"
20 #include "CoinTime.hpp"
66 std::cerr<<
"FIXME"<<std::endl;
72 virtual const std::string&
errorName()
const = 0;
74 virtual const std::string&
solverName()
const = 0;
97 std::string name) = 0;
108 const std::string &
prefix);
118 virtual bool Initialize(std::string params_file) = 0;
122 virtual bool Initialize(std::istream& is) = 0;
int default_log_level_
To record default log level.
virtual Ipopt::SmartPtr< TNLPSolver > clone()=0
virtual copy constructor
UnsolvedError(int errorNum=-10000, Ipopt::SmartPtr< TMINLP2TNLP > model=NULL, std::string name="")
Constructor.
Ipopt::SmartPtr< Ipopt::OptionsList > options()
Get the options (for getting and setting their values).
bool isError(ReturnStatus &r)
Say if return status is an error.
void initializeOptionsAndJournalist()
Initializes options and journalist.
virtual double CPUTime()=0
Get the CpuTime of the last optimization.
Ipopt::SmartPtr< Ipopt::Journalist > journalist()
Get a pointer to a journalist.
Ipopt::SmartPtr< Ipopt::Journalist > journalist_
Storage of Journalist for output.
Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions()
Get a pointer to RegisteredOptions (generally used to add new ones)
virtual ~UnsolvedError()
destructor.
virtual ReturnStatus ReOptimizeTNLP(const Ipopt::SmartPtr< Ipopt::TNLP > &tnlp)=0
Resolves a problem expresses as a TNLP.
std::string prefix_
Prefix to use for reading bonmin's options.
void writeDiffFiles(const std::string prefix=std::string()) const
write files with differences between input model and this one
This is a generic class for calling an NLP solver to solve a TNLP.
virtual const std::string & errorName() const =0
Get the string corresponding to error.
double start_time_
Global start time.
void setup_global_time_limit(double time_limit)
Setup for a global time limit for solver.
double time_limit_
Global time limit.
virtual CoinWarmStart * getEmptyWarmStart() const =0
Solves a problem expresses as a TNLP.
virtual void setOutputToDefault()=0
turn off all output from the solver
static void RegisterOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register this solver options into passed roptions.
int errorNum() const
Return error number.
int errorNum_
Error code (solver dependent).
virtual const std::string & solverName() const =0
Return the name of the solver.
virtual bool setWarmStart(const CoinWarmStart *warm, Ipopt::SmartPtr< TMINLP2TNLP > tnlp)=0
Set the warm start in the solver.
virtual int IterationCount()=0
Get the iteration count of the last optimization.
virtual std::string & solverName()=0
Get the solver name.
OSSmartPtr< const U > ConstPtr(const OSSmartPtr< U > &smart_ptr)
void printError(std::ostream &os)
Print error message.
void fint fint fint real fint real real real real real real real * r
Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions_
Registered Options.
void fint fint fint real fint real real real real real real real real real fint real fint fint fint real * ws
virtual void enableWarmStart()=0
Enable the warm start options in the solver.
ReturnStatus
Standard return statuses for a solver.
virtual bool warmStartIsValid(const CoinWarmStart *ws) const =0
Check that warm start object is valid.
bool isRecoverable(ReturnStatus &r)
Say if an optimization status for a problem which failed is recoverable (problem may be solvable)...
virtual CoinWarmStart * getWarmStart(Ipopt::SmartPtr< TMINLP2TNLP > tnlp) const =0
Get the warm start form the solver.
virtual void forceSolverOutput(int log_level)=0
turn on all output from the solver
Ipopt::SmartPtr< const Ipopt::OptionsList > options() const
Get the options (for getting their values).
std::string name_
name of the model on which error occured.
We will throw this error when a problem is not solved.
virtual CoinWarmStart * getUsedWarmStart(Ipopt::SmartPtr< TMINLP2TNLP > tnlp) const =0
Get warm start used in last optimization.
TNLPSolver()
default Constructor
virtual void disableWarmStart()=0
Disable the warm start options in the solver.
virtual bool Initialize(std::string params_file)=0
Initialize the TNLPSolver (read options from params_file)
virtual ReturnStatus OptimizeTNLP(const Ipopt::SmartPtr< Ipopt::TNLP > &tnlp)=0
Solves a problem expresses as a TNLP.
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.
Ipopt::SmartPtr< Ipopt::OptionsList > options_
List of Options.
const char * prefix()
Get the prefix.
virtual int errorCode() const =0
Error code (solver specific).
Ipopt::SmartPtr< TMINLP2TNLP > model_
model_ on which error occured
Fake member to know size.
virtual ~TNLPSolver()
Virtual destructor.
virtual UnsolvedError * newUnsolvedError(int num, Ipopt::SmartPtr< TMINLP2TNLP > problem, std::string name)=0