Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
abacus::SlackStat Class Reference

Status of slack variables. More...

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

+ Inheritance diagram for abacus::SlackStat:

Public Types

enum  STATUS { Basic , NonBasicZero , NonBasicNonZero , Unknown }
 The different statuses of a slack variable. More...
 

Public Member Functions

 SlackStat ()
 Initializes the status to Unknown.
 
 SlackStat (STATUS status)
 Initializes the status to status.
 
STATUS status () const
 Returns the status of the slack variable.
 
void status (const SlackStat *stat)
 Sets the status to the status of stat.
 
void status (STATUS stat)
 Sets the status of the slack variable to stat.
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor.
 

Private Attributes

STATUS status_
 The status of the slack variable.
 

Friends

std::ostream & operator<< (std::ostream &out, const SlackStat &rhs)
 Output operator for slack statuses.
 

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 charonOff (bool value)
 Converts a boolean variable to the strings "on" and "off".
 

Detailed Description

Status of slack variables.

As for the structural variables the simplex method also assigns a unique status to each slack variable. A slack variable can be a basic or a nonbasic variable. If it is a nonbasic variable, then we distinguish if the slack variable has value zero or nonzero.

Definition at line 47 of file slackstat.h.

Member Enumeration Documentation

◆ STATUS

The different statuses of a slack variable.

Enumerator
Basic 

The slack variable belongs to the basis.

NonBasicZero 

The slack variable does not belong to the basis and has value zero.

NonBasicNonZero 

The slack variable does not belong to the basis and has a nonzero value.

Unknown 

The status of the slack variable is not known since no linear program with the corresponding constraint has been solved.

Definition at line 51 of file slackstat.h.

Constructor & Destructor Documentation

◆ SlackStat() [1/2]

abacus::SlackStat::SlackStat ( )
inline

Initializes the status to Unknown.

Definition at line 64 of file slackstat.h.

◆ SlackStat() [2/2]

abacus::SlackStat::SlackStat ( STATUS  status)
inline

Initializes the status to status.

Parameters
statusThe slack variable receives the status status.

Definition at line 70 of file slackstat.h.

Member Function Documentation

◆ status() [1/3]

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

Returns the status of the slack variable.

Definition at line 86 of file slackstat.h.

◆ status() [2/3]

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

Sets the status to the status of stat.

Parameters
statThe status of the slack variable is set to *stat.

Definition at line 100 of file slackstat.h.

◆ status() [3/3]

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

Sets the status of the slack variable to stat.

Parameters
statThe new status of the slack variable.

Definition at line 93 of file slackstat.h.

Friends And Related Symbol Documentation

◆ operator<<

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

Output operator for slack statuses.

The output operator writes the status to an output stream in the format Basic, NonBasicZero, NonBasicNonZero, or Unknown.

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

Member Data Documentation

◆ status_

STATUS abacus::SlackStat::status_
private

The status of the slack variable.

Definition at line 105 of file slackstat.h.


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