gams::GAMSVariable Class Reference

#include <gamsvariable.h>

Inheritance diagram for gams::GAMSVariable:
gams::GAMSSymbol

Public Member Functions

 GAMSVariable ()
 Standard constructor. More...
 
 GAMSVariable (const GAMSSymbol &other)
 
 ~GAMSVariable ()
 Destructor. More...
 
GAMSSymbolIter< GAMSVariablebegin ()
 
GAMSSymbolIter< GAMSVariableend ()
 
GAMSVariableoperator= (const GAMSVariable &other)
 
GAMSVariableRecord firstRecord (const std::vector< std::string > &slice)
 
GAMSVariableRecord firstRecord ()
 
GAMSVariableRecord firstRecord (const std::string &key1)
 
GAMSVariableRecord firstRecord (const std::string &key1, const std::string &key2)
 
GAMSVariableRecord firstRecord (const std::string &key1, const std::string &key2, const std::string &key3)
 
GAMSVariableRecord lastRecord (const std::vector< std::string > &slice)
 
GAMSVariableRecord lastRecord ()
 
GAMSVariableRecord lastRecord (const std::string &key1)
 
GAMSVariableRecord lastRecord (const std::string &key1, const std::string &key2)
 
GAMSVariableRecord lastRecord (const std::string &key1, const std::string &key2, const std::string &key3)
 
GAMSVariableRecord findRecord (const std::vector< std::string > &keys)
 
GAMSVariableRecord findRecord ()
 
GAMSVariableRecord findRecord (const std::string &key1)
 
GAMSVariableRecord findRecord (const std::string &key1, const std::string &key2)
 
GAMSVariableRecord findRecord (const std::string &key1, const std::string &key2, const std::string &key3)
 
GAMSVariableRecord mergeRecord (const std::vector< std::string > &keys)
 
GAMSVariableRecord mergeRecord ()
 
GAMSVariableRecord mergeRecord (const std::string &key1)
 
GAMSVariableRecord mergeRecord (const std::string &key1, const std::string &key2)
 
GAMSVariableRecord mergeRecord (const std::string &key1, const std::string &key2, const std::string &key3)
 
GAMSVariableRecord addRecord (const std::vector< std::string > &keys)
 
GAMSVariableRecord addRecord ()
 
GAMSVariableRecord addRecord (const std::string &key1)
 
GAMSVariableRecord addRecord (const std::string &key1, const std::string &key2)
 
GAMSVariableRecord addRecord (const std::string &key1, const std::string &key2, const std::string &key3)
 
GAMSEnum::VarType varType ()
 Retrieve subtype of variable (Binary, Integer, Positive, Negative, Free, SOS1, SOS2, SemiCont, SemiInt). More...
 
- Public Member Functions inherited from gams::GAMSSymbol
 GAMSSymbol ()
 Standard constructor. More...
 
 GAMSSymbol (const GAMSSymbol &symbol)
 
virtual ~GAMSSymbol ()
 Destructor. More...
 
GAMSSymbol operator= (const GAMSSymbol &other)
 
bool operator!= (const GAMSSymbol &other) const
 
bool operator== (const GAMSSymbol &other) const
 
bool isValid () const
 
GAMSSymbolIter< GAMSSymbolbegin ()
 
GAMSSymbolIter< GAMSSymbolend ()
 
GAMSSymbolRecord addRecord (const std::vector< std::string > &keys)
 
GAMSSymbolRecord addRecord ()
 
GAMSSymbolRecord addRecord (const std::string &key1)
 
GAMSSymbolRecord addRecord (const std::string &key1, const std::string &key2)
 
GAMSSymbolRecord addRecord (const std::string &key1, const std::string &key2, const std::string &key3)
 
void deleteRecord (const std::vector< std::string > &keys)
 
bool clear ()
 
std::vector< GAMSDomaindomains ()
 
bool checkDomains ()
 
std::vector< GAMSSymbolDomainViolationgetSymbolDVs (int maxViol=0)
 
GAMSSymbolRecord firstRecord (const std::vector< std::string > &slice)
 
GAMSSymbolRecord firstRecord ()
 
GAMSSymbolRecord firstRecord (const std::string &key1)
 
GAMSSymbolRecord firstRecord (const std::string &key1, const std::string &key2)
 
GAMSSymbolRecord firstRecord (const std::string &key1, const std::string &key2, const std::string &key3)
 
GAMSSymbolRecord lastRecord (const std::vector< std::string > &slice)
 
GAMSSymbolRecord lastRecord ()
 
GAMSSymbolRecord lastRecord (const std::string &key1)
 
GAMSSymbolRecord lastRecord (const std::string &key1, const std::string &key2)
 
GAMSSymbolRecord lastRecord (const std::string &key1, const std::string &key2, const std::string &key3)
 
GAMSSymbolRecord findRecord (const std::vector< std::string > &keys)
 
GAMSSymbolRecord findRecord ()
 
GAMSSymbolRecord findRecord (const std::string &key1)
 
GAMSSymbolRecord findRecord (const std::string &key1, const std::string &key2)
 
GAMSSymbolRecord findRecord (const std::string &key1, const std::string &key2, const std::string &key3)
 
GAMSSymbolRecord mergeRecord (const std::vector< std::string > &keys)
 
GAMSSymbolRecord mergeRecord ()
 
GAMSSymbolRecord mergeRecord (const std::string &key1)
 
GAMSSymbolRecord mergeRecord (const std::string &key1, const std::string &key2)
 
GAMSSymbolRecord mergeRecord (const std::string &key1, const std::string &key2, const std::string &key3)
 
void copySymbol (const GAMSSymbol &target)
 
gams::GAMSDatabasedatabase () const
 Get GAMSDatabase containing the GAMSSymbol. More...
 
std::string text () const
 Get explanatory text of GAMSSymbol. More...
 
std::string & name () const
 Get GAMSSymbol name. More...
 
int dim () const
 Get GAMSSymbol dimension. More...
 
int numberRecords () const
 Retrieve the number of records of the GAMSSymbol. More...
 
LogId logID ()
 
GAMSEnum::SymbolType type () const
 Get the symbol type. More...
 

Detailed Description

This is the representation of a variable symbol in GAMS. It exists in a GAMSDatabase and contains GAMSVariableRecords which one can iterate through.

Definition at line 36 of file gamsvariable.h.

Constructor & Destructor Documentation

◆ GAMSVariable() [1/2]

gams::GAMSVariable::GAMSVariable ( )

Standard constructor.

◆ GAMSVariable() [2/2]

gams::GAMSVariable::GAMSVariable ( const GAMSSymbol other)

Constructor based on GAMSSymbol.

Parameters
otherAnother GAMSSymbol used as data source.

◆ ~GAMSVariable()

gams::GAMSVariable::~GAMSVariable ( )

Destructor.

Member Function Documentation

◆ addRecord() [1/5]

GAMSVariableRecord gams::GAMSVariable::addRecord ( const std::vector< std::string > &  keys)

Add record to GAMSVariable.

Parameters
keysVector of keys.
Returns
Instance of GAMSVariableRecord.

◆ addRecord() [2/5]

GAMSVariableRecord gams::GAMSVariable::addRecord ( )

Add record to GAMSVariable.

Returns
Instance of GAMSVariableRecord.

◆ addRecord() [3/5]

GAMSVariableRecord gams::GAMSVariable::addRecord ( const std::string &  key1)

Add record to GAMSVariable.

Parameters
key1Key for first index position.
Returns
Instance of GAMSVariableRecord.

◆ addRecord() [4/5]

GAMSVariableRecord gams::GAMSVariable::addRecord ( const std::string &  key1,
const std::string &  key2 
)

Add record to GAMSVariable.

Parameters
key1Key for first index position.
key2Key for second index position.
Returns
Instance of GAMSVariableRecord.

◆ addRecord() [5/5]

GAMSVariableRecord gams::GAMSVariable::addRecord ( const std::string &  key1,
const std::string &  key2,
const std::string &  key3 
)

Add record to GAMSVariable.

Parameters
key1Key for first index position.
key2Key for second index position.
key3Key for third index position.
Returns
Instance of GAMSVariableRecord.

◆ begin()

GAMSSymbolIter<GAMSVariable> gams::GAMSVariable::begin ( )

Interator to the begining.

Returns
Iterator to the first GAMSVariable.

◆ end()

GAMSSymbolIter<GAMSVariable> gams::GAMSVariable::end ( )

Iterator to end.

Returns
Iterator to the element following the last GAMSVariable.

◆ findRecord() [1/5]

GAMSVariableRecord gams::GAMSVariable::findRecord ( const std::vector< std::string > &  keys)

Find record in GAMSVariable.

Parameters
keysVector of keys.
Returns
Instance of GAMSVariableRecord.

◆ findRecord() [2/5]

GAMSVariableRecord gams::GAMSVariable::findRecord ( )

Find record in GAMSVariable.

Returns
Instance of GAMSVariableRecord.

◆ findRecord() [3/5]

GAMSVariableRecord gams::GAMSVariable::findRecord ( const std::string &  key1)

Find record in GAMSVariable.

Parameters
key1Key for first index position.
Returns
Instance of GAMSVariableRecord.

◆ findRecord() [4/5]

GAMSVariableRecord gams::GAMSVariable::findRecord ( const std::string &  key1,
const std::string &  key2 
)

Find record in GAMSVariable.

Parameters
key1Key for first index position.
key2Key for second index position.
Returns
Instance of GAMSVariableRecord.

◆ findRecord() [5/5]

GAMSVariableRecord gams::GAMSVariable::findRecord ( const std::string &  key1,
const std::string &  key2,
const std::string &  key3 
)

Find record in GAMSVariable.

Parameters
key1Key for first index position.
key2Key for second index position.
key3Key for third index position.
Returns
Instance of GAMSVariableRecord.

◆ firstRecord() [1/5]

GAMSVariableRecord gams::GAMSVariable::firstRecord ( const std::vector< std::string > &  slice)

Retrieve the first record in GAMSVariable that meets the slice criteria.

Parameters
sliceDefine filter for elements whose record should be retrieved.
Returns
Instance of GAMSVariableRecord.

◆ firstRecord() [2/5]

GAMSVariableRecord gams::GAMSVariable::firstRecord ( )

Retrieve first record in GAMSVariable.

Returns
Instance of GAMSVariableRecord.

◆ firstRecord() [3/5]

GAMSVariableRecord gams::GAMSVariable::firstRecord ( const std::string &  key1)

Retrieve first record in GAMSVariable that meets the slice criteria.

Parameters
key1Slicing criteria for first index position.
Returns
Instance of GAMSVariableRecord.

◆ firstRecord() [4/5]

GAMSVariableRecord gams::GAMSVariable::firstRecord ( const std::string &  key1,
const std::string &  key2 
)

Retrieve first record in GAMSVariable that meets the slice criteria.

Parameters
key1Slicing criteria for first index position.
key2Slicing criteria for second index position.
Returns
Instance of GAMSVariableRecord.

◆ firstRecord() [5/5]

GAMSVariableRecord gams::GAMSVariable::firstRecord ( const std::string &  key1,
const std::string &  key2,
const std::string &  key3 
)

Retrieve first record in GAMSVariable that meets the slice criteria.

Parameters
key1Slicing criteria for first index position.
key2Slicing criteria for second index position.
key3Slicing criteria for third index position.
Returns
Instance of GAMSVariableRecord.

◆ lastRecord() [1/5]

GAMSVariableRecord gams::GAMSVariable::lastRecord ( const std::vector< std::string > &  slice)

Retrieve a slice of the last record in GAMSVariable.

Parameters
sliceDefine filter for elements whose record should be retrieved.
Returns
Instance of GAMSVariableRecord.

◆ lastRecord() [2/5]

GAMSVariableRecord gams::GAMSVariable::lastRecord ( )

Retrieve last record in GAMSVariable.

Returns
Instance of GAMSVariableRecord.

◆ lastRecord() [3/5]

GAMSVariableRecord gams::GAMSVariable::lastRecord ( const std::string &  key1)

Retrieve last record in GAMSVariable.

Parameters
key1Slicing criteria for first index position.
Returns
Instance of GAMSVariableRecord.

◆ lastRecord() [4/5]

GAMSVariableRecord gams::GAMSVariable::lastRecord ( const std::string &  key1,
const std::string &  key2 
)

Retrieve last record in GAMSVariable.

Parameters
key1Slicing criteria for first index position.
key2Slicing criteria for second index position.
Returns
Instance of GAMSVariableRecord.

◆ lastRecord() [5/5]

GAMSVariableRecord gams::GAMSVariable::lastRecord ( const std::string &  key1,
const std::string &  key2,
const std::string &  key3 
)

Retrieve last record in GAMSVariable.

Parameters
key1Slicing criteria for first index position.
key2Slicing criteria for second index position.
key3Slicing criteria for third index position.
Returns
Instance of GAMSVariableRecord.

◆ mergeRecord() [1/5]

GAMSVariableRecord gams::GAMSVariable::mergeRecord ( const std::vector< std::string > &  keys)

Finds record in GAMSVariable if it exists; otherwise add it.

Parameters
keysList of keys.
Returns
Instance of found or added GAMSVariableRecord.

◆ mergeRecord() [2/5]

GAMSVariableRecord gams::GAMSVariable::mergeRecord ( )

Finds record in GAMSVariable if it exists; otherwise add it.

Returns
Instance of found or added GAMSVariableRecord.

◆ mergeRecord() [3/5]

GAMSVariableRecord gams::GAMSVariable::mergeRecord ( const std::string &  key1)

Finds record in GAMSVariable if it exists; otherwise add it.

Parameters
key1Key for first index position.
Returns
Instance of found or added GAMSVariableRecord.

◆ mergeRecord() [4/5]

GAMSVariableRecord gams::GAMSVariable::mergeRecord ( const std::string &  key1,
const std::string &  key2 
)

Finds record in GAMSVariable if it exists; otherwise add it.

Parameters
key1Key for first index position.
key2Key for second index position.
Returns
Instance of found or added GAMSVariableRecord.

◆ mergeRecord() [5/5]

GAMSVariableRecord gams::GAMSVariable::mergeRecord ( const std::string &  key1,
const std::string &  key2,
const std::string &  key3 
)

Finds record in GAMSVariable if it exists; otherwise add it.

Parameters
key1Key for first index position.
key2Key for second index position.
key3Key for third index position.
Returns
Instance of found or added GAMSVariableRecord.

◆ operator=()

GAMSVariable& gams::GAMSVariable::operator= ( const GAMSVariable other)

Assigns a GAMSVariable.

Parameters
otherAnother GAMSVariable used as data source.
Returns
Returns the assigned GAMSVariable (*this).

◆ varType()

GAMSEnum::VarType gams::GAMSVariable::varType ( )

Retrieve subtype of variable (Binary, Integer, Positive, Negative, Free, SOS1, SOS2, SemiCont, SemiInt).