DCT (DCT) API Documentation

Generated for GAMS 32.2.0

Functions, Procedures and Properties

Statistics

dctNRows
Number of rows
dctNCols
Number of columns
dctLrgDim
Largest dimension of any symbol
dctNUels
Number of UELs in dictionary
dctNLSyms
Return number of symbols (variables and equations only)
dctMemUsed
Memory used by the object in MB (1,000,000 bytes)

Dictionary

dctUelIndex
Return UEL index of uelLabel in [1..numUels], 0 on failure
dctUelLabel
Get UEL label associated with index: return 0 on success, 1 otherwise
dctSymDim
Return dimension of specified symbol, -1 on failure
dctSymIndex
Return index of symbol name in [1..numSyms], <=0 on failure
dctSymName
Get symbol name associated with index: return 0 on success, 1 otherwise
dctSymText
Get symbol text and quote character associated with index: return 0 on success, 1 otherwise
dctSymType
Return the symbol type associated with index, or -1 on failure
dctSymUserInfo
Return the symbol userinfo (used for the variable or equation subtype), or -1 on failure
dctSymEntries
Return the number of records stored for the specified symbol, or -1 on failure
dctSymOffset
First row or column number for a symbol (0-based), -1 on failure
dctSymDomNames
Get the relaxed domain names - as strings - for the specified symbol: return 0 on success, 1 otherwise
dctSymDomIdx
Get the relaxed domain names - as 1-based indices - for the specified symbol: return 0 on success, 1 otherwise
dctDomNameCount
Return the count of domain names used in the dictionary
dctDomName
Get the domain name string that goes with the specified index: return 0 on success, nonzero otherwise
dctColIndex
Return the column index (0-based) corresponding to the specified symbol index and UEL indices, or -1 on failure
dctRowIndex
Return the row index (0-based) corresponding to the specified symbol index and UEL indices, or -1 on failure
dctColUels
Get the symbol index and dimension and the UEL indices for column j (0-based): return 0 on success, 1 otherwise
dctRowUels
Get the symbol index and dimension and the UEL indices for row i,(0-based): return 0 on success, 1 otherwise
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.
dctFindNextRowCol
Find next row/column in the search defined by findHandle (see dctFindFirstRowCol): return 1 on success, 0 on failure
dctFindClose
Close the findHandle obtained from dctFindFirstRowCol

Dictionary file

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

Fill dictionary

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

Arguments

findHandle
Handle obtained when starting to search. Can be used to further search and terminate search
fName
Name of file
gdxptr
GDX handle
i
Row index
j
Col index
Msg
Message
NBlocks
Number of blocks of equations and variables
NCols
Number of columns
NRows
Number of rows
q
Quote character
rcIndex
Row or column index
result
Result/Return code of function
symDim
Dimension of symbol
symIndex
Index of symbol
symName
Name of symbol
symTxt
Explanator text of symbol
symTyp
Type of symbol (see enumerated constants)
uelIndex
Index of unique element
uelIndices
Indices of unique element
uelLabel
Label of unique element

Calling Sequences

dctAddSymbol

  • Add symbol
  • Procedure
  • Arguments:
    • const symName : ShortString
      Name of symbol
      symTyp : Integer
      Type of symbol (see enumerated constants)
      symDim : Integer
      Dimension of symbol
      userInfo : Integer
      const symTxt : ShortString
      Explanator text of symbol

dctAddSymbolData

  • Add symbol data
  • Procedure
  • Arguments:
    • const uelIndices: TgdxUELIndex
      Indices of unique element

dctAddSymbolDoms

  • Add symbol domains
  • Function returns Boolean
  • Arguments:
    • const symName : ShortString
      Name of symbol
      const symDoms : TgdxStrIndex
      symDim : Integer
      Dimension of symbol
      out Msg : ShortString
      Message

dctAddUel

  • Add UEL
  • Procedure
  • Arguments:
    • const uelLabel : ShortString
      Label of unique element
      q : AnsiChar
      Quote character

dctColIndex

  • Return the column index (0-based) corresponding to the specified symbol index and UEL indices, or -1 on failure
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol
      const uelIndices: TgdxUELIndex
      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
  • Function returns Integer
  • Arguments:
    • j : Integer
      Col index
      out symIndex : Integer
      Index of symbol
      var uelIndices: TgdxUELIndex
      Indices of unique element
      out symDim : Integer
      Dimension of symbol

dctDomName

  • Get the domain name string that goes with the specified index: return 0 on success, nonzero otherwise
  • Function returns Integer
  • Arguments:
    • domIndex : Integer
      out domName : ShortString

dctDomNameCount

  • Return the count of domain names used in the dictionary
  • Function returns Integer

dctFindClose

  • Close the findHandle obtained from dctFindFirstRowCol
  • Procedure
  • Arguments:
    • findHandle: Pointer
      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.
  • Function returns Pointer
  • Arguments:
    • symIndex : Integer
      Index of symbol
      const uelIndices: TgdxUELIndex
      Indices of unique element
      out rcIndex : Integer
      Row or column index

dctFindNextRowCol

  • Find next row/column in the search defined by findHandle (see dctFindFirstRowCol): return 1 on success, 0 on failure
  • Function returns Integer
  • Arguments:
    • findHandle: Pointer
      Handle obtained when starting to search. Can be used to further search and terminate search
      out rcIndex : Integer
      Row or column index

dctLoadEx

  • Read data from dictionary file specified by fName
  • Function returns Integer
  • Arguments:
    • const fName : ShortString
      Name of file
      out Msg : ShortString
      Message

dctLoadWithHandle

  • Read data from given open GDX object
  • Function returns Integer
  • Arguments:
    • gdxptr : Pointer
      GDX handle
      out Msg : ShortString
      Message

dctLrgDim

  • Largest dimension of any symbol
  • Property of type Integer
  • Actions
    • r

dctMemUsed

  • Memory used by the object in MB (1,000,000 bytes)
  • Function returns Double

dctNCols

  • Number of columns
  • Property of type Integer
  • Actions
    • r

dctNLSyms

  • Return number of symbols (variables and equations only)
  • Function returns Integer

dctNRows

  • Number of rows
  • Property of type Integer
  • Actions
    • r

dctNUels

  • Number of UELs in dictionary
  • Function returns Integer

dctRowIndex

  • Return the row index (0-based) corresponding to the specified symbol index and UEL indices, or -1 on failure
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol
      const uelIndices: TgdxUELIndex
      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
  • Function returns Integer
  • Arguments:
    • i : Integer
      Row index
      out symIndex : Integer
      Index of symbol
      var uelIndices: TgdxUELIndex
      Indices of unique element
      out symDim : Integer
      Dimension of symbol

dctSetBasicCounts

  • Initialization
  • Procedure
  • Arguments:
    • NRows : Integer
      Number of rows
      NCols : Integer
      Number of columns
      NBlocks : Integer
      Number of blocks of equations and variables

dctSetBasicCountsEx

  • Initialization
  • Function returns Boolean
  • Arguments:
    • NRows : Integer
      Number of rows
      NCols : Integer
      Number of columns
      NBlocks : Int64
      Number of blocks of equations and variables
      out Msg : ShortString
      Message

dctSymDim

  • Return dimension of specified symbol, -1 on failure
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol

dctSymDomIdx

  • Get the relaxed domain names - as 1-based indices - for the specified symbol: return 0 on success, 1 otherwise
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol
      var symDomIdx : TgdxUELIndex
      out symDim : Integer
      Dimension of symbol

dctSymDomNames

  • Get the relaxed domain names - as strings - for the specified symbol: return 0 on success, 1 otherwise
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol
      out symDoms : TgdxStrIndex
      out symDim : Integer
      Dimension of symbol

dctSymEntries

  • Return the number of records stored for the specified symbol, or -1 on failure
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol

dctSymIndex

  • Return index of symbol name in [1..numSyms], <=0 on failure
  • Function returns Integer
  • Arguments:
    • const symName : ShortString
      Name of symbol

dctSymName

  • Get symbol name associated with index: return 0 on success, 1 otherwise
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol
      out symName : ShortString
      Name of symbol

dctSymOffset

  • First row or column number for a symbol (0-based), -1 on failure
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol

dctSymText

  • Get symbol text and quote character associated with index: return 0 on success, 1 otherwise
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol
      var q : AnsiChar
      Quote character
      out symTxt : ShortString
      Explanator text of symbol

dctSymType

  • Return the symbol type associated with index, or -1 on failure
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol

dctSymUserInfo

  • Return the symbol userinfo (used for the variable or equation subtype), or -1 on failure
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol

dctUelIndex

  • Return UEL index of uelLabel in [1..numUels], 0 on failure
  • Function returns Integer
  • Arguments:
    • const uelLabel : ShortString
      Label of unique element

dctUelLabel

  • Get UEL label associated with index: return 0 on success, 1 otherwise
  • Function returns Integer
  • Arguments:
    • uelIndex : Integer
      Index of unique element
      var q : AnsiChar
      Quote character
      out uelLabel : ShortString
      Label of unique element

dctWriteGDX

  • Write dictionary file in GDX format
  • Procedure
  • Arguments:
    • const fName : ShortString
      Name of file
      out Msg : ShortString
      Message

dctWriteGDXWithHandle

  • Write dictionary to an open GDX object
  • Procedure
  • Arguments:
    • gdxptr : Pointer
      GDX handle
      out Msg : ShortString
      Message

Enumerated Constants

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

Undocumented Arguments

  • domIndex
  • domName
  • symDomIdx
  • symDoms
  • userInfo