Minotaur 0.4.1
Docs for developers
Public Member Functions | List of all members
Minotaur::ParCutMan Class Reference

Derived class for managing cuts. Add and remove cuts based on priority and violation. More...

#include <ParCutMan.h>

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

Public Member Functions

 ParCutMan ()
 Empty constructor.
 
 ParCutMan (EnvPtr env, ProblemPtr p)
 Default constructor. More...
 
 ~ParCutMan ()
 Destroy.
 
void addCut (CutPtr c)
 Add a cut to be managed by the cut manager. More...
 
void addCutToPool (CutPtr cut)
 Add a cut to the pool managed by the cut manager. More...
 
std::vector< ConstraintPtrgetPoolCons ()
 
ConstraintPtr addCut (ProblemPtr, FunctionPtr, double, double, bool, bool)
 Add a cut. More...
 
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). More...
 
size_t getNumCuts () const
 Get the total number of cuts available to the manager. More...
 
size_t getNumEnabledCuts () const
 Get the total number of cuts currently enabled, i.e., added to the relaxation. More...
 
size_t getNumDisabledCuts () const
 Get the total number of cuts currently not enabled. More...
 
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(). More...
 
void postSolveUpdate (ConstSolutionPtr sol, EngineStatus eng_status)
 
void separate (ProblemPtr p, ConstSolutionPtr sol, bool *separated, size_t *n_added)
 Separate a given point using the cuts in the storage. More...
 
void write (std::ostream &out) const
 Write cuts to output. More...
 
void writeStats (std::ostream &out) const
 Write statistics to output. More...
 
- Public Member Functions inherited from Minotaur::CutManager
 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< ConstraintPtrgetPoolCons ()=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...
 

Detailed Description

Derived class for managing cuts. Add and remove cuts based on priority and violation.

Constructor & Destructor Documentation

◆ ParCutMan()

ParCutMan::ParCutMan ( EnvPtr  env,
ProblemPtr  p 
)

Default constructor.

Parameters
[in]envMinotaur Environment pointer.
[in]pProblem pointer to which cuts will be added or deleted.

Member Function Documentation

◆ addCut() [1/2]

void ParCutMan::addCut ( CutPtr  c)
virtual

Add a cut to be managed by the cut manager.

Parameters
[in]cCut pointer to be added. Do not change a cut after it is added.

Implements Minotaur::CutManager.

◆ addCut() [2/2]

ConstraintPtr Minotaur::ParCutMan::addCut ( ProblemPtr  p,
FunctionPtr  f,
double  lb,
double  ub,
bool  direct_to_rel,
bool  never_del 
)
inlinevirtual

Add a cut.

Parameters
[in]pProblem to add a cut to
[in]fFunction of the cut
[in]lbLower bound
[in]ubUpper bound
[in]direct_to_relWhether add the cut directly to rel
[in]never_delWhether the cut should always remain in the pool
Returns
A pointer to the constraint added to rel

Implements Minotaur::CutManager.

◆ addCuts()

void ParCutMan::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.

◆ addCutToPool()

void ParCutMan::addCutToPool ( CutPtr  c)
virtual

Add a cut to the pool managed by the cut manager.

Parameters
[in]cCut pointer to be added.

Implements Minotaur::CutManager.

◆ getNumCuts()

size_t ParCutMan::getNumCuts ( ) const
virtual

Get the total number of cuts available to the manager.

Implements Minotaur::CutManager.

◆ getNumDisabledCuts()

size_t ParCutMan::getNumDisabledCuts ( ) const
virtual

Get the total number of cuts currently not enabled.

Implements Minotaur::CutManager.

◆ getNumEnabledCuts()

size_t ParCutMan::getNumEnabledCuts ( ) const
virtual

Get the total number of cuts currently enabled, i.e., added to the relaxation.

Implements Minotaur::CutManager.

◆ getNumNewCuts()

size_t ParCutMan::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.

◆ getPoolCons()

std::vector< ConstraintPtr > ParCutMan::getPoolCons ( )
virtual

Implements Minotaur::CutManager.

◆ postSolveUpdate()

void ParCutMan::postSolveUpdate ( ConstSolutionPtr  sol,
EngineStatus  e_status 
)
virtual

Updates information about the cuts after problem is solved. Also removes cuts from relaxation and/or the storage.

Parameters
[in]solSolution from previous solve.
[in]e_statusStatus of the engine

Implements Minotaur::CutManager.

◆ separate()

void ParCutMan::separate ( ProblemPtr  p,
ConstSolutionPtr  sol,
bool *  separated,
size_t *  n_added 
)
virtual

Separate a given point using the cuts in the storage.

Parameters
[in]solSolution that needs to be separated.
[out]separatedTrue if solution is separated by cuts. False otherwise.
[out]n_addedThe number of cuts added by this routine to the problem.

Implements Minotaur::CutManager.

◆ write()

void ParCutMan::write ( std::ostream &  out) const
virtual

Write cuts to output.

Implements Minotaur::CutManager.

◆ writeStats()

void ParCutMan::writeStats ( std::ostream &  out) const
virtual

Write statistics to output.

Implements Minotaur::CutManager.


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