Scippy

SoPlex

Sequential object-oriented simPlex

DataKey Class Reference

Entry identifier class for items of a DataSet.Every item in a DataSet is assigned a DataKey by which it can be accessed (using DataSet::operator[]()). A DataKey consists of an integer member idx, which is a positive number for any valid DataKey. No idx of an element in a DataSet may exceed the sets max(). This property may be used to build arrays with additional information to the elements of a DataSet. More...

#include <datakey.h>

Public Member Functions

Constructors / destructors
 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...
 
Access / modification
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...
 

Public Attributes

Data
int info
 user information to store values -1, 0, +1 More...
 
int idx
 (locally) unique key index More...
 

Detailed Description

Entry identifier class for items of a DataSet.

Every item in a DataSet is assigned a DataKey by which it can be accessed (using DataSet::operator[]()). A DataKey consists of an integer member idx, which is a positive number for any valid DataKey. No idx of an element in a DataSet may exceed the sets max(). This property may be used to build arrays with additional information to the elements of a DataSet.

In addition, DataKeys provide a member info which can be used to store further information.

Each DataKey is unique for one DataSet but different DataSets may (and generally will) manage the same DataKeys. When an element is removed from a DataSet its DataKey may (and generally will) be reused for other elements added to the DataSet later on.

Todo:
data members should be private.

Definition at line 46 of file datakey.h.

Constructor & Destructor Documentation

◆ DataKey() [1/3]

DataKey ( )

Default constructor. Constructs an invalid DataKey.

Definition at line 65 of file datakey.h.

◆ DataKey() [2/3]

DataKey ( int  p_info,
int  p_idx 
)

Definition at line 69 of file datakey.h.

◆ DataKey() [3/3]

DataKey ( const DataKey old)

Copy constructor.

Definition at line 87 of file datakey.h.

Member Function Documentation

◆ getIdx()

int getIdx ( ) const

gets the index number (idx) of the DataKey.

Definition at line 97 of file datakey.h.

References DataKey::idx.

Referenced by SoPlex::_formDecompComplementaryProblem(), and SPxId::operator<().

◆ inValidate()

void inValidate ( )

makes the DataKey invalid and clears the info field.

Definition at line 112 of file datakey.h.

Referenced by SoPlex::_removeComplementaryDualFixedPrimalVars(), and SoPlex::_updateComplementaryDualFixedPrimalVars().

◆ isValid()

bool isValid ( ) const

returns TRUE, iff the DataKey is valid.

Definition at line 107 of file datakey.h.

◆ operator=()

DataKey& operator= ( const DataKey rhs)

Assignment operator.

Definition at line 76 of file datakey.h.

References DataKey::idx, and DataKey::info.

Referenced by SPxId::operator=().

◆ setIdx()

void setIdx ( int  p_idx)

sets the index number (idx) of the DataKey.

Definition at line 102 of file datakey.h.

Member Data Documentation

◆ idx

◆ info