#include <gamssymbol.h>
Public Member Functions | |
GAMSSymbol () | |
Standard constructor. | |
GAMSSymbol (const GAMSSymbol &symbol) | |
virtual | ~GAMSSymbol () |
Destructor. | |
GAMSSymbol | operator= (const GAMSSymbol &other) |
bool | operator!= (const GAMSSymbol &other) const |
bool | operator== (const GAMSSymbol &other) const |
bool | isValid () const |
GAMSSymbolIter< GAMSSymbol > | begin () |
GAMSSymbolIter< GAMSSymbol > | end () |
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< GAMSDomain > | domains () |
bool | checkDomains () |
std::vector< GAMSSymbolDomainViolation > | getSymbolDVs (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::GAMSDatabase & | database () const |
Get GAMSDatabase containing the GAMSSymbol. | |
std::string | text () const |
Get explanatory text of GAMSSymbol. | |
std::string & | name () const |
Get GAMSSymbol name. | |
int | dim () const |
Get GAMSSymbol dimension. | |
int | numberRecords () const |
Retrieve the number of records of the GAMSSymbol. | |
LogId | logID () |
GAMSEnum::SymbolType | type () const |
Get the symbol type. | |
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
-
symbol Another GAMSSymbol used as data source.
◆ ~GAMSSymbol()
|
virtual |
Destructor.
Member Function Documentation
◆ addRecord() [1/5]
GAMSSymbolRecord gams::GAMSSymbol::addRecord | ( | ) |
Add record to GAMSSymbol
- Returns
- Instance of GAMSSymbolRecord
◆ addRecord() [2/5]
GAMSSymbolRecord gams::GAMSSymbol::addRecord | ( | const std::string & | key1 | ) |
Add record to GAMSSymbol
- Parameters
-
key1 key for first index position
- Returns
- Instance of GAMSSymbolRecord
◆ addRecord() [3/5]
GAMSSymbolRecord gams::GAMSSymbol::addRecord | ( | const std::string & | key1, |
const std::string & | key2 | ||
) |
Add record to GAMSSymbol
- Parameters
-
key1 key for first index position key2 key for second index position
- Returns
- Instance of GAMSSymbolRecord
◆ addRecord() [4/5]
GAMSSymbolRecord gams::GAMSSymbol::addRecord | ( | const std::string & | key1, |
const std::string & | key2, | ||
const std::string & | key3 | ||
) |
Add record to GAMSSymbol
- Parameters
-
key1 key for first index position key2 key for second index position key3 key for third index position
- Returns
- Instance of GAMSSymbolRecord
◆ addRecord() [5/5]
GAMSSymbolRecord gams::GAMSSymbol::addRecord | ( | const std::vector< std::string > & | keys | ) |
Add record to GAMSSymbol
- Parameters
-
keys vector of keys
- 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; otherwisefalse
.
◆ clear()
bool gams::GAMSSymbol::clear | ( | ) |
Clear symbol
- Returns
- Returns
true
on success; otherwisefalse
◆ 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
-
target Target 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
-
keys List of keys
◆ 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 | ( | ) |
Find record in GAMSSymbol.
- Returns
- Instance of GAMSSymbolRecord.
◆ findRecord() [2/5]
GAMSSymbolRecord gams::GAMSSymbol::findRecord | ( | const std::string & | key1 | ) |
Find record in GAMSSymbol.
- Parameters
-
key1 Key for first index position.
- Returns
- Instance of GAMSSymbolRecord.
◆ findRecord() [3/5]
GAMSSymbolRecord gams::GAMSSymbol::findRecord | ( | const std::string & | key1, |
const std::string & | key2 | ||
) |
Find record in GAMSSymbol.
- Parameters
-
key1 Key for first index position. key2 Key for second index position.
- Returns
- Instance of GAMSSymbolRecord.
◆ findRecord() [4/5]
GAMSSymbolRecord gams::GAMSSymbol::findRecord | ( | const std::string & | key1, |
const std::string & | key2, | ||
const std::string & | key3 | ||
) |
Find record in GAMSSymbol.
- Parameters
-
key1 Key for first index position. key2 Key for second index position. key3 Key for third index position.
- Returns
- Instance of GAMSSymbolRecord.
◆ findRecord() [5/5]
GAMSSymbolRecord gams::GAMSSymbol::findRecord | ( | const std::vector< std::string > & | keys | ) |
Find record in GAMSSymbol.
- Parameters
-
keys Vector of keys.
- Returns
- Instance of GAMSSymbolRecord.
◆ firstRecord() [1/5]
GAMSSymbolRecord gams::GAMSSymbol::firstRecord | ( | ) |
Retrieve first record in GAMSSymbol.
- Returns
- Instance of GAMSSymbolRecord.
◆ firstRecord() [2/5]
GAMSSymbolRecord gams::GAMSSymbol::firstRecord | ( | const std::string & | key1 | ) |
Retrieve first record in GAMSSymbol that meets the slice criteria.
- Parameters
-
key1 Slicing criteria for first index position.
- Returns
- Instance of GAMSSymbolRecord
◆ firstRecord() [3/5]
GAMSSymbolRecord gams::GAMSSymbol::firstRecord | ( | const std::string & | key1, |
const std::string & | key2 | ||
) |
Retrieve first record in GAMSSymbol that meets the slice criteria.
- Parameters
-
key1 Slicing criteria for first index position. key2 Slicing criteria for second index position.
- Returns
- Instance of GAMSSymbolRecord.
◆ firstRecord() [4/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
-
key1 Slicing criteria for first index position. key2 Slicing criteria for second index position. key3 Slicing criteria for third index position.
- Returns
- Instance of GAMSSymbolRecord.
◆ firstRecord() [5/5]
GAMSSymbolRecord gams::GAMSSymbol::firstRecord | ( | const std::vector< std::string > & | slice | ) |
Retrieve the first record in GAMSSymbol that meets the slice criteria.
- Parameters
-
slice Define filter for elements whose record should be retrieved.
- Returns
- Instance of GAMSSymbolRecord.
◆ getSymbolDVs()
std::vector< GAMSSymbolDomainViolation > gams::GAMSSymbol::getSymbolDVs | ( | int | maxViol = 0 | ) |
Get all GAMSSymbolDomainViolations
.
- Parameters
-
maxViol The 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; otherwisefalse
.
◆ lastRecord() [1/5]
GAMSSymbolRecord gams::GAMSSymbol::lastRecord | ( | ) |
Retrieve last record in GAMSSymbol.
- Returns
- Instance of GAMSSymbolRecord.
◆ lastRecord() [2/5]
GAMSSymbolRecord gams::GAMSSymbol::lastRecord | ( | const std::string & | key1 | ) |
Retrieve last record in GAMSSymbol.
- Parameters
-
key1 slicing criteria for first index position.
- Returns
- Instance of GAMSSymbolRecord.
◆ lastRecord() [3/5]
GAMSSymbolRecord gams::GAMSSymbol::lastRecord | ( | const std::string & | key1, |
const std::string & | key2 | ||
) |
Retrieve last record in GAMSSymbol.
- Parameters
-
key1 Slicing criteria for first index position. key2 Slicing criteria for second index position.
- Returns
- Instance of GAMSSymbolRecord.
◆ lastRecord() [4/5]
GAMSSymbolRecord gams::GAMSSymbol::lastRecord | ( | const std::string & | key1, |
const std::string & | key2, | ||
const std::string & | key3 | ||
) |
Retrieve last record in GAMSSymbol.
- Parameters
-
key1 Slicing criteria for first index position. key2 Slicing criteria for second index position. key3 Slicing criteria for third index position.
- Returns
- Instance of GAMSSymbolRecord
◆ lastRecord() [5/5]
GAMSSymbolRecord gams::GAMSSymbol::lastRecord | ( | const std::vector< std::string > & | slice | ) |
Retrieve a slice of the last record in GAMSSymbol.
- Parameters
-
slice Define filter for elements whose record should be retrieved.
- 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 | ( | ) |
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() [2/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
-
key1 Key for first index position.
- Returns
- Instance of found or added GAMSSymbolRecord.
◆ mergeRecord() [3/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
-
key1 Key for first index position. key2 Key for second index position.
- Returns
- Instance of found or added GAMSSymbolRecord.
◆ mergeRecord() [4/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
-
key1 Key for first index position. key2 Key for second index position. key3 Key for third index position.
- Returns
- Instance of found or added GAMSSymbolRecord.
◆ mergeRecord() [5/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
-
keys List of keys.
- 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
-
other Another GAMSSymbol to compare to.
- Returns
- Returns
true
if the two GAMSSymbol objects are different; otherwisefalse
.
◆ operator=()
GAMSSymbol gams::GAMSSymbol::operator= | ( | const GAMSSymbol & | other | ) |
Assigns a GAMSSymbol.
- Parameters
-
other Another 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
-
other Another GAMSSymbol to compare to.
- Returns
- Returns
true
if the two GAMSSymbol are equal; otherwisefalse
.
◆ text()
std::string gams::GAMSSymbol::text | ( | ) | const |
Get explanatory text of GAMSSymbol.
◆ type()
GAMSEnum::SymbolType gams::GAMSSymbol::type | ( | ) | const |
Get the symbol type.