gams::GAMSSymbol Class Reference

#include <gamssymbol.h>

Inheritance diagram for gams::GAMSSymbol:
gams::GAMSEquation gams::GAMSParameter gams::GAMSSet gams::GAMSVariable

Public Member Functions

 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 symbol in GAMS. It exists in a GAMSDatabase and contains GAMSSymbolRecords which can be iterated through. Derived classes are GAMSEquation, GAMSParameter, GAMSSet and GAMSVariable.

Definition at line 48 of file gamssymbol.h.

Constructor & Destructor Documentation

◆ GAMSSymbol() [1/2]

gams::GAMSSymbol::GAMSSymbol ( )

Standard constructor.

◆ GAMSSymbol() [2/2]

gams::GAMSSymbol::GAMSSymbol ( const GAMSSymbol symbol)

Shallow copy constructor that creates a new frame pointing to an existing GAMSSymbol

Parameters
symbolAnother GAMSSymbol used as data source.

◆ ~GAMSSymbol()

virtual gams::GAMSSymbol::~GAMSSymbol ( )
virtual

Destructor.

Member Function Documentation

◆ addRecord() [1/5]

GAMSSymbolRecord gams::GAMSSymbol::addRecord ( const std::vector< std::string > &  keys)

Add record to GAMSSymbol

Parameters
keysvector of keys
Returns
Instance of GAMSSymbolRecord

◆ addRecord() [2/5]

GAMSSymbolRecord gams::GAMSSymbol::addRecord ( )

Add record to GAMSSymbol

Returns
Instance of GAMSSymbolRecord

◆ addRecord() [3/5]

GAMSSymbolRecord gams::GAMSSymbol::addRecord ( const std::string &  key1)

Add record to GAMSSymbol

Parameters
key1key for first index position
Returns
Instance of GAMSSymbolRecord

◆ addRecord() [4/5]

GAMSSymbolRecord gams::GAMSSymbol::addRecord ( const std::string &  key1,
const std::string &  key2 
)

Add record to GAMSSymbol

Parameters
key1key for first index position
key2key for second index position
Returns
Instance of GAMSSymbolRecord

◆ addRecord() [5/5]

GAMSSymbolRecord gams::GAMSSymbol::addRecord ( const std::string &  key1,
const std::string &  key2,
const std::string &  key3 
)

Add record to GAMSSymbol

Parameters
key1key for first index position
key2key for second index position
key3key for third index position
Returns
Instance of GAMSSymbolRecord

◆ begin()

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

Interator to the begining.

Returns
Iterator to the first GAMSSymbol.

◆ checkDomains()

bool gams::GAMSSymbol::checkDomains ( )

Check for domain violations.

Returns
Returns true if there is any domain violation; otherwise false.

◆ clear()

bool gams::GAMSSymbol::clear ( )

Clear symbol

Returns
Returns true on success; otherwise false

◆ copySymbol()

void gams::GAMSSymbol::copySymbol ( const GAMSSymbol target)

Copys all records of this GAMSSymbol to the target GAMSSymbol.

Remarks
If the target symbol had records, they will be deleted.
Parameters
targetTarget GAMSSymbol.

◆ database()

gams::GAMSDatabase& gams::GAMSSymbol::database ( ) const

Get GAMSDatabase containing the GAMSSymbol.

◆ deleteRecord()

void gams::GAMSSymbol::deleteRecord ( const std::vector< std::string > &  keys)

Delete GAMSSymbol record.

Parameters
keysList of keys
Returns
Returns true on success; otherwise false.

◆ dim()

int gams::GAMSSymbol::dim ( ) const

Get GAMSSymbol dimension.

◆ domains()

std::vector<GAMSDomain> gams::GAMSSymbol::domains ( )

Get domains of a Symbol.

Remarks
Each element is either a GAMSSet (real domain) or a string (relaxed domain).

◆ end()

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

Iterator to end.

Returns
Iterator to the element following the last GAMSSymbol.

◆ findRecord() [1/5]

GAMSSymbolRecord gams::GAMSSymbol::findRecord ( const std::vector< std::string > &  keys)

Find record in GAMSSymbol.

Parameters
keysVector of keys.
Returns
Instance of GAMSSymbolRecord.

◆ findRecord() [2/5]

GAMSSymbolRecord gams::GAMSSymbol::findRecord ( )

Find record in GAMSSymbol.

Returns
Instance of GAMSSymbolRecord.

◆ findRecord() [3/5]

GAMSSymbolRecord gams::GAMSSymbol::findRecord ( const std::string &  key1)

Find record in GAMSSymbol.

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

◆ findRecord() [4/5]

GAMSSymbolRecord gams::GAMSSymbol::findRecord ( const std::string &  key1,
const std::string &  key2 
)

Find record in GAMSSymbol.

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

◆ findRecord() [5/5]

GAMSSymbolRecord gams::GAMSSymbol::findRecord ( const std::string &  key1,
const std::string &  key2,
const std::string &  key3 
)

Find record in GAMSSymbol.

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

◆ firstRecord() [1/5]

GAMSSymbolRecord gams::GAMSSymbol::firstRecord ( const std::vector< std::string > &  slice)

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

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

◆ firstRecord() [2/5]

GAMSSymbolRecord gams::GAMSSymbol::firstRecord ( )

Retrieve first record in GAMSSymbol.

Returns
Instance of GAMSSymbolRecord.

◆ firstRecord() [3/5]

GAMSSymbolRecord gams::GAMSSymbol::firstRecord ( const std::string &  key1)

Retrieve first record in GAMSSymbol that meets the slice criteria.

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

◆ firstRecord() [4/5]

GAMSSymbolRecord gams::GAMSSymbol::firstRecord ( const std::string &  key1,
const std::string &  key2 
)

Retrieve first record in GAMSSymbol that meets the slice criteria.

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

◆ firstRecord() [5/5]

GAMSSymbolRecord gams::GAMSSymbol::firstRecord ( const std::string &  key1,
const std::string &  key2,
const std::string &  key3 
)

Retrieve first record in GAMSSymbol 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 GAMSSymbolRecord.

◆ getSymbolDVs()

std::vector<GAMSSymbolDomainViolation> gams::GAMSSymbol::getSymbolDVs ( int  maxViol = 0)

Get all GAMSSymbolDomainViolations.

Parameters
maxViolThe maximum number of domain violations which should be stored (0 for no limit)
Returns
Returns a list of all GAMSSymbolDomainViolations.

◆ isValid()

bool gams::GAMSSymbol::isValid ( ) const

Checks if a GAMSSymbol is valid.

Returns
Returns true if the GAMSSymbol is valid; otherwise false.

◆ lastRecord() [1/5]

GAMSSymbolRecord gams::GAMSSymbol::lastRecord ( const std::vector< std::string > &  slice)

Retrieve a slice of the last record in GAMSSymbol.

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

◆ lastRecord() [2/5]

GAMSSymbolRecord gams::GAMSSymbol::lastRecord ( )

Retrieve last record in GAMSSymbol.

Returns
Instance of GAMSSymbolRecord.

◆ lastRecord() [3/5]

GAMSSymbolRecord gams::GAMSSymbol::lastRecord ( const std::string &  key1)

Retrieve last record in GAMSSymbol.

Parameters
key1slicing criteria for first index position.
Returns
Instance of GAMSSymbolRecord.

◆ lastRecord() [4/5]

GAMSSymbolRecord gams::GAMSSymbol::lastRecord ( const std::string &  key1,
const std::string &  key2 
)

Retrieve last record in GAMSSymbol.

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

◆ lastRecord() [5/5]

GAMSSymbolRecord gams::GAMSSymbol::lastRecord ( const std::string &  key1,
const std::string &  key2,
const std::string &  key3 
)

Retrieve last record in GAMSSymbol.

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

◆ logID()

LogId gams::GAMSSymbol::logID ( )

Get the GAMS log ID.

Returns
Returns the GAMS log ID.

◆ mergeRecord() [1/5]

GAMSSymbolRecord gams::GAMSSymbol::mergeRecord ( const std::vector< std::string > &  keys)

Finds a record in a GAMSSymbol if it exists, otherwise the record gets added to the symbol.

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

◆ mergeRecord() [2/5]

GAMSSymbolRecord gams::GAMSSymbol::mergeRecord ( )

Finds a record in a GAMSSymbol if it exists, otherwise the record gets added to the symbol.

Returns
Instance of found or added GAMSSymbolRecord.

◆ mergeRecord() [3/5]

GAMSSymbolRecord gams::GAMSSymbol::mergeRecord ( const std::string &  key1)

Finds a record in a GAMSSymbol if it exists, otherwise the record gets added to the symbol.

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

◆ mergeRecord() [4/5]

GAMSSymbolRecord gams::GAMSSymbol::mergeRecord ( const std::string &  key1,
const std::string &  key2 
)

Finds record in GAMSSymbol if it exists, otherwise the record gets added to the symbol.

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

◆ mergeRecord() [5/5]

GAMSSymbolRecord gams::GAMSSymbol::mergeRecord ( const std::string &  key1,
const std::string &  key2,
const std::string &  key3 
)

Finds record in GAMSSymbol if it exists, otherwise the record gets added to the symbol.

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

◆ name()

std::string& gams::GAMSSymbol::name ( ) const

Get GAMSSymbol name.

◆ numberRecords()

int gams::GAMSSymbol::numberRecords ( ) const

Retrieve the number of records of the GAMSSymbol.

◆ operator!=()

bool gams::GAMSSymbol::operator!= ( const GAMSSymbol other) const

Compares two GAMSSymbol objects.

Parameters
otherAnother GAMSSymbol to compare to.
Returns
Returns true if the two GAMSSymbol objects are different; otherwise false.

◆ operator=()

GAMSSymbol gams::GAMSSymbol::operator= ( const GAMSSymbol other)

Assigns a GAMSSymbol.

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

◆ operator==()

bool gams::GAMSSymbol::operator== ( const GAMSSymbol other) const

Compares two GAMSSymbol objects.

Parameters
otherAnother GAMSSymbol to compare to.
Returns
Returns true if the two GAMSSymbol are equal; otherwise false.

◆ text()

std::string gams::GAMSSymbol::text ( ) const

Get explanatory text of GAMSSymbol.

◆ type()

GAMSEnum::SymbolType gams::GAMSSymbol::type ( ) const

Get the symbol type.