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... | |
SPxId & | operator= (const SPxColId &cid) |
assignment operator More... | |
SPxId & | operator= (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... | |
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.
enum Type |
void inValidate | ( | ) |
bool isSPxColId | ( | ) | const |
is id a column id?
Definition at line 168 of file spxid.h.
References DataKey::info.
Referenced by SPxRowId::SPxRowId().
bool isSPxRowId | ( | ) | const |
is id a row id?
Definition at line 163 of file spxid.h.
References DataKey::info.
Referenced by SPxSolverBase< R >::coVector(), SPxSolverBase< R >::enterVector(), SPxSolverBase< R >::isBasic(), SPxColId::SPxColId(), and SPxSolverBase< R >::vector().
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().
int operator!= | ( | const SPxId & | id | ) | const |
bool operator< | ( | const SPxId & | id | ) | const |
assignment operator
Definition at line 129 of file spxid.h.
References SPxId::COL_ID, and DataKey::info.
assignment operator
Definition at line 136 of file spxid.h.
References DataKey::info, and SPxId::ROW_ID.
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.