Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
conbranchrule.h
Go to the documentation of this file.
1
34#pragma once
35
40
41#pragma GCC visibility push(default)
42namespace abacus {
43
46public:
47
49
59 : BranchRule(master), poolSlotRef_(poolSlot) { }
60
61
62 virtual ~ConBranchRule() { }
63
65
71 friend OGDF_EXPORT std::ostream &operator<<(std::ostream &out, const ConBranchRule &rhs);
72
73
75
83 virtual int extract(Sub *sub) override;
84
85
87
90 virtual void extract(LpSub *lp) override;
91
92 virtual void unExtract(LpSub *lp) override;
93
94
96
99 virtual void initialize(Sub *sub) override;
100
101
104 return poolSlotRef_.conVar();
105 }
106
108 const Constraint *constraint() const {
109 return poolSlotRef_.conVar();
110 }
111
112private:
115
117};
118
119}
120#pragma GCC visibility pop
Base class for branching rules.
Abstract base class for all branching rules.
Definition branchrule.h:60
Implements the branching by adding a constraint to the set of active constraints.
ConBranchRule(Master *master, PoolSlot< Constraint, Variable > *poolSlot)
Creates a branching constraint.
virtual int extract(Sub *sub) override
Adds the branching constraint to the subproblem.
Constraint * constraint()
Returns a pointer to the branching constraint, or a 0-pointer if this constraint is not available.
const ConBranchRule & operator=(const ConBranchRule &rhs)
const Constraint * constraint() const
Returns a const pointer to the branching constraint, or a 0-pointer if this constraint is not availab...
virtual void extract(LpSub *lp) override
Overloaded to modify directly the linear programming relaxation.
friend std::ostream & operator<<(std::ostream &out, const ConBranchRule &rhs)
Output operator for branching constraints.
PoolSlotRef< Constraint, Variable > poolSlotRef_
A reference to the pool slot of the branching constraints.
virtual void initialize(Sub *sub) override
Initializes the subproblem associated with the branching constraint.
virtual void unExtract(LpSub *lp) override
Should undo the modifictions of the linear programming relaxtion |lp|.
Forms the virtual base class for all possible constraints given in pool format.
Definition constraint.h:57
The linear program of a subproblem.
Definition lpsub.h:62
The master of the optimization.
Definition master.h:70
Stores constraints and variables.
Definition poolslot.h:78
Stores a pointer to a pool slot with version number.
Definition poolslotref.h:55
The subproblem.
Definition sub.h:69
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
constraint.
poolslotref
variable.