Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
valbranchrule.h
Go to the documentation of this file.
1
33#pragma once
34
36
37#pragma GCC visibility push(default)
38namespace abacus {
39
40
42class ValBranchRule : public BranchRule {
43public:
44
46
51 ValBranchRule(Master *master, int variable, double value)
52 : BranchRule(master), variable_(variable), value_(value) { }
53
54
55 virtual ~ValBranchRule() { }
56
57
59
67 friend std::ostream &operator<<(std::ostream &out, const ValBranchRule &rhs);
68
69
71
77 virtual int extract(Sub *sub) override;
78
79
81
84 virtual void extract(LpSub *lp) override;
85
86
87 virtual void unExtract(LpSub *lp) override;
88
89
91 int variable() const {
92 return variable_;
93 }
94
95
97 double value() const {
98 return value_;
99 }
100
101
102private:
104 double value_;
107};
108
109}
110#pragma GCC visibility pop
Base class for branching rules.
Abstract base class for all branching rules.
Definition branchrule.h:60
The linear program of a subproblem.
Definition lpsub.h:62
The master of the optimization.
Definition master.h:70
The subproblem.
Definition sub.h:69
Implements a branching rule for setting a variable to a certain value.
int variable() const
Returns the number of the branching variable.
int variable_
The branching variable.
virtual void extract(LpSub *lp) override
Overloaded to modify directly the linear programming relaxation.
ValBranchRule(Master *master, int variable, double value)
Creates a branching rule for setting variable to value.
virtual int extract(Sub *sub) override
Modifies a subproblem by setting the branching variable.
double value() const
Returns the value of the branching variable.
double value_
The value the branching variable is set to.
virtual void unExtract(LpSub *lp) override
Should undo the modifictions of the linear programming relaxtion |lp|.
friend std::ostream & operator<<(std::ostream &out, const ValBranchRule &rhs)
Output operator for val branching rules.