GAMS.GAMSSet Class Reference

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

Inheritance diagram for GAMS.GAMSSet:
GAMS.GAMSSymbol

Public Member Functions

new GAMSSetRecord AddRecord (params string[] keys)
 Add record to GAMSSet More...
 
new GAMSSetRecord FindRecord (params string[] keys)
 Find record in GAMSSet More...
 
new GAMSSetRecord MergeRecord (params string[] keys)
 Finds record in GAMSSet if it exists, adds it if not More...
 
new GAMSSetRecord FirstRecord ()
 Retrieve first record in GAMSSet More...
 
new GAMSSetRecord FirstRecord (params string[] slice)
 Retrieve a slice of the first record in GAMSSet More...
 
new GAMSSetRecord LastRecord ()
 Retrieve last record in GAMSSet More...
 
new GAMSSetRecord LastRecord (params string[] slice)
 Retrieve a slice of the last record of GAMSSet More...
 
- Public Member Functions inherited from GAMS.GAMSSymbol
bool DeleteRecord (params string[] keys)
 Delete GAMSSymbol record More...
 
bool Clear ()
 Clear symbol More...
 
bool CheckDomains ()
 Check if all records are within the specified domain of the symbol More...
 
List< GAMSSymbolDomainViolationGetSymbolDVs (int MaxViol=0)
 Return all GAMSSymbolDomainViolations More...
 
GAMSSymbolRecord AddRecord (params string[] keys)
 Add record to GAMSSymbol More...
 
GAMSSymbolRecord FindRecord (params string[] keys)
 Find record in GAMSSymbol More...
 
GAMSSymbolRecord MergeRecord (params string[] keys)
 Finds record in GAMSSymbol if it exists, adds it if not More...
 
GAMSSymbolRecord FirstRecord ()
 Retrieve first record in GAMSSymbol More...
 
GAMSSymbolRecord FirstRecord (params string[] slice)
 Retrieve the first record in GAMSSymbol that meets the slice criteria. More...
 
GAMSSymbolRecord LastRecord ()
 Retrieve last record in GAMSSymbol More...
 
GAMSSymbolRecord LastRecord (params string[] slice)
 Retrieve a slice of the last record in GAMSSymbol More...
 
void CopySymbol (GAMSSymbol target)
 Copys all records of this GAMSSymbol to target GAMSSymbol (if target had records, they will be deleted) More...
 
void CopyToArray (object cube, int field=gamsglobals.val_level)
 Copies values of a dense symbol into a dense array If the symbol is a set, the position of each record within the set is stored (1-based). If the symbol is a parameter the value is stored. If the symbol is an equation or a variable the parameter field determines what is stored More...
 
int CopyToSqzdArray (object cube, int field, params Tuple< GAMSSet, GAMSSet >[] domains)
 Copies values of a sparse symbol into a squeezed array If the symbol is a set, the position of each record within the set is stored (1-based). If the symbol is a parameter the value is stored. If the symbol is an equation or a variable the parameter field determines what is stored More...
 
int CopyToSqzdArray (object cube, params Tuple< GAMSSet, GAMSSet >[] domains)
 Copies values of a sparse symbol into a squeezed array If the symbol is a set, the position of each record within the set is stored (1-based). If the symbol is a parameter the value is stored. If the symbol is an equation or a variable the level is stored. More...
 
int CopySparseToDenseArray (object cube, int field, params GAMSSet[] domains)
 Copies values of a sparse symbol into a dense array If the symbol is a set, the position of each record within the set is stored (1-based). If the symbol is a parameter the value is stored. If the symbol is an equation or a variable the parameter field determines what is stored More...
 
int CopySparseToDenseArray (object cube, params GAMSSet[] domains)
 Copies values of a sparse symbol into a squeezed array If the symbol is a set, the position of each record within the set is stored (1-based). If the symbol is a parameter the value is stored. If the symbol is an equation or a variable the level is stored. More...
 
void CopyFromDenseArray (object cube, params GAMSSet[] domains)
 Copies values from dense array into a symbol If the symbol is a set, the defined records are added. If the symbol is a parameter, the defined records are added and the values are set. If the symbol is an equation or a variable, the defined records are added and the levels are set.111 More...
 
void CopySliceFromDenseArray (object cube, params Tuple< GAMSSet, GAMSSet >[] domains)
 Copies values from slice of dense array into a symbol If the symbol is a set, the defined records are added. If the symbol is a parameter, the defined records are added and the values are set. If the symbol is an equation or a variable, the defined records are added and the levels are set.111 More...
 
GAMSSymbolEnumerator GetEnumerator ()
 Retrieve an enumerator for this symbol. More...
 

Additional Inherited Members

- Protected Member Functions inherited from GAMS.GAMSSymbol
 GAMSSymbol (GAMSDatabase database, IntPtr symPtr)
 Constructor More...
 
 GAMSSymbol (GAMSDatabase database, string identifier, int dimension, string explanatoryText)
 Constructor More...
 
- Properties inherited from GAMS.GAMSSymbol
GAMSDatabase GAMSDatabase [get]
 Get GAMSDatabase containing GAMSSymbol More...
 
string Name [get]
 Get GAMSSymbol name More...
 
int Dim [get]
 Get GAMSSymbol dimension More...
 
string Text [get]
 Get explanatory text of GAMSSymbol More...
 
int NumberRecords [get]
 Retrieve the number of records of the GAMSSymbol More...
 
List< object > Domains [get]
 Domains of Symbol, each element is either a GAMSSet (real domain) or a string (relaxed domain) More...
 
List< string > DomainsAsStrings [get]
 Domains of Symbol, each element is a string Note: If the domain is an alias in GAMS, this call will return the name of the Alias, not the name of the aliased Set More...
 

Detailed Description

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

Member Function Documentation

◆ AddRecord()

new GAMSSetRecord GAMS.GAMSSet.AddRecord ( params string []  keys)
inline

Add record to GAMSSet

Parameters
keysList of keys
Returns
Reference to added record

◆ FindRecord()

new GAMSSetRecord GAMS.GAMSSet.FindRecord ( params string []  keys)
inline

Find record in GAMSSet

Parameters
keysList of keys
Returns
Reference to found record

◆ FirstRecord() [1/2]

new GAMSSetRecord GAMS.GAMSSet.FirstRecord ( )
inline

Retrieve first record in GAMSSet

Returns
Reference to record

◆ FirstRecord() [2/2]

new GAMSSetRecord GAMS.GAMSSet.FirstRecord ( params string []  slice)
inline

Retrieve a slice of the first record in GAMSSet

Parameters
sliceDefine filter for elements whose record should be retrieved
Returns
Reference to record

◆ LastRecord() [1/2]

new GAMSSetRecord GAMS.GAMSSet.LastRecord ( )
inline

Retrieve last record in GAMSSet

Returns
Reference to record

◆ LastRecord() [2/2]

new GAMSSetRecord GAMS.GAMSSet.LastRecord ( params string []  slice)
inline

Retrieve a slice of the last record of GAMSSet

Parameters
sliceDefine filter for elements whose record should be retrieved
Returns
Reference to record

◆ MergeRecord()

new GAMSSetRecord GAMS.GAMSSet.MergeRecord ( params string []  keys)
inline

Finds record in GAMSSet if it exists, adds it if not

Parameters
keysList of keys
Returns
Reference to added record