DCT (DCT) API Documentation

Generated for GAMS 24.9.2

Functions, Procedures and Properties

Statistics

dctNRows
Number of rows
dctNCols
Number of columns
dctLrgDim
Largest Dimension of all symbols
dctNUels
Number of UELs (without the ones used by model)
dctNLSyms
Number of symbols (variables and equations only)
dctMemUsed
Memory used by the object in MB

Dictionary

dctUelIndex
UEL index in [1..numUels] of uelLabel, 0 on failure
dctUelLabel
UEL label associated with index, 1 if index is out of range, 0 otherwise
dctSymDim
Dimension of symbol index, -1 on failure
dctSymIndex
Index of symbol name, <=0 if symbol is not in table
dctSymName
Symbol name associated with index
dctSymText
Symbol text and quote character associated with symbol index
dctSymType
Symbol type of a symbol given the symbol index
dctSymUserInfo
Symbol userinfo used for the subtype of variable or equation
dctSymEntries
Number of records stored for a given symbol
dctSymOffset
First row or column number for a symbol, -1 if the symbol index is not valid
dctColIndex
Column index corresponding to the local variable symbol indexed by symIndex and UEL indices given by uelIndices
dctRowIndex
Row index corresponding to the local equation symbol indexed by symIndex and UEL indices given by uelIndices
dctColUels
Symbol index for the variable block containing column j, along with the dimension of this variable and the UEL indices for it
dctRowUels
Symbol index for the equation block containing row i, along with the dimension of this equation and the UEL indices for it
dctFindFirstRowCol
First row/column in the symbol referenced by symIndex that is indexed by the UELs in uelIndices (uelIndices[k] = 0 is wildcard). Since the routine can fail you should first check rcIndex and then the returned handle.
dctFindNextRowCol
Next row/column in the search defined by findHandle; the first search creates the findHandle using dctFindFirstRowCol
dctFindClose
Done with findHandle received from dctFindFirstRowCol

Dictionary file

dctLoadEx
Read data from dictionary file
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
dctAddUel
Add UEL
dctAddSymbol
Add symbol
dctAddSymbolData
Add symbold data

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 or columns
NRows
Number or 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 symbold data
  • Procedure
  • Arguments:
    • const uelIndices: TgdxUELIndex
      Indices of unique element

dctAddUel

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

dctColIndex

  • Column index corresponding to the local variable symbol indexed by symIndex and UEL indices given by uelIndices
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol
      const uelIndices: TgdxUELIndex
      Indices of unique element

dctColUels

  • Symbol index for the variable block containing column j, along with the dimension of this variable and the UEL indices for it
  • 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

dctFindClose

  • Done with findHandle received from dctFindFirstRowCol
  • Procedure
  • Arguments:
    • findHandle: Pointer
      Handle obtained when starting to search. Can be used to further search and terminate search

dctFindFirstRowCol

  • First row/column in the symbol referenced by symIndex that is indexed by the UELs in uelIndices (uelIndices[k] = 0 is wildcard). 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

  • Next row/column in the search defined by findHandle; the first search creates the findHandle using dctFindFirstRowCol
  • 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
  • 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 all symbols
  • Property of type Integer
  • Actions
    • r

dctMemUsed

  • Memory used by the object in MB
  • Function returns Double

dctNCols

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

dctNLSyms

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

dctNRows

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

dctNUels

  • Number of UELs (without the ones used by model)
  • Function returns Integer

dctRowIndex

  • Row index corresponding to the local equation symbol indexed by symIndex and UEL indices given by uelIndices
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol
      const uelIndices: TgdxUELIndex
      Indices of unique element

dctRowUels

  • Symbol index for the equation block containing row i, along with the dimension of this equation and the UEL indices for it
  • 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 or rows
      NCols : Integer
      Number or columns
      NBlocks : Integer
      Number of blocks of equations and variables

dctSymDim

  • Dimension of symbol index, -1 on failure
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol

dctSymEntries

  • Number of records stored for a given symbol
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol

dctSymIndex

  • Index of symbol name, <=0 if symbol is not in table
  • Function returns Integer
  • Arguments:
    • const symName : ShortString
      Name of symbol

dctSymName

  • Symbol name associated with index
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol
      out symName : ShortString
      Name of symbol

dctSymOffset

  • First row or column number for a symbol, -1 if the symbol index is not valid
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol

dctSymText

  • Symbol text and quote character associated with symbol index
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol
      var q : AnsiChar
      Quote character
      out symTxt : ShortString
      Explanator text of symbol

dctSymType

  • Symbol type of a symbol given the symbol index
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol

dctSymUserInfo

  • Symbol userinfo used for the subtype of variable or equation
  • Function returns Integer
  • Arguments:
    • symIndex : Integer
      Index of symbol

dctUelIndex

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

dctUelLabel

  • UEL label associated with index, 1 if index is out of range, 0 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
    • dctunknownSymTy = 0
    • dctfuncSymType = 1
    • dctsetSymType = 2
    • dctacrSymType = 3
    • dctparmSymType = 4
    • dctvarSymType = 5
    • dcteqnSymType = 6
    • dctaliasSymType = 127

Undocumented Arguments

  • userInfo