Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

abacus::ValBranchRule Class Reference

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. More...
 
virtual ~ValBranchRule ()
 
virtual void extract (LpSub *lp) override
 Overloaded to modify directly the linear programming relaxation. More...
 
virtual int extract (Sub *sub) override
 Modifies a subproblem by setting the branching variable. More...
 
virtual void unExtract (LpSub *lp) override
 Should undo the modifictions of the linear programming relaxtion |lp|. More...
 
double value () const
 Returns the value of the branching variable. More...
 
int variable () const
 Returns the number of the branching variable. More...
 
- Public Member Functions inherited from abacus::BranchRule
 BranchRule (Master *master)
 Initializes a branching rule. More...
 
virtual ~BranchRule ()
 
virtual bool branchOnSetVar ()
 Should indicate if the branching is performed by setting a binary variable. More...
 
virtual void initialize (Sub *sub)
 Called from the constructor of a subproblem. More...
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor. More...
 

Private Attributes

double oldLpLBound_
 
double oldLpUBound_
 
double value_
 The value the branching variable is set to. More...
 
int variable_
 The branching variable. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const ValBranchRule &rhs)
 Output operator for val branching rules. More...
 

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. 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...
 
- Protected Attributes inherited from abacus::BranchRule
Mastermaster_
 A pointer to the corresponding master of the optimization. More...
 

Detailed Description

Implements a branching rule for setting a variable to a certain value.

Definition at line 41 of file valbranchrule.h.

Constructor & Destructor Documentation

◆ ValBranchRule()

abacus::ValBranchRule::ValBranchRule ( Master master,
int  variable,
double  value 
)
inline

Creates a branching rule for setting variable to value.

Parameters
masterThe corresponding master of the optimization.
variableThe branching variable.
valueThe value the branching variable is set to.

Definition at line 50 of file valbranchrule.h.

◆ ~ValBranchRule()

virtual abacus::ValBranchRule::~ValBranchRule ( )
inlinevirtual

Definition at line 54 of file valbranchrule.h.

Member Function Documentation

◆ 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
subThe 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
lpA 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.

Friends And Related Function Documentation

◆ 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
outThe output stream.
rhsThe branching rule being output.
Returns
A reference to the output stream.

Member Data Documentation

◆ oldLpLBound_

double abacus::ValBranchRule::oldLpLBound_
private

Definition at line 104 of file valbranchrule.h.

◆ oldLpUBound_

double abacus::ValBranchRule::oldLpUBound_
private

Definition at line 105 of file valbranchrule.h.

◆ 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 branching variable.

Definition at line 102 of file valbranchrule.h.


The documentation for this class was generated from the following file: