Implements a branching rule for setting a variable to a certain value.  
 More...
#include <ogdf/lib/abacus/valbranchrule.h>
|  | 
|  | 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. 
 | 
|  | 
|  | 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. 
 | 
|  | 
| virtual | ~AbacusRoot () | 
|  | The destructor. 
 | 
|  | 
|  | 
| 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". 
 | 
|  | 
| 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 42 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 51 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 97 of file valbranchrule.h.
 
 
◆ variable()
  
  | 
        
          | int abacus::ValBranchRule::variable | ( |  | ) | const |  | inline | 
 
Returns the number of the branching variable. 
Definition at line 91 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 104 of file valbranchrule.h.
 
 
◆ variable_
  
  | 
        
          | int abacus::ValBranchRule::variable_ |  | private | 
 
 
The documentation for this class was generated from the following file: