Derived class for managing cuts. Adds all violated cuts from the storage to the relaxation and never removes any. If a new cut is reported but not violated by the current solution then it is added to storage. This manager does not check for duplicacy or any other numerical problems in cuts.
More...
#include <SimpleCutMan.h>
|
|
| SimpleCutMan () |
| | Empty constructor.
|
| |
| | SimpleCutMan (EnvPtr env, ProblemPtr p) |
| | Default constructor.
|
| |
|
| ~SimpleCutMan () |
| | Destroy.
|
| |
| void | addCut (CutPtr c) |
| | Add a cut to be managed by the cut manager.
|
| |
| ConstraintPtr | addCut (ProblemPtr p, FunctionPtr f, double lb, double ub, bool directToRel, bool neverDelete) |
| | Add a cut.
|
| |
| void | addCuts (CutVectorIter cbeg, CutVectorIter cend) |
| | 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).
|
| |
| size_t | getNumCuts () const |
| | Get the total number of cuts available to the manager.
|
| |
| size_t | getNumEnabledCuts () const |
| | Get the total number of cuts currently enabled, i.e., added to the relaxation.
|
| |
| size_t | getNumDisabledCuts () const |
| | Get the total number of cuts currently not enabled.
|
| |
| size_t | getNumNewCuts () const |
| | Get the total number of cuts added to manager (but not to problem) before the last call to separate() or postSolveUpdate().
|
| |
| void | postSolveUpdate (ConstSolutionPtr sol, EngineStatus eng_status) |
| |
| void | separate (ProblemPtr p, ConstSolutionPtr sol, bool *separated, size_t *added) |
| | Separate a given point using the cuts in the storage.
|
| |
| void | write (std::ostream &out) const |
| | Write cuts to output.
|
| |
| void | writeStats (std::ostream &out) const |
| | Write statistics to output.
|
| |
|
| CutManager () |
| | Empty constructor.
|
| |
|
virtual | ~CutManager () |
| | Destroy.
|
| |
| virtual void | addCutToPool (CutPtr c)=0 |
| | Add a cut to the pool managed by the cut manager.
|
| |
|
virtual std::vector< ConstraintPtr > | getPoolCons ()=0 |
| |
| virtual void | nodeIsBranched (NodePtr, ConstSolutionPtr, int) |
| | Update information on a node which is branched.
|
| |
| virtual void | nodeIsProcessed (NodePtr) |
| | Update information when a node is processed.
|
| |
| virtual void | updatePool (ProblemPtr, ConstSolutionPtr) |
| | Update information of the cuts in the pool.
|
| |
| virtual void | updateRel (ConstSolutionPtr, ProblemPtr) |
| | Update information about cuts in the relaxation.
|
| |
Derived class for managing cuts. Adds all violated cuts from the storage to the relaxation and never removes any. If a new cut is reported but not violated by the current solution then it is added to storage. This manager does not check for duplicacy or any other numerical problems in cuts.
◆ SimpleCutMan()
Default constructor.
- Parameters
-
| [in] | env | Minotaur Environment pointer. |
| [in] | p | Problem pointer to which cuts will be added or deleted. |
◆ addCut() [1/2]
| void SimpleCutMan::addCut |
( |
CutPtr |
c | ) |
|
|
virtual |
Add a cut to be managed by the cut manager.
- Parameters
-
| [in] | c | Cut pointer to be added. Do not change a cut after it is added. |
Implements Minotaur::CutManager.
◆ addCut() [2/2]
Add a cut.
- Parameters
-
| [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 |
- Returns
- A pointer to the constraint added to rel
Implements Minotaur::CutManager.
◆ addCuts()
| void SimpleCutMan::addCuts |
( |
CutVectorIter |
cbeg, |
|
|
CutVectorIter |
cend |
|
) |
| |
|
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).
- Parameters
-
| [in] | cbeg | 'Begin' iterator of the vector of cuts to be added. |
| [in] | cend | 'End' iterator of the vector of cuts to be added. |
Implements Minotaur::CutManager.
◆ getNumCuts()
| size_t SimpleCutMan::getNumCuts |
( |
| ) |
const |
|
virtual |
◆ getNumDisabledCuts()
| size_t SimpleCutMan::getNumDisabledCuts |
( |
| ) |
const |
|
virtual |
◆ getNumEnabledCuts()
| size_t SimpleCutMan::getNumEnabledCuts |
( |
| ) |
const |
|
virtual |
Get the total number of cuts currently enabled, i.e., added to the relaxation.
Implements Minotaur::CutManager.
◆ getNumNewCuts()
| size_t SimpleCutMan::getNumNewCuts |
( |
| ) |
const |
|
virtual |
Get the total number of cuts added to manager (but not to problem) before the last call to separate() or postSolveUpdate().
Implements Minotaur::CutManager.
◆ postSolveUpdate()
Updates information about the cuts after problem is solved. Also removes cuts from relaxation and/or the storage.
- Parameters
-
| [in] | sol | Solution from previous solve. |
| [in] | e_status | Status of the engine |
Implements Minotaur::CutManager.
◆ separate()
Separate a given point using the cuts in the storage.
- Parameters
-
| [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. |
Implements Minotaur::CutManager.
◆ write()
| void SimpleCutMan::write |
( |
std::ostream & |
out | ) |
const |
|
virtual |
◆ writeStats()
| void SimpleCutMan::writeStats |
( |
std::ostream & |
out | ) |
const |
|
virtual |
The documentation for this class was generated from the following files: