Scippy

SoPlex

Sequential object-oriented simPlex

SPxId Class Reference

Generic Ids for LP rows or columns. More...

#include <spxid.h>

Public Types

Types
enum  Type { ROW_ID = -1 , INVALID = 0 , COL_ID = 1 }
 type of the id. More...
 

Public Member Functions

Construction / destruction
 SPxId ()
 default constructor. Constructs an invalid id. More...
 
 SPxId (const SPxColId &cid)
 constructs an id out of a column identifier cid. More...
 
 SPxId (const SPxRowId &rid)
 constructs an id out of a row identifier rid. More...
 
SPxIdoperator= (const SPxColId &cid)
 assignment operator More...
 
SPxIdoperator= (const SPxRowId &rid)
 assignment operator More...
 
Access / modification
Type type () const
 returns the type of the id. More...
 
bool isValid () const
 returns TRUE iff the id is a valid column or row identifier. More...
 
void inValidate ()
 makes the id invalid. More...
 
bool isSPxRowId () const
 is id a row id? More...
 
bool isSPxColId () const
 is id a column id? More...
 
Comparison of Ids
int operator== (const SPxId &id) const
 equality operator. More...
 
int operator!= (const SPxId &id) const
 inequality operator. More...
 
bool operator< (const SPxId &id) const
 less then operator More...
 
- Public Member Functions inherited from DataKey
 DataKey ()
 Default constructor. Constructs an invalid DataKey. More...
 
 DataKey (int p_info, int p_idx)
 
int getIdx () const
 gets the index number (idx) of the DataKey. More...
 
void setIdx (int p_idx)
 sets the index number (idx) of the DataKey. More...
 
bool isValid () const
 returns TRUE, iff the DataKey is valid. More...
 
void inValidate ()
 makes the DataKey invalid and clears the info field. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const SPxId &id)
 

Additional Inherited Members

- Public Attributes inherited from DataKey
int info
 user information to store values -1, 0, +1 More...
 
int idx
 (locally) unique key index More...
 

Detailed Description

Generic Ids for LP rows or columns.

Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds:

Rows and columns are numbered from 0 to num()-1 and 0 to dim()-1 respectively. These numbers may be used to select individual rows or columns. However, these numbers may change if other rows or columns are added or removed.

Further, each row or column of the problem matrix is assigned a SPxRowId or SPxColId, respectively. They are be used to select individual rows or columns just like numbers. In contrast to row and column numbers, ids remain unchanged for the time a row or column belongs to a SPxLP, no matter what other rows or columns are added to it or removed from it.

Definition at line 94 of file spxid.h.

Member Enumeration Documentation

◆ Type

enum Type

type of the id.

Enumerator
ROW_ID 

row identifier.

INVALID 

invalid id.

COL_ID 

column identifier.

Definition at line 104 of file spxid.h.

Constructor & Destructor Documentation

◆ SPxId() [1/3]

SPxId ( )

default constructor. Constructs an invalid id.

Definition at line 116 of file spxid.h.

◆ SPxId() [2/3]

SPxId ( const SPxColId cid)
explicit

constructs an id out of a column identifier cid.

Definition at line 120 of file spxid.h.

◆ SPxId() [3/3]

SPxId ( const SPxRowId rid)
explicit

constructs an id out of a row identifier rid.

Definition at line 124 of file spxid.h.

Member Function Documentation

◆ inValidate()

void inValidate ( )

makes the id invalid.

Definition at line 158 of file spxid.h.

References DataKey::info.

◆ isSPxColId()

bool isSPxColId ( ) const

is id a column id?

Definition at line 168 of file spxid.h.

References DataKey::info.

Referenced by SPxRowId::SPxRowId().

◆ isSPxRowId()

bool isSPxRowId ( ) const

◆ isValid()

bool isValid ( ) const

returns TRUE iff the id is a valid column or row identifier.

Definition at line 153 of file spxid.h.

References DataKey::info.

Referenced by SPxSolverBase< R >::coVector(), SPxSolverBase< R >::enterVector(), SPxSolverBase< R >::isBasic(), and SPxSolverBase< R >::vector().

◆ operator!=()

int operator!= ( const SPxId id) const

inequality operator.

Definition at line 183 of file spxid.h.

◆ operator<()

bool operator< ( const SPxId id) const

less then operator

Definition at line 188 of file spxid.h.

References DataKey::getIdx().

◆ operator=() [1/2]

SPxId & operator= ( const SPxColId cid)

assignment operator

Definition at line 129 of file spxid.h.

References SPxId::COL_ID, and DataKey::info.

◆ operator=() [2/2]

SPxId & operator= ( const SPxRowId rid)

assignment operator

Definition at line 136 of file spxid.h.

References DataKey::info, and SPxId::ROW_ID.

◆ operator==()

int operator== ( const SPxId id) const

equality operator.

Definition at line 178 of file spxid.h.

◆ type()

Type type ( ) const

returns the type of the id.

Definition at line 148 of file spxid.h.

References SPxId::COL_ID, DataKey::info, SPxId::INVALID, and SPxId::ROW_ID.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const SPxId id 
)
friend

Definition at line 61 of file spxid.cpp.