Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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