Minotaur 0.4.1
Docs for developers
CutManager.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2010 - 2025 The Minotaur Team.
5//
6
13#ifndef MINOTAURCUTMANAGER_H
14#define MINOTAURCUTMANAGER_H
15
16#include "Types.h"
17
18
19namespace Minotaur {
20
21 class Environment;
22 class Function;
23 class Problem;
24 class Solution;
25 class Cut;
26 class CutManager;
27 typedef CutManager *CutManagerPtr;
28 typedef const Solution *ConstSolutionPtr;
29
42 class CutManager {
43
44 public:
47
49 virtual ~CutManager() {};
50
57 virtual void addCut(CutPtr c) = 0;
58
64 virtual void addCutToPool(CutPtr c) = 0;
65
76 virtual ConstraintPtr addCut(ProblemPtr p, FunctionPtr f, double lb,
77 double ub, bool direct_to_rel,
78 bool never_del) = 0;
79
87 virtual void addCuts(CutVectorIter cbeg, CutVectorIter cend) = 0;
88
90 virtual size_t getNumCuts() const = 0;
91
96 virtual size_t getNumEnabledCuts() const = 0;
97
99 virtual size_t getNumDisabledCuts() const = 0;
100
105 virtual size_t getNumNewCuts() const = 0;
106
107 virtual std::vector<ConstraintPtr> getPoolCons() = 0;
108
116
121 virtual void nodeIsProcessed(NodePtr){};
122
130 EngineStatus e_status) = 0;
131
140 virtual void separate(ProblemPtr p, ConstSolutionPtr sol, bool *separated,
141 size_t *n_added) = 0;
142
150
157
159 virtual void write(std::ostream &out) const = 0;
160
162 virtual void writeStats(std::ostream &out) const = 0;
163 };
164} //namespace Minotaur
165#endif
Declare important 'types' used in Minotaur.
The Constraint class is used to manage a constraint.
Definition: Constraint.h:61
Abstract base class to manage cuts in the relaxation.
Definition: CutManager.h:42
virtual void addCutToPool(CutPtr c)=0
Add a cut to the pool managed by the cut manager.
virtual void writeStats(std::ostream &out) const =0
Write statistics to output.
virtual void addCut(CutPtr c)=0
Add a cut to be managed by the cut manager.
virtual size_t getNumEnabledCuts() const =0
Get the total number of cuts currently enabled, i.e., added to the relaxation.
virtual size_t getNumDisabledCuts() const =0
Get the total number of cuts currently not enabled.
CutManager()
Empty constructor.
Definition: CutManager.h:46
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()...
virtual void separate(ProblemPtr p, ConstSolutionPtr sol, bool *separated, size_t *n_added)=0
Separate a given point using the cuts in the storage.
virtual ~CutManager()
Destroy.
Definition: CutManager.h:49
virtual size_t getNumCuts() const =0
Get the total number of cuts available to the manager.
virtual void nodeIsProcessed(NodePtr)
Update information when a node is processed.
Definition: CutManager.h:121
virtual void write(std::ostream &out) const =0
Write cuts to output.
virtual void updateRel(ConstSolutionPtr, ProblemPtr)
Update information about cuts in the relaxation.
Definition: CutManager.h:156
virtual void postSolveUpdate(ConstSolutionPtr sol, EngineStatus e_status)=0
virtual void nodeIsBranched(NodePtr, ConstSolutionPtr, int)
Update information on a node which is branched.
Definition: CutManager.h:115
virtual ConstraintPtr addCut(ProblemPtr p, FunctionPtr f, double lb, double ub, bool direct_to_rel, bool never_del)=0
Add a cut.
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...
virtual void updatePool(ProblemPtr, ConstSolutionPtr)
Update information of the cuts in the pool.
Definition: CutManager.h:149
Store function, bounds and other information about a cut.
Definition: Cut.h:52
Definition: Function.h:37
Definition: Node.h:54
Definition: Problem.h:74
Definition: Solution.h:30
Definition: ActiveNodeStore.h:20
EngineStatus
Different status that an external engine may report.
Definition: Types.h:176

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