Minotaur 0.4.1
Docs for developers
Public Member Functions | Protected Attributes | List of all members
Minotaur::Engine Class Referenceabstract

#include <Engine.h>

Inheritance diagram for Minotaur::Engine:
Inheritance graph
[legend]
Collaboration diagram for Minotaur::Engine:
Collaboration graph
[legend]

Public Member Functions

 Engine ()
 Default constructor.
 
virtual ~Engine ()
 Destroy.
 
virtual void addConstraint (ConstraintPtr)=0
 Add a new constraint to the engine. More...
 
virtual void changeBound (ConstraintPtr cons, BoundType lu, double new_val)=0
 Change a bound of a constraint. More...
 
virtual void changeBound (VariablePtr var, BoundType lu, double new_val)=0
 Change a bound of a variable. More...
 
virtual void changeBound (VariablePtr var, double new_lb, double new_ub)=0
 Change both bounds of a variable. More...
 
virtual void changeConstraint (ConstraintPtr c, LinearFunctionPtr lf, double lb, double ub)=0
 Change the linear function, and the bounds of a constraint. More...
 
virtual void changeConstraint (ConstraintPtr c, NonlinearFunctionPtr nlf)=0
 Change the nonlinear function, and the bounds of a constraint. More...
 
virtual void changeObj (FunctionPtr f, double cb)=0
 Change objective function. More...
 
virtual void clear ()=0
 Clear the loaded problem, if any, from the engine. More...
 
virtual void disableStrBrSetup ()=0
 Restore settings after strong branching. More...
 
virtual EnginePtr emptyCopy ()
 Get a fresh copy of the engine, without the problem loaded into it. More...
 
virtual void enableStrBrSetup ()=0
 Make settings for strong branching. More...
 
virtual ConstSolutionPtr getSolution ()=0
 Get the solution obtained after solving the problem. More...
 
virtual double getSolutionValue ()=0
 Get the solution value. More...
 
virtual EngineStatus solve ()=0
 Solve the problem that was loaded previously. More...
 
virtual std::string getName () const =0
 Get the name. More...
 
virtual EngineStatus getStatus ()=0
 Get the status of the last solve command. More...
 
virtual std::string getStatusString ()
 Return a string that describes the status in simple words.
 
virtual ConstWarmStartPtr getWarmStart ()=0
 
virtual WarmStartPtr getWarmStartCopy ()=0
 
virtual void load (ProblemPtr problem)=0
 
virtual void loadFromWarmStart (const WarmStartPtr ws)=0
 
virtual void negateObj ()=0
 Negate the objective function. Min f is changed to Min -f. More...
 
virtual LoggerPtr getLogger ()
 Return pointer to the log manager.
 
virtual void removeCons (std::vector< ConstraintPtr > &delcons)=0
 Delete constraints from the engine. More...
 
virtual void resetIterationLimit ()=0
 Reset the iteration limit to maximum possible. More...
 
virtual int setDualObjLimit (double)=0
 Set the dual objective limit. More...
 
virtual void setIterationLimit (int limit)=0
 
virtual void setLogger (LoggerPtr logger)
 Set a new log manager.
 
virtual void setOptionsForSingleSolve ()
 
virtual void setOptionsForRepeatedSolve ()
 Set options to solve the NLP repeatedly, with few changes. More...
 
virtual void writeStats (std::ostream &) const
 
virtual void fillStats (std::vector< double > &)
 Accumulate statistics from different threads in a common data. More...
 

Protected Attributes

EngineStatus status_
 Status of the last solve.
 
LoggerPtr logger_
 Keep log.
 

Detailed Description

An Engine is a solver that can solve a Problem. In most invocations of an engine, we will solve a Relaxation. This is an abstract base class and all engines are implemented are derived from here.

Member Function Documentation

◆ addConstraint()

virtual void Minotaur::Engine::addConstraint ( ConstraintPtr  )
pure virtual

◆ changeBound() [1/3]

virtual void Minotaur::Engine::changeBound ( ConstraintPtr  cons,
BoundType  lu,
double  new_val 
)
pure virtual

◆ changeBound() [2/3]

virtual void Minotaur::Engine::changeBound ( VariablePtr  var,
BoundType  lu,
double  new_val 
)
pure virtual

◆ changeBound() [3/3]

virtual void Minotaur::Engine::changeBound ( VariablePtr  var,
double  new_lb,
double  new_ub 
)
pure virtual

◆ changeConstraint() [1/2]

virtual void Minotaur::Engine::changeConstraint ( ConstraintPtr  c,
LinearFunctionPtr  lf,
double  lb,
double  ub 
)
pure virtual

Change the linear function, and the bounds of a constraint.

Parameters
[in]cOriginal constraint that is to be changed.
[lf]The new linear function.
[lb]The new lower bound.
[ub]The new upper bound.

Implemented in Minotaur::BqpdEngine, Minotaur::CbcEngine, Minotaur::CplexLPEngine, Minotaur::CplexMILPEngine, Minotaur::FilterSQPEngine, Minotaur::IpoptEngine, Minotaur::OsiLPEngine, and Minotaur::UnoEngine.

◆ changeConstraint() [2/2]

virtual void Minotaur::Engine::changeConstraint ( ConstraintPtr  c,
NonlinearFunctionPtr  nlf 
)
pure virtual

Change the nonlinear function, and the bounds of a constraint.

Parameters
[in]cOriginal constraint that is to be changed.
[nlf]The new nonlinear function.

Implemented in Minotaur::CbcEngine, Minotaur::CplexLPEngine, Minotaur::CplexMILPEngine, Minotaur::FilterSQPEngine, Minotaur::OsiLPEngine, Minotaur::BqpdEngine, Minotaur::IpoptEngine, and Minotaur::UnoEngine.

◆ changeObj()

virtual void Minotaur::Engine::changeObj ( FunctionPtr  f,
double  cb 
)
pure virtual

◆ clear()

virtual void Minotaur::Engine::clear ( )
pure virtual

◆ disableStrBrSetup()

virtual void Minotaur::Engine::disableStrBrSetup ( )
pure virtual

◆ emptyCopy()

virtual EnginePtr Minotaur::Engine::emptyCopy ( )
inlinevirtual

◆ enableStrBrSetup()

virtual void Minotaur::Engine::enableStrBrSetup ( )
pure virtual

◆ fillStats()

virtual void Minotaur::Engine::fillStats ( std::vector< double > &  )
inlinevirtual

Accumulate statistics from different threads in a common data.

Reimplemented in Minotaur::CplexLPEngine, Minotaur::IpoptEngine, Minotaur::OsiLPEngine, and Minotaur::UnoEngine.

◆ getName()

virtual std::string Minotaur::Engine::getName ( ) const
pure virtual

◆ getSolution()

virtual ConstSolutionPtr Minotaur::Engine::getSolution ( )
pure virtual

◆ getSolutionValue()

virtual double Minotaur::Engine::getSolutionValue ( )
pure virtual

◆ getStatus()

virtual EngineStatus Minotaur::Engine::getStatus ( )
pure virtual

◆ getWarmStart()

virtual ConstWarmStartPtr Minotaur::Engine::getWarmStart ( )
pure virtual

Get warm start information from the engine. This warm start information can change if the engine is used to solve something else again.

Implemented in Minotaur::BqpdEngine, Minotaur::CbcEngine, Minotaur::CplexLPEngine, Minotaur::CplexMILPEngine, Minotaur::FilterSQPEngine, Minotaur::IpoptEngine, Minotaur::OsiLPEngine, Minotaur::qpOASESEngine, and Minotaur::UnoEngine.

◆ getWarmStartCopy()

virtual WarmStartPtr Minotaur::Engine::getWarmStartCopy ( )
pure virtual

Get a full copy of warm start information from the engine. Does not change even if the engine starts solving something else later on.

Implemented in Minotaur::BqpdEngine, Minotaur::CbcEngine, Minotaur::CplexLPEngine, Minotaur::CplexMILPEngine, Minotaur::FilterSQPEngine, Minotaur::IpoptEngine, Minotaur::OsiLPEngine, Minotaur::qpOASESEngine, and Minotaur::UnoEngine.

◆ load()

virtual void Minotaur::Engine::load ( ProblemPtr  problem)
pure virtual

◆ loadFromWarmStart()

virtual void Minotaur::Engine::loadFromWarmStart ( const WarmStartPtr  ws)
pure virtual

Use warm start information for solving the next problem. May Create a copy of WarmStart and use the copy inside the engine; the copy (but not the original) gets updated after solving a relaxation.

Implemented in Minotaur::IpoptEngine, Minotaur::OsiLPEngine, Minotaur::UnoEngine, Minotaur::CbcEngine, Minotaur::CplexLPEngine, Minotaur::CplexMILPEngine, Minotaur::FilterSQPEngine, Minotaur::BqpdEngine, and Minotaur::qpOASESEngine.

◆ negateObj()

virtual void Minotaur::Engine::negateObj ( )
pure virtual

◆ removeCons()

virtual void Minotaur::Engine::removeCons ( std::vector< ConstraintPtr > &  delcons)
pure virtual

Delete constraints from the engine.

Parameters
[in]delconsA vector of constraint pointers that should be deleted from the engine.

Implemented in Minotaur::BqpdEngine, Minotaur::CbcEngine, Minotaur::CplexLPEngine, Minotaur::CplexMILPEngine, Minotaur::FilterSQPEngine, Minotaur::IpoptEngine, Minotaur::OsiLPEngine, and Minotaur::UnoEngine.

◆ resetIterationLimit()

virtual void Minotaur::Engine::resetIterationLimit ( )
pure virtual

◆ setDualObjLimit()

virtual int Minotaur::Engine::setDualObjLimit ( double  )
pure virtual

◆ setIterationLimit()

virtual void Minotaur::Engine::setIterationLimit ( int  limit)
pure virtual

◆ setOptionsForRepeatedSolve()

virtual void Minotaur::Engine::setOptionsForRepeatedSolve ( )
inlinevirtual

Set options to solve the NLP repeatedly, with few changes.

Reimplemented in Minotaur::IpoptEngine, and Minotaur::UnoEngine.

◆ setOptionsForSingleSolve()

virtual void Minotaur::Engine::setOptionsForSingleSolve ( )
inlinevirtual

Set options to solve the NLP only once or very few times, with possibly several changes.

Reimplemented in Minotaur::IpoptEngine, and Minotaur::UnoEngine.

◆ solve()

virtual EngineStatus Minotaur::Engine::solve ( )
pure virtual

◆ writeStats()

virtual void Minotaur::Engine::writeStats ( std::ostream &  ) const
inlinevirtual

Write statistics to the logger. If the log level is too low, no statistics may be written.

Reimplemented in Minotaur::BqpdEngine, Minotaur::CbcEngine, Minotaur::CplexLPEngine, Minotaur::CplexMILPEngine, Minotaur::FilterSQPEngine, Minotaur::IpoptEngine, Minotaur::OsiLPEngine, and Minotaur::UnoEngine.


The documentation for this class was generated from the following files:

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025