Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

abacus::LPVARSTAT Class Reference

status of variables. More...

#include <ogdf/lib/abacus/lpvarstat.h>

+ Inheritance diagram for abacus::LPVARSTAT:

Public Types

enum  STATUS { AtLowerBound, Basic, AtUpperBound, NonBasicFree, Eliminated, Unknown }
 The enumeration of the statuses a variable gets from the linear program solver. More...
 

Public Member Functions

 LPVARSTAT ()
 This constructor initializes the status as Unknown. More...
 
 LPVARSTAT (LPVARSTAT *lpVarStat)
 This constructor make a copy of *lpVarStat. More...
 
 LPVARSTAT (STATUS status)
 This constructor initializes the LPVARSTAT. More...
 
bool atBound () const
 Returns true if the variable status is AtUpperBound or AtLowerBound, false otherwise. More...
 
bool basic () const
 Returns true If the status is Basic, false otherwise. More...
 
STATUS status () const
 Returns the LP-status. More...
 
void status (const LPVARSTAT *stat)
 Sets the status to stat. More...
 
void status (STATUS stat)
 Sets the status to stat. More...
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor. More...
 

Private Attributes

STATUS status_
 The LP-status. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const LPVARSTAT &rhs)
 The output operator. 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...
 

Detailed Description

status of variables.

After the solution of a linear program by the simplex method each variable receives a status indicating if the variable is contained in the basis of the optimal solution, or is nonbasic and has a value equal to its lower or upper bound, or is a free variable not contained in the basis. We extend this notion since later in the interface from a cutting plane algorithm to the linear program variables might be eliminated.

Definition at line 50 of file lpvarstat.h.

Member Enumeration Documentation

◆ STATUS

The enumeration of the statuses a variable gets from the linear program solver.

Enumerator
AtLowerBound 

The variable is at its lower bound, but not in the basis.

Basic 

The variable is in the basis.

AtUpperBound 

The variable is at its upper bound , but not in the basis.

NonBasicFree 

The variable is unbounded and not in the basis.

Eliminated 

The variable has been removed by our preprocessor in the class LpSub.

So, it is not present in the LP-solver.

Unknown 

The LP-status of the variable is unknown since no LP has been solved.

This status is also assigned to variables which are fixed or set, yet still contained in the LP to avoid a wrong setting or fixing by reduced costs.

Definition at line 54 of file lpvarstat.h.

Constructor & Destructor Documentation

◆ LPVARSTAT() [1/3]

abacus::LPVARSTAT::LPVARSTAT ( )
inline

This constructor initializes the status as Unknown.

Definition at line 70 of file lpvarstat.h.

◆ LPVARSTAT() [2/3]

abacus::LPVARSTAT::LPVARSTAT ( STATUS  status)
inline

This constructor initializes the LPVARSTAT.

Parameters
statusThe initial status.

Definition at line 76 of file lpvarstat.h.

◆ LPVARSTAT() [3/3]

abacus::LPVARSTAT::LPVARSTAT ( LPVARSTAT lpVarStat)
inline

This constructor make a copy of *lpVarStat.

Parameters
lpVarStatA copy of this object is made.

Definition at line 82 of file lpvarstat.h.

Member Function Documentation

◆ atBound()

bool abacus::LPVARSTAT::atBound ( ) const
inline

Returns true if the variable status is AtUpperBound or AtLowerBound, false otherwise.

Definition at line 115 of file lpvarstat.h.

◆ basic()

bool abacus::LPVARSTAT::basic ( ) const
inline

Returns true If the status is Basic, false otherwise.

Definition at line 120 of file lpvarstat.h.

◆ status() [1/3]

STATUS abacus::LPVARSTAT::status ( ) const
inline

Returns the LP-status.

Definition at line 100 of file lpvarstat.h.

◆ status() [2/3]

void abacus::LPVARSTAT::status ( const LPVARSTAT stat)
inline

Sets the status to stat.

Parameters
statThe new LP-status.

Definition at line 112 of file lpvarstat.h.

◆ status() [3/3]

void abacus::LPVARSTAT::status ( STATUS  stat)
inline

Sets the status to stat.

Parameters
statThe new LP-status.

Definition at line 106 of file lpvarstat.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const LPVARSTAT rhs 
)
friend

The output operator.

Writes the STATUS to an output stream in the form AtLowerBound, Basic, AtUpperBound, NonBasicFree, Eliminated, Unknown.

Parameters
outThe output stream.
rhsThe status being output.
Returns
A reference to the output stream.

Member Data Documentation

◆ status_

STATUS abacus::LPVARSTAT::status_
private

The LP-status.

Definition at line 128 of file lpvarstat.h.


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