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
35#pragma GCC visibility push(default)
36namespace abacus {
37
38
39class Master;
40class Sub;
41
42
44
51
52 friend class Sub;
53 friend class Master;
54
55public:
56
58
66 OpenSub(Master *master) : master_(master) { }
67
69 int number() const {
70 return list_.size();
71 }
72
74 bool empty() const {
75 return list_.empty();
76 }
77
79 double dualBound() const;
80
81private:
82
84
92
94
97 void insert(Sub *sub);
98
100
103 void remove(Sub *sub) {
104 if(list_.removeFirst(sub))
105 updateDualBound();
106 }
107
109 void prune() {
110 list_.clear();
111 }
112
115
118 double dualBound_;
119
120 OpenSub(const OpenSub &rhs);
121 const OpenSub &operator=(const OpenSub &rhs);
122};
123
124}
125#pragma GCC visibility pop
Declaration of doubly linked lists and iterators.
Base class of all other classes of ABACUS.
Definition abacusroot.h:69
The master of the optimization.
Definition master.h:70
Maintains open subproblems.
Definition opensub.h:50
double dualBound_
The dual bound of all open subproblems.
Definition opensub.h:118
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:117
OpenSub(Master *master)
Creates an empty list of open subproblems.
Definition opensub.h:66
OpenSub(const OpenSub &rhs)
int number() const
Returns the current number of open subproblems contained in this set.
Definition opensub.h:69
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:74
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:116
void remove(Sub *sub)
Removes subproblem from the set of open subproblems.
Definition opensub.h:103
void prune()
Removes all elements from the set of opens subproblems.
Definition opensub.h:109
double dualBound() const
Returns the value of the dual bound for all subproblems in the list.
The subproblem.
Definition sub.h:69
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117