Implements a branching rule for setting a variable to a certain value.
More...
#include <ogdf/lib/abacus/valbranchrule.h>
|
static bool | ascii2bool (const string &str) |
| Converts the string str to a boolean value. More...
|
|
static bool | endsWith (const string &str, const string &end) |
| Returns true if str ends with end, false otherwise. More...
|
|
static double | fracPart (double x) |
| Returns the absolute value of the fractional part of x. More...
|
|
static const char * | onOff (bool value) |
| Converts a boolean variable to the strings "on" and "off". More...
|
|
Master * | master_ |
| A pointer to the corresponding master of the optimization. More...
|
|
Implements a branching rule for setting a variable to a certain value.
Definition at line 41 of file valbranchrule.h.
◆ ValBranchRule()
abacus::ValBranchRule::ValBranchRule |
( |
Master * |
master, |
|
|
int |
variable, |
|
|
double |
value |
|
) |
| |
|
inline |
Creates a branching rule for setting variable to value.
- Parameters
-
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.
◆ ~ValBranchRule()
virtual abacus::ValBranchRule::~ValBranchRule |
( |
| ) |
|
|
inlinevirtual |
◆ extract() [1/2]
virtual void abacus::ValBranchRule::extract |
( |
LpSub * |
lp | ) |
|
|
overridevirtual |
Overloaded to modify directly the linear programming relaxation.
This required to evaluate the quality of a branching rule.
Reimplemented from abacus::BranchRule.
◆ extract() [2/2]
virtual int abacus::ValBranchRule::extract |
( |
Sub * |
sub | ) |
|
|
overridevirtual |
Modifies a subproblem by setting the branching variable.
- Parameters
-
sub | The subproblem being modified. |
- Returns
- 0 If the subproblem can be modified according to the branching rule.
-
1 If a contradiction occurs.
Implements abacus::BranchRule.
◆ unExtract()
virtual void abacus::ValBranchRule::unExtract |
( |
LpSub * |
lp | ) |
|
|
overridevirtual |
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.
- Parameters
-
lp | A pointer to a the linear programming relaxtion of a subproblem. |
Reimplemented from abacus::BranchRule.
◆ value()
double abacus::ValBranchRule::value |
( |
| ) |
const |
|
inline |
Returns the value of the branching variable.
Definition at line 96 of file valbranchrule.h.
◆ variable()
int abacus::ValBranchRule::variable |
( |
| ) |
const |
|
inline |
Returns the number of the branching variable.
Definition at line 90 of file valbranchrule.h.
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const ValBranchRule & |
rhs |
|
) |
| |
|
friend |
Output operator for val branching rules.
Writes the branching variable together with its value to output stream out.
- Parameters
-
out | The output stream. |
rhs | The branching rule being output. |
- Returns
- A reference to the output stream.
◆ oldLpLBound_
double abacus::ValBranchRule::oldLpLBound_ |
|
private |
◆ oldLpUBound_
double abacus::ValBranchRule::oldLpUBound_ |
|
private |
◆ value_
double abacus::ValBranchRule::value_ |
|
private |
The value the branching variable is set to.
Definition at line 103 of file valbranchrule.h.
◆ variable_
int abacus::ValBranchRule::variable_ |
|
private |
The documentation for this class was generated from the following file: