GAMS Dictionary Object (DCT) Documentation

Generated for GAMS ..

Functions, Procedures, and Properties

 

Statistics

Integer dctNRows
 Number of rows
 
Integer dctNCols
 Number of columns
 
Integer dctLrgDim
 Largest dimension of any symbol
 

Dictionary

Integer dctUelIndex
 Return UEL index of uelLabel in [1..numUels], 0 on failure
 
Integer dctUelLabel
 Get UEL label associated with index: return 0 on success, 1 otherwise
 
Integer dctSymDim
 Return dimension of specified symbol, -1 on failure
 
Integer dctSymIndex
 Return index of symbol name in [1..numSyms], <=0 on failure
 
Integer dctSymName
 Get symbol name associated with index: return 0 on success, 1 otherwise
 
Integer dctSymText
 Get symbol text and quote character associated with index: return 0 on success, 1 otherwise
 
Integer dctSymType
 Return the symbol type associated with index, or -1 on failure
 
Integer dctSymUserInfo
 Return the symbol userinfo (used for the variable or equation subtype), or -1 on failure
 
Integer dctSymEntries
 Return the number of records stored for the specified symbol, or -1 on failure
 
Integer dctSymOffset
 First row or column number for a symbol (0-based), -1 on failure
 
Integer dctSymDomNames
 Get the relaxed domain names - as strings - for the specified symbol: return 0 on success, 1 otherwise
 
Integer dctSymDomIdx
 Get the relaxed domain names - as 1-based indices - for the specified symbol: return 0 on success, 1 otherwise
 
Integer dctDomNameCount
 Return the count of domain names used in the dictionary
 
Integer dctDomName
 Get the domain name string that goes with the specified index: return 0 on success, nonzero otherwise
 
Integer dctColIndex
 Return the column index (0-based) corresponding to the specified symbol index and UEL indices, or -1 on failure
 
Integer dctRowIndex
 Return the row index (0-based) corresponding to the specified symbol index and UEL indices, or -1 on failure
 
Integer dctColUels
 Get the symbol index and dimension and the UEL indices for column j (0-based): return 0 on success, 1 otherwise
 
Integer dctRowUels
 Get the symbol index and dimension and the UEL indices for row i,(0-based): return 0 on success, 1 otherwise
 
Pointer dctFindFirstRowCol
 Find first row/column for the specified symbol matching the uelIndices (uelIndices[k] = 0 is wildcard): return handle on success, nil otherwise. Since the routine can fail you should first check rcIndex and then the returned handle.
 
Integer dctFindNextRowCol
 Find next row/column in the search defined by findHandle (see dctFindFirstRowCol): return 1 on success, 0 on failure
 
void dctFindClose
 Close the findHandle obtained from dctFindFirstRowCol
 

Dictionary file

Integer dctLoadEx
 Read data from dictionary file specified by fName
 
Integer dctLoadWithHandle
 Read data from given open GDX object
 
void dctWriteGDX
 Write dictionary file in GDX format
 
void dctWriteGDXWithHandle
 Write dictionary to an open GDX object
 

Fill dictionary

void dctSetBasicCounts
 Initialization
 
Boolean dctSetBasicCountsEx
 Initialization
 
void dctAddUel
 Add UEL
 
void dctAddSymbol
 Add symbol
 
void dctAddSymbolData
 Add symbol data
 
Boolean dctAddSymbolDoms
 Add symbol domains
 

Statistics

Integer dctNUels
 Number of UELs in dictionary
 
Integer dctNLSyms
 Return number of symbols (variables and equations only)
 
Double dctMemUsed
 Memory used by the object in MB (1,000,000 bytes)
 

Enumerated Constants

 
dcttypes dctunknownSymType  = 0
  dctfuncSymType  = 1
  dctsetSymType  = 2
  dctacrSymType  = 3
  dctparmSymType  = 4
  dctvarSymType  = 5
  dcteqnSymType  = 6
  dctaliasSymType  = 127
 

Definitions

dctLrgDim 

Largest dimension of any symbol

Type
Property of type Integer
Action
read

dctNCols 

Number of columns

Type
Property of type Integer
Action
read

dctNRows 

Number of rows

Type
Property of type Integer
Action
read

dctAddSymbol 

Add symbol

Type
Procedure
Parameters
  const  ShortString    symName
     Name of symbol
   Integer    symTyp
     type of symbol (see enumerated constants)
   Integer    symDim
     Dimension of symbol
   Integer    userInfo
  const  ShortString    symTxt
     Explanator text of symbol

dctAddSymbolData 

Add symbol data

Type
Procedure
Parameters
  const  TgdxUELIndex    uelIndices
     Indices of unique element

dctAddSymbolDoms 

Add symbol domains

Type
Function returns Boolean
Parameters
  const  ShortString    symName
     Name of symbol
  const  TgdxStrIndex    symDoms
   Integer    symDim
     Dimension of symbol
  out  ShortString    Msg
     Message

dctAddUel 

Add UEL

Type
Procedure
Parameters
  const  ShortString    uelLabel
     Label of unique element
   AnsiChar    q
     Quote character

dctColIndex 

Return the column index (0-based) corresponding to the specified symbol index and UEL indices, or -1 on failure

Type
Function returns Integer
Parameters
   Integer    symIndex
     Index of symbol
  const  TgdxUELIndex    uelIndices
     Indices of unique element

dctColUels 

Get the symbol index and dimension and the UEL indices for column j (0-based): return 0 on success, 1 otherwise

Type
Function returns Integer
Parameters
   Integer    j
     Col index
  out  Integer    symIndex
     Index of symbol
  var  TgdxUELIndex    uelIndices
     Indices of unique element
  out  Integer    symDim
     Dimension of symbol

dctDomName 

Get the domain name string that goes with the specified index: return 0 on success, nonzero otherwise

Type
Function returns Integer
Parameters
   Integer    domIndex
  out  ShortString    domName

dctDomNameCount 

Return the count of domain names used in the dictionary

Type
Function returns Integer

dctFindClose 

Close the findHandle obtained from dctFindFirstRowCol

Type
Procedure
Parameters
   Pointer    findHandle
     Handle obtained when starting to search. Can be used to further search and terminate search

dctFindFirstRowCol 

Find first row/column for the specified symbol matching the uelIndices (uelIndices[k] = 0 is wildcard): return handle on success, nil otherwise. Since the routine can fail you should first check rcIndex and then the returned handle.

Type
Function returns Pointer
Parameters
   Integer    symIndex
     Index of symbol
  const  TgdxUELIndex    uelIndices
     Indices of unique element
  out  Integer    rcIndex
     Row or column index

dctFindNextRowCol 

Find next row/column in the search defined by findHandle (see dctFindFirstRowCol): return 1 on success, 0 on failure

Type
Function returns Integer
Parameters
   Pointer    findHandle
     Handle obtained when starting to search. Can be used to further search and terminate search
  out  Integer    rcIndex
     Row or column index

dctLoadEx 

Read data from dictionary file specified by fName

Type
Function returns Integer
Parameters
  const  ShortString    fName
     Name of file
  out  ShortString    Msg
     Message

dctLoadWithHandle 

Read data from given open GDX object

Type
Function returns Integer
Parameters
   Pointer    gdxptr
     GDX handle
  out  ShortString    Msg
     Message

dctMemUsed 

Memory used by the object in MB (1,000,000 bytes)

Type
Function returns Double

dctNLSyms 

Return number of symbols (variables and equations only)

Type
Function returns Integer

dctNUels 

Number of UELs in dictionary

Type
Function returns Integer

dctRowIndex 

Return the row index (0-based) corresponding to the specified symbol index and UEL indices, or -1 on failure

Type
Function returns Integer
Parameters
   Integer    symIndex
     Index of symbol
  const  TgdxUELIndex    uelIndices
     Indices of unique element

dctRowUels 

Get the symbol index and dimension and the UEL indices for row i,(0-based): return 0 on success, 1 otherwise

Type
Function returns Integer
Parameters
   Integer    i
     Row index
  out  Integer    symIndex
     Index of symbol
  var  TgdxUELIndex    uelIndices
     Indices of unique element
  out  Integer    symDim
     Dimension of symbol

dctSetBasicCounts 

Initialization

Type
Procedure
Parameters
   Integer    NRows
     Number of rows
   Integer    NCols
     Number of columns
   Integer    NBlocks
     Number of UELs in all equations and variables (dim*nrrec per symbol)

dctSetBasicCountsEx 

Initialization

Type
Function returns Boolean
Parameters
   Integer    NRows
     Number of rows
   Integer    NCols
     Number of columns
   Int64    NBlocks
     Number of UELs in all equations and variables (dim*nrrec per symbol)
  out  ShortString    Msg
     Message

dctSymDim 

Return dimension of specified symbol, -1 on failure

Type
Function returns Integer
Parameters
   Integer    symIndex
     Index of symbol

dctSymDomIdx 

Get the relaxed domain names - as 1-based indices - for the specified symbol: return 0 on success, 1 otherwise

Type
Function returns Integer
Parameters
   Integer    symIndex
     Index of symbol
  var  TgdxUELIndex    symDomIdx
  out  Integer    symDim
     Dimension of symbol

dctSymDomNames 

Get the relaxed domain names - as strings - for the specified symbol: return 0 on success, 1 otherwise

Type
Function returns Integer
Parameters
   Integer    symIndex
     Index of symbol
  out  TgdxStrIndex    symDoms
  out  Integer    symDim
     Dimension of symbol

dctSymEntries 

Return the number of records stored for the specified symbol, or -1 on failure

Type
Function returns Integer
Parameters
   Integer    symIndex
     Index of symbol

dctSymIndex 

Return index of symbol name in [1..numSyms], <=0 on failure

Type
Function returns Integer
Parameters
  const  ShortString    symName
     Name of symbol

dctSymName 

Get symbol name associated with index: return 0 on success, 1 otherwise

Type
Function returns Integer
Parameters
   Integer    symIndex
     Index of symbol
  out  ShortString    symName
     Name of symbol

dctSymOffset 

First row or column number for a symbol (0-based), -1 on failure

Type
Function returns Integer
Parameters
   Integer    symIndex
     Index of symbol

dctSymText 

Get symbol text and quote character associated with index: return 0 on success, 1 otherwise

Type
Function returns Integer
Parameters
   Integer    symIndex
     Index of symbol
  var  AnsiChar    q
     Quote character
  out  ShortString    symTxt
     Explanator text of symbol

dctSymType 

Return the symbol type associated with index, or -1 on failure

Type
Function returns Integer
Parameters
   Integer    symIndex
     Index of symbol

dctSymUserInfo 

Return the symbol userinfo (used for the variable or equation subtype), or -1 on failure

Type
Function returns Integer
Parameters
   Integer    symIndex
     Index of symbol

dctUelIndex 

Return UEL index of uelLabel in [1..numUels], 0 on failure

Type
Function returns Integer
Parameters
  const  ShortString    uelLabel
     Label of unique element

dctUelLabel 

Get UEL label associated with index: return 0 on success, 1 otherwise

Type
Function returns Integer
Parameters
   Integer    uelIndex
     Index of unique element
  var  AnsiChar    q
     Quote character
  out  ShortString    uelLabel
     Label of unique element

dctWriteGDX 

Write dictionary file in GDX format

Type
Procedure
Parameters
  const  ShortString    fName
     Name of file
  out  ShortString    Msg
     Message

dctWriteGDXWithHandle 

Write dictionary to an open GDX object

Type
Procedure
Parameters
   Pointer    gdxptr
     GDX handle
  out  ShortString    Msg
     Message