Implements a branching rule for setting a variable to a certain value. More...
#include <ogdf/lib/abacus/valbranchrule.h>
Inheritance diagram for abacus::ValBranchRule:Public Member Functions | |
| ValBranchRule (Master *master, int variable, double value) | |
| Creates a branching rule for setting variable to value. | |
| virtual | ~ValBranchRule () |
| virtual void | extract (LpSub *lp) override |
| Overloaded to modify directly the linear programming relaxation. | |
| virtual int | extract (Sub *sub) override |
| Modifies a subproblem by setting the branching variable. | |
| virtual void | unExtract (LpSub *lp) override |
| Should undo the modifictions of the linear programming relaxtion |lp|. | |
| double | value () const |
| Returns the value of the branching variable. | |
| int | variable () const |
| Returns the number of the branching variable. | |
Public Member Functions inherited from abacus::BranchRule | |
| BranchRule (Master *master) | |
| Initializes a branching rule. | |
| virtual | ~BranchRule () |
| virtual bool | branchOnSetVar () |
| Should indicate if the branching is performed by setting a binary variable. | |
| virtual void | initialize (Sub *sub) |
| Called from the constructor of a subproblem. | |
Public Member Functions inherited from abacus::AbacusRoot | |
| virtual | ~AbacusRoot () |
| The destructor. | |
Private Attributes | |
| double | oldLpLBound_ |
| double | oldLpUBound_ |
| double | value_ |
| The value the branching variable is set to. | |
| int | variable_ |
| The branching variable. | |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const ValBranchRule &rhs) |
| Output operator for val branching rules. | |
Additional Inherited Members | |
Static Public Member Functions inherited from abacus::AbacusRoot | |
| static bool | ascii2bool (const string &str) |
| Converts the string str to a boolean value. | |
| static bool | endsWith (const string &str, const string &end) |
| Returns true if str ends with end, false otherwise. | |
| static double | fracPart (double x) |
| Returns the absolute value of the fractional part of x. | |
| static const char * | onOff (bool value) |
| Converts a boolean variable to the strings "on" and "off". | |
Protected Attributes inherited from abacus::BranchRule | |
| Master * | master_ |
| A pointer to the corresponding master of the optimization. | |
Implements a branching rule for setting a variable to a certain value.
Definition at line 41 of file valbranchrule.h.
Creates a branching rule for setting variable to value.
| master | The corresponding master of the optimization. |
| variable | The branching variable. |
| value | The value the branching variable is set to. |
Definition at line 50 of file valbranchrule.h.
|
inlinevirtual |
Definition at line 54 of file valbranchrule.h.
Overloaded to modify directly the linear programming relaxation.
This required to evaluate the quality of a branching rule.
Reimplemented from abacus::BranchRule.
Modifies a subproblem by setting the branching variable.
| sub | The subproblem being modified. |
Implements abacus::BranchRule.
Should undo the modifictions of the linear programming relaxtion |lp|.
This function has to be redefined in a derived class if extract(LpSub*) is redefined there.
| lp | A pointer to a the linear programming relaxtion of a subproblem. |
Reimplemented from abacus::BranchRule.
|
inline |
Returns the value of the branching variable.
Definition at line 96 of file valbranchrule.h.
|
inline |
Returns the number of the branching variable.
Definition at line 90 of file valbranchrule.h.
|
friend |
Output operator for val branching rules.
Writes the branching variable together with its value to output stream out.
| out | The output stream. |
| rhs | The branching rule being output. |
|
private |
Definition at line 104 of file valbranchrule.h.
|
private |
Definition at line 105 of file valbranchrule.h.
|
private |
The value the branching variable is set to.
Definition at line 103 of file valbranchrule.h.
|
private |
The branching variable.
Definition at line 102 of file valbranchrule.h.