Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

setbranchrule.h
Go to the documentation of this file.
1 
33 #pragma once
34 
37 
38 #pragma GCC visibility push(default)
39 namespace abacus {
40 
41 
43 class SetBranchRule : public BranchRule {
44 public:
45 
47 
53  : BranchRule(master), variable_(variable), status_(status) { }
54 
55 
56  virtual ~SetBranchRule() { }
57 
58 
60 
68  friend std::ostream &operator<<(std::ostream &out, const SetBranchRule &rhs);
69 
70 
72  /*!*
73  * \return 0 If the subproblem can be modified according to the branching rule.
74  * \return 1 If a contradiction occurs.
75  *
76  * \param sub The subproblem being modified.
77  */
78  virtual int extract(Sub *sub) override;
79 
80 
82 
89  virtual void extract(LpSub *lp) override;
90 
91 
92  virtual void unExtract(LpSub *lp) override;
93 
94 
96 
99  virtual bool branchOnSetVar() override {
100  return true;
101  }
102 
103 
105  bool setToUpperBound() const {
107  }
108 
109 
111  int variable() const {
112  return variable_;
113  }
114 
115 
116 private:
117  int variable_;
119 
124  double oldLpBound_;
125 };
126 
127 }
128 #pragma GCC visibility pop
branchrule.h
Base class for branching rules.
abacus::SetBranchRule::extract
virtual int extract(Sub *sub) override
Modifies a subproblem by setting the branching variable.
abacus::SetBranchRule
Implements a branching rule for setting a binary variable to its lower or upper bound.
Definition: setbranchrule.h:43
abacus::BranchRule
Abstract base class for all branching rules.
Definition: branchrule.h:60
abacus::FSVarStat::SetToUpperBound
@ SetToUpperBound
The variable is set to its upper bound.
Definition: fsvarstat.h:55
fsvarstat.h
status of fixed and set variables.
abacus::SetBranchRule::unExtract
virtual void unExtract(LpSub *lp) override
Should undo the modifictions of the linear programming relaxtion |lp|.
abacus::SetBranchRule::setToUpperBound
bool setToUpperBound() const
Returns true if the branching variable is set to the upper bound, false otherwise.
Definition: setbranchrule.h:105
abacus
Definition: ILPClusterPlanarity.h:50
abacus::FSVarStat::STATUS
STATUS
The enumeration defining the different statuses of variables from the point of view of fixing and set...
Definition: fsvarstat.h:51
abacus::SetBranchRule::~SetBranchRule
virtual ~SetBranchRule()
Definition: setbranchrule.h:56
abacus::SetBranchRule::status_
FSVarStat::STATUS status_
The status of the branching variable.
Definition: setbranchrule.h:118
abacus::SetBranchRule::variable
int variable() const
Returns the number of the branching variable.
Definition: setbranchrule.h:111
abacus::SetBranchRule::variable_
int variable_
The branching variable.
Definition: setbranchrule.h:117
abacus::LpSub
The linear program of a subproblem.
Definition: lpsub.h:62
abacus::SetBranchRule::branchOnSetVar
virtual bool branchOnSetVar() override
Redefined for returning true, as this branching rule is setting a binary variable.
Definition: setbranchrule.h:99
abacus::SetBranchRule::oldLpBound_
double oldLpBound_
The bound of the branching variable in the LP before it is temporarily modified for testing the quali...
Definition: setbranchrule.h:124
abacus::Sub
The subproblem.
Definition: sub.h:69
abacus::SetBranchRule::operator<<
friend std::ostream & operator<<(std::ostream &out, const SetBranchRule &rhs)
Output operator for set branching rules.
abacus::SetBranchRule::SetBranchRule
SetBranchRule(Master *master, int variable, FSVarStat::STATUS status)
Creates a branching rule for setting binary variable according to status.
Definition: setbranchrule.h:52
abacus::Master
The master of the optimization.
Definition: master.h:70