Minotaur 0.4.1
Docs for developers
ParCutMan.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 MINOTAURPARCUTMAN_H
14#define MINOTAURPARCUTMAN_H
15
16#include <list>
17#include "CutManager.h"
18#include "Types.h"
19
20
21namespace Minotaur {
22
27 class ParCutMan : public CutManager {
28
29 public:
31 ParCutMan();
32
40
42 ~ParCutMan();
43
44 // Base class method.
45 void addCut(CutPtr c);
46
47 void addCutToPool(CutPtr cut);
48
49 std::vector<ConstraintPtr> getPoolCons();
50
51 ConstraintPtr addCut(ProblemPtr, FunctionPtr, double, double, bool, bool)
52 {
53 return ConstraintPtr();
54 };
55
56 // Base class method.
57 void addCuts(CutVectorIter cbeg, CutVectorIter cend);
58
59 // Base class method.
60 size_t getNumCuts() const;
61
62 // Base class method.
63 size_t getNumEnabledCuts() const;
64
65 // Base class method.
66 size_t getNumDisabledCuts() const;
67
68 // Base class method.
69 size_t getNumNewCuts() const;
70
71 // Base class method.
72 void postSolveUpdate(ConstSolutionPtr sol, EngineStatus eng_status);
73
74 // Base class method.
75 void separate(ProblemPtr p, ConstSolutionPtr sol, bool *separated,
76 size_t *n_added);
77
78 // Base class method.
79 void write(std::ostream &out) const;
80
81 // Base class method.
82 void writeStats(std::ostream &out) const;
83
84 private:
86 double absTol_;
87
89 CutList disCuts_;
90
92 CutList enCuts_;
93
95 EnvPtr env_;
96
98 LoggerPtr logger_;
99
101 size_t maxDisCutAge_;
102
107 size_t maxInactCutAge_;
108
110 const static std::string me_;
111
116 CutList newCuts_;
117
119 ProblemPtr p_;
120
121 CutList pool_;
122
123 void addToRel_(CutPtr cons, bool new_cut);
124
125 void addToPool_(CutPtr cons);
126 };
127
128 //typedef ParCutMan * ParCutManPtr;
129} //namespace Minotaur
130#endif
Manages addition and deletion of cuts to problem.
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
Store function, bounds and other information about a cut.
Definition: Cut.h:52
Definition: Environment.h:28
Definition: Function.h:37
Definition: Logger.h:37
Derived class for managing cuts. Add and remove cuts based on priority and violation.
Definition: ParCutMan.h:27
void writeStats(std::ostream &out) const
Write statistics to output.
Definition: ParCutMan.cpp:219
void separate(ProblemPtr p, ConstSolutionPtr sol, bool *separated, size_t *n_added)
Separate a given point using the cuts in the storage.
Definition: ParCutMan.cpp:138
void addCut(CutPtr c)
Add a cut to be managed by the cut manager.
Definition: ParCutMan.cpp:180
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...
Definition: ParCutMan.cpp:186
size_t getNumEnabledCuts() const
Get the total number of cuts currently enabled, i.e., added to the relaxation.
Definition: ParCutMan.cpp:74
void addCutToPool(CutPtr cut)
Add a cut to the pool managed by the cut manager.
Definition: ParCutMan.cpp:208
size_t getNumNewCuts() const
Get the total number of cuts added to manager (but not to problem) before the last call to separate()...
Definition: ParCutMan.cpp:86
size_t getNumCuts() const
Get the total number of cuts available to the manager.
Definition: ParCutMan.cpp:68
ParCutMan()
Empty constructor.
Definition: ParCutMan.cpp:36
ConstraintPtr addCut(ProblemPtr, FunctionPtr, double, double, bool, bool)
Add a cut.
Definition: ParCutMan.h:51
void postSolveUpdate(ConstSolutionPtr sol, EngineStatus eng_status)
Definition: ParCutMan.cpp:92
~ParCutMan()
Destroy.
Definition: ParCutMan.cpp:58
size_t getNumDisabledCuts() const
Get the total number of cuts currently not enabled.
Definition: ParCutMan.cpp:80
void write(std::ostream &out) const
Write cuts to output.
Definition: ParCutMan.cpp:213
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