Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
opensub.h
Go to the documentation of this file.
1
30#pragma once
31
32#include <ogdf/basic/List.h>
34
35namespace abacus {
36
37
38class Master;
39class Sub;
40
41
43
50
51 friend class Sub;
52 friend class Master;
53
54public:
55
57
65 OpenSub(Master *master) : master_(master) { }
66
68 int number() const {
69 return list_.size();
70 }
71
73 bool empty() const {
74 return list_.empty();
75 }
76
78 double dualBound() const;
79
80private:
81
83
91
93
96 void insert(Sub *sub);
97
99
102 void remove(Sub *sub) {
103 if(list_.removeFirst(sub))
104 updateDualBound();
105 }
106
108 void prune() {
109 list_.clear();
110 }
111
114
117 double dualBound_;
118
119 OpenSub(const OpenSub &rhs);
120 const OpenSub &operator=(const OpenSub &rhs);
121};
122
123}
Declaration of doubly linked lists and iterators.
Base class of all other classes of ABACUS.
Definition abacusroot.h:68
The master of the optimization.
Definition master.h:69
Maintains open subproblems.
Definition opensub.h:49
double dualBound_
The dual bound of all open subproblems.
Definition opensub.h:117
void updateDualBound()
Updates dualBound_ according to the dual bounds of the subproblems contained in this set.
ogdf::List< Sub * > list_
The list storing the open subproblems.
Definition opensub.h:116
OpenSub(Master *master)
Creates an empty list of open subproblems.
Definition opensub.h:65
OpenSub(const OpenSub &rhs)
int number() const
Returns the current number of open subproblems contained in this set.
Definition opensub.h:68
const OpenSub & operator=(const OpenSub &rhs)
bool empty() const
Returns true if there is no subproblem in the set of open subproblems, false otherwise.
Definition opensub.h:73
void insert(Sub *sub)
Adds a subproblem to the set of open subproblems.
Sub * select()
Selects a subproblem according to the master's strategy and removes it from the list of open subprobl...
Master * master_
A pointer to corresponding master of the optimization.
Definition opensub.h:115
void remove(Sub *sub)
Removes subproblem from the set of open subproblems.
Definition opensub.h:102
void prune()
Removes all elements from the set of opens subproblems.
Definition opensub.h:108
double dualBound() const
Returns the value of the dual bound for all subproblems in the list.
The subproblem.
Definition sub.h:68
Doubly linked lists (maintaining the length of the list).
Definition List.h:1435
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101