Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

valbranchrule.h
Go to the documentation of this file.
1 
33 #pragma once
34 
36 
37 namespace abacus {
38 
39 
41 class ValBranchRule : public BranchRule {
42 public:
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 
101 private:
102  int variable_;
103  double value_;
104  double oldLpLBound_;
105  double oldLpUBound_;
106 };
107 
108 }
branchrule.h
Base class for branching rules.
abacus::BranchRule
Abstract base class for all branching rules.
Definition: branchrule.h:59
abacus
Definition: abacusroot.h:48
abacus::ValBranchRule::variable
int variable() const
Returns the number of the branching variable.
Definition: valbranchrule.h:90
abacus::ValBranchRule::oldLpLBound_
double oldLpLBound_
Definition: valbranchrule.h:104
abacus::ValBranchRule
Implements a branching rule for setting a variable to a certain value.
Definition: valbranchrule.h:41
abacus::ValBranchRule::~ValBranchRule
virtual ~ValBranchRule()
Definition: valbranchrule.h:54
abacus::ValBranchRule::oldLpUBound_
double oldLpUBound_
Definition: valbranchrule.h:105
abacus::ValBranchRule::operator<<
friend std::ostream & operator<<(std::ostream &out, const ValBranchRule &rhs)
Output operator for val branching rules.
abacus::ValBranchRule::ValBranchRule
ValBranchRule(Master *master, int variable, double value)
Creates a branching rule for setting variable to value.
Definition: valbranchrule.h:50
abacus::ValBranchRule::unExtract
virtual void unExtract(LpSub *lp) override
Should undo the modifictions of the linear programming relaxtion |lp|.
abacus::ValBranchRule::variable_
int variable_
The branching variable.
Definition: valbranchrule.h:102
abacus::ValBranchRule::value
double value() const
Returns the value of the branching variable.
Definition: valbranchrule.h:96
abacus::LpSub
The linear program of a subproblem.
Definition: lpsub.h:61
abacus::ValBranchRule::extract
virtual int extract(Sub *sub) override
Modifies a subproblem by setting the branching variable.
abacus::Sub
The subproblem.
Definition: sub.h:68
abacus::ValBranchRule::value_
double value_
The value the branching variable is set to.
Definition: valbranchrule.h:103
abacus::Master
The master of the optimization.
Definition: master.h:69