Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
separator.h
Go to the documentation of this file.
1
30#pragma once
31
33
36
37#pragma GCC visibility push(default)
38namespace abacus {
39
40
42
43
45
66template <class BaseType, class CoType>
67class Separator : public AbacusRoot {
68public:
69
71
83 bool nonDuplications,
84 int maxGen=300)
85 :
90 hash_(0),
92 pool_(0)
93 {
94 if(nonDuplications)
96 }
97
98
100 virtual ~Separator() {
101 delete hash_;
102 }
103
104
106 virtual void separate() = 0;
107
109
119
121
125 virtual bool terminateSeparation() {
126 return ( nGen() >= maxGen() );
127 }
128
131
132
134 int nGen() const { return newCons_.number(); }
135
136
138 int nDuplications() const { return nDuplications_; }
139
140
142 int nCollisions() const;
143
145 int maxGen() const { return newCons_.size(); }
146
147
149 double minAbsViolation() const { return minAbsViolation_; }
150
151
153 void minAbsViolation(double minAbsVio) {
154 minAbsViolation_=minAbsVio;
155 }
156
161
170 pool_ = pool;
171 }
172
173protected:
174
183 bool find(BaseType *cv);
184
187
188private:
195
199};
200
201}
202
204#pragma GCC visibility pop
Hash tables.
Definition hash.h:125
Global data and functions.
Definition global.h:58
Base class of all other classes of ABACUS.
Definition abacusroot.h:69
LP solutions.
Definition lpsolution.h:65
The master of the optimization.
Definition master.h:70
Standard pools without constraint duplication.
Definition nonduplpool.h:59
Separators.
Definition separator.h:67
void watchNonDuplPool(NonDuplPool< BaseType, CoType > *pool)
If the separator checks for duplication of cuts, the test is also done for constraints/variables that...
Definition separator.h:169
AbaHash< unsigned, BaseType * > * hash_
Definition separator.h:191
int maxGen() const
Returns the maximal number of generated cutting planes.
Definition separator.h:145
Separator_CUTFOUND cutFound(BaseType *cv)
Passes a cut (constraint or variable) to the buffer.
int nGen() const
Returns the number of generated cutting planes.
Definition separator.h:134
double minAbsViolation() const
Returns the absolute value for considering a constraint/variable as violated.
Definition separator.h:149
LpSolution< CoType, BaseType > * lpSolution()
The lpSolution to be separated.
Definition separator.h:158
virtual ~Separator()
The destructor.
Definition separator.h:100
int nCollisions() const
Returns the number of collisions in the hash table.
LpSolution< CoType, BaseType > * lpSol_
The LP solution to be separated.
Definition separator.h:186
void minAbsViolation(double minAbsVio)
Sets a new value for minAbsViolation.
Definition separator.h:153
double minAbsViolation_
Definition separator.h:189
virtual bool terminateSeparation()
Returns true if the separation should be terminated.
Definition separator.h:125
int nDuplications() const
Returns the number of duplicated constraints/variables which are discarded.
Definition separator.h:138
Separator(const Separator< BaseType, CoType > &rhs)
virtual void separate()=0
This function has to be redefined and should implement the separation routine.
bool find(BaseType *cv)
const Separator< BaseType, CoType > & operator=(const Separator< BaseType, CoType > &rhs)
Master * master_
A pointer to the corresponding master of the optimization.
Definition separator.h:185
ArrayBuffer< BaseType * > & cutBuffer()
Returns the buffer with the generated constraints/variable.
Definition separator.h:130
NonDuplPool< BaseType, CoType > * pool_
Definition separator.h:194
Separator(LpSolution< CoType, BaseType > *lpSolution, bool nonDuplications, int maxGen=300)
Creates a separator.
Definition separator.h:81
ArrayBuffer< BaseType * > newCons_
Definition separator.h:190
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition ArrayBuffer.h:64
INDEX size() const
Returns number of elements in the buffer.
hash table.
lpsolution.
Separator_CUTFOUND
Definition separator.h:41
@ Duplication
Definition separator.h:41
@ Added
Definition separator.h:41
standard pool without constraint duplication.