Scippy

SoPlex

Sequential object-oriented simPlex

SPxId Class Reference

Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: 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 SPxId &id)
 assignment operator 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)
 
DataKeyoperator= (const DataKey &rhs)
 Assignment operator. More...
 
 DataKey (const DataKey &old)
 Copy constructor. More...
 
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 85 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 95 of file spxid.h.

Constructor & Destructor Documentation

◆ SPxId() [1/3]

SPxId ( )

default constructor. Constructs an invalid id.

Definition at line 107 of file spxid.h.

◆ SPxId() [2/3]

SPxId ( const SPxColId cid)
explicit

constructs an id out of a column identifier cid.

Definition at line 111 of file spxid.h.

◆ SPxId() [3/3]

SPxId ( const SPxRowId rid)
explicit

constructs an id out of a row identifier rid.

Definition at line 115 of file spxid.h.

Member Function Documentation

◆ inValidate()

void inValidate ( )

makes the id invalid.

Definition at line 156 of file spxid.h.

References DataKey::info.

Referenced by SPxHarrisRT::selectEnter().

◆ isSPxColId()

◆ isSPxRowId()

◆ isValid()

◆ operator!=()

int operator!= ( const SPxId id) const

inequality operator.

Definition at line 181 of file spxid.h.

◆ operator<()

bool operator< ( const SPxId id) const

less then operator

Definition at line 186 of file spxid.h.

References DataKey::getIdx().

◆ operator=() [1/3]

SPxId& operator= ( const SPxId id)

assignment operator

Definition at line 119 of file spxid.h.

References DataKey::operator=().

◆ operator=() [2/3]

SPxId& operator= ( const SPxColId cid)

assignment operator

Definition at line 127 of file spxid.h.

References DataKey::info, and DataKey::operator=().

◆ operator=() [3/3]

SPxId& operator= ( const SPxRowId rid)

assignment operator

Definition at line 134 of file spxid.h.

References DataKey::info, and DataKey::operator=().

◆ operator==()

int operator== ( const SPxId id) const

equality operator.

Definition at line 176 of file spxid.h.

◆ type()

Type type ( ) const

returns the type of the id.

Definition at line 146 of file spxid.h.

References DataKey::info.

Referenced by SPxHarrisRT::selectEnter(), and SPxSolver::unShift().

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 52 of file spxid.cpp.