VariableType Class Reference
GAMS Variable Types. More...
GAMS Variable Types.
This class holds the possible GAMS variable types similar to an enumeration class. Note that it is not an enumeration class due to compatibility (e.g. for Octave).
- See also
- Variable
Static Public Member Functions | |
static function | int2str (in value_int) |
Converts a variable type identifier to string. | |
static function | str2int (in value_str) |
Converts a variable type name to an identifier. | |
static function | isValid (in value) |
Checks if a variable type name or identifier is valid. | |
Member Function Documentation
◆ int2str()
|
static |
Converts a variable type identifier to string.
s = VariableType.int2str(i)
returns a string with the variable type name for the given variable type identifieri
. Ifi
is an invalid identifier, this function raises an error.
Example:
static function int2str(in value_int)
Converts a variable type identifier to string.
Constant Property BINARY
identifier for binary variable
Definition: VariableType.m:56
s
equals "binary"
◆ isValid()
|
static |
Checks if a variable type name or identifier is valid.
b = VariableType.isValid(s)
returnstrue
ifs
is a valid variable type name or variable type identifier andfalse
otherwise.
Example:
static function isValid(in value)
Checks if a variable type name or identifier is valid.
◆ str2int()
|
static |
Converts a variable type name to an identifier.
i = VariableType.str2int(s)
returns an integer identifier for the given variable type names
. Ifs
is an invalid type name, this function raises an error.
Example:
static function str2int(in value_str)
Converts a variable type name to an identifier.
i
equals VariableType.BINARY