Minotaur 0.4.1
Docs for developers
|
Abstract base class to manage cuts in the relaxation. More...
#include <CutManager.h>
Public Member Functions | |
CutManager () | |
Empty constructor. | |
virtual | ~CutManager () |
Destroy. | |
virtual void | addCut (CutPtr c)=0 |
Add a cut to be managed by the cut manager. More... | |
virtual void | addCutToPool (CutPtr c)=0 |
Add a cut to the pool managed by the cut manager. More... | |
virtual ConstraintPtr | addCut (ProblemPtr p, FunctionPtr f, double lb, double ub, bool direct_to_rel, bool never_del)=0 |
Add a cut. More... | |
virtual void | addCuts (CutVectorIter cbeg, CutVectorIter cend)=0 |
Add a cut to be managed by the cut manager. The cut is not added to the problem by this function (See separate() for it). More... | |
virtual size_t | getNumCuts () const =0 |
Get the total number of cuts available to the manager. More... | |
virtual size_t | getNumEnabledCuts () const =0 |
Get the total number of cuts currently enabled, i.e., added to the relaxation. More... | |
virtual size_t | getNumDisabledCuts () const =0 |
Get the total number of cuts currently not enabled. More... | |
virtual size_t | getNumNewCuts () const =0 |
Get the total number of cuts added to manager (but not to problem) before the last call to separate() or postSolveUpdate(). More... | |
virtual std::vector< ConstraintPtr > | getPoolCons ()=0 |
virtual void | nodeIsBranched (NodePtr, ConstSolutionPtr, int) |
Update information on a node which is branched. More... | |
virtual void | nodeIsProcessed (NodePtr) |
Update information when a node is processed. More... | |
virtual void | postSolveUpdate (ConstSolutionPtr sol, EngineStatus e_status)=0 |
virtual void | separate (ProblemPtr p, ConstSolutionPtr sol, bool *separated, size_t *n_added)=0 |
Separate a given point using the cuts in the storage. More... | |
virtual void | updatePool (ProblemPtr, ConstSolutionPtr) |
Update information of the cuts in the pool. More... | |
virtual void | updateRel (ConstSolutionPtr, ProblemPtr) |
Update information about cuts in the relaxation. More... | |
virtual void | write (std::ostream &out) const =0 |
Write cuts to output. More... | |
virtual void | writeStats (std::ostream &out) const =0 |
Write statistics to output. More... | |
Abstract base class to manage cuts in the relaxation.
The CutManager class is meant to `‘manage’' the cutting planes generated by different cut generators and handlers. By manage we mean:
|
pure virtual |
Add a cut to be managed by the cut manager.
[in] | c | Cut pointer to be added. Do not change a cut after it is added. |
Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.
|
pure virtual |
Add a cut.
[in] | p | Problem to add a cut to |
[in] | f | Function of the cut |
[in] | lb | Lower bound |
[in] | ub | Upper bound |
[in] | direct_to_rel | Whether add the cut directly to rel |
[in] | never_del | Whether the cut should always remain in the pool |
Implemented in Minotaur::SimpleCutMan, Minotaur::CutMan2, Minotaur::CutMan1, and Minotaur::ParCutMan.
|
pure virtual |
Add a cut to be managed by the cut manager. The cut is not added to the problem by this function (See separate() for it).
[in] | cbeg | 'Begin' iterator of the vector of cuts to be added. |
[in] | cend | 'End' iterator of the vector of cuts to be added. |
Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.
|
pure virtual |
Add a cut to the pool managed by the cut manager.
[in] | c | Cut pointer to be added. |
Implemented in Minotaur::ParCutMan.
|
pure virtual |
Get the total number of cuts available to the manager.
Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.
|
pure virtual |
Get the total number of cuts currently not enabled.
Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.
|
pure virtual |
Get the total number of cuts currently enabled, i.e., added to the relaxation.
Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.
|
pure virtual |
Get the total number of cuts added to manager (but not to problem) before the last call to separate() or postSolveUpdate().
Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.
|
inlinevirtual |
Update information on a node which is branched.
[in] | NodePtr | branched node. |
[in] | ConstSolutionPtr | solution of the lp solve in the node. |
[in] | int | number of children |
|
inlinevirtual |
Update information when a node is processed.
[in] | NodePtr | node which has already been processed |
|
pure virtual |
Updates information about the cuts after problem is solved. Also removes cuts from relaxation and/or the storage.
[in] | sol | Solution from previous solve. |
[in] | e_status | Status of the engine |
Implemented in Minotaur::CutMan1, Minotaur::ParCutMan, Minotaur::SimpleCutMan, and Minotaur::CutMan2.
|
pure virtual |
Separate a given point using the cuts in the storage.
[in] | sol | Solution that needs to be separated. |
[out] | separated | True if solution is separated by cuts. False otherwise. |
[out] | n_added | The number of cuts added by this routine to the problem. |
Implemented in Minotaur::SimpleCutMan, Minotaur::CutMan1, Minotaur::ParCutMan, and Minotaur::CutMan2.
|
inlinevirtual |
Update information of the cuts in the pool.
[in] | problem | Pointer to the relaxation problem |
[in] | sol | Solution of the LP solve |
[in] | node | Node in which information gets updated |
Reimplemented in Minotaur::CutMan2.
|
inlinevirtual |
Update information about cuts in the relaxation.
[in] | sol | Solution of the LP solve |
[in] | problem | Pointer to the relaxation problem |
Reimplemented in Minotaur::CutMan2.
|
pure virtual |
Write cuts to output.
Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.
|
pure virtual |
Write statistics to output.
Implemented in Minotaur::CutMan1, Minotaur::CutMan2, Minotaur::ParCutMan, and Minotaur::SimpleCutMan.