Loading [MathJax]/extensions/tex2jax.js

Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
valbranchrule.h
Go to the documentation of this file.
1
33#pragma once
34
36
37namespace abacus {
38
39
41class ValBranchRule : public BranchRule {
42public:
43
45
50 ValBranchRule(Master *master, int variable, double value)
51 : BranchRule(master), variable_(variable), value_(value) { }
52
53
54 virtual ~ValBranchRule() { }
55
56
58
66 friend std::ostream &operator<<(std::ostream &out, const ValBranchRule &rhs);
67
68
70
76 virtual int extract(Sub *sub) override;
77
78
80
83 virtual void extract(LpSub *lp) override;
84
85
86 virtual void unExtract(LpSub *lp) override;
87
88
90 int variable() const {
91 return variable_;
92 }
93
94
96 double value() const {
97 return value_;
98 }
99
100
101private:
103 double value_;
106};
107
108}
Base class for branching rules.
Abstract base class for all branching rules.
Definition branchrule.h:59
The linear program of a subproblem.
Definition lpsub.h:61
The master of the optimization.
Definition master.h:69
The subproblem.
Definition sub.h:68
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.