GAMS Equation Types. More...

GAMS Equation Types.

This class holds the possible GAMS equation types similar to an enumeration class. Note that it is not an enumeration class due to compatibility (e.g. for Octave).

See also
Equation

Static Public Member Functions

static function int2str (in value_int)
 Converts an equation type identifier to string. More...
 
static function str2int (in value_str)
 Converts an equation type name to an identifier. More...
 
static function isValid (in value)
 Checks if an equation type name or identifier is valid. More...
 

Public Attributes

Constant Property EQ = 0
 identifier for equality equation
 
Constant Property GEQ = 1
 identifier for greater-than inequality equation
 
Constant Property LEQ = 2
 identifier for less-than inequality equation
 
Constant Property NONBINDING = 3
 identifier for nonbinding equation
 
Constant Property EXTERNAL = 4
 identifier for external equation
 
Constant Property CONE = 5
 identifier for cone equation
 
Constant Property BOOLEAN = 6
 identifier for boolean equation
 

Member Function Documentation

◆ int2str()

static function int2str ( in  value_int)
static

Converts an equation type identifier to string.

  • s = EquationType.int2str(i) returns a string with the equation type name for the given equation type identifier i. If i is an invalid identifier, this function raises an error.

Example:

s = EquationType.int2str(EquationType.EQ)

s equals "eq"

◆ isValid()

static function isValid ( in  value)
static

Checks if an equation type name or identifier is valid.

  • b = EquationType.isValid(s) returns true if s is a valid equation type name or equation type identifier and false otherwise.

Example:

EquationType.isValid('eq') % is true
EquationType.isValid(EquationType.EQ) % is true
EquationType.isValid('not_a_valid_name') % is false

◆ str2int()

static function str2int ( in  value_str)
static

Converts an equation type name to an identifier.

  • i = EquationType.str2int(s) returns an integer identifier for the given equation type name s. If s is an invalid type name, this function raises an error.

Example:

i1 = EquationType.str2int('eq')
i2 = EquationType.str2int('e')

i1 and i2 equal EquationType.EQ