GAMS Special Values. More...
GAMS Special Values.
GAMS GDX offers five special values: NA (not available), UNDEF (undefined), EPS (explicit zero, a standard zero is usually not stored in the sparse GDX format), PINF or POSINF (positive infinity) and MINF or NEGINF (negative infinity). All special values can be queried and checked for by using this class. While UNDEF, POSINF and NEGINF have natural counterparts in Matlab (NaN
, Inf
and -Inf
, respectively), NA and EPS do not. The latter two are therefore mapped to a special NaN
and -0
, respectively.
- Example:
- >> a = [0, NaN, SpecialValues.NA, SpecialValues.UNDEF, SpecialValues.EPS, SpecialValues.POSINF, SpecialValues.NEGINF]a =0 NaN NaN NaN 0 Inf -Inf>> SpecialValues.isNA(a)ans =1×7 logical array0 0 1 0 0 0 0>> SpecialValues.isUndef(a)ans =1×7 logical array0 1 0 1 0 0 0>> SpecialValues.isEps(a)ans =1×7 logical array0 0 0 0 1 0 0
Static Public Member Functions | |
static function | isUndef (in value) |
Checks if values are GAMS UNDEF. | |
static function | isNA (in value) |
Checks if values are GAMS NA. | |
static function | isEps (in value) |
Checks if values are GAMS EPS. | |
static function | isPosInf (in value) |
Checks if values are GAMS PINF. | |
static function | isNegInf (in value) |
Checks if values are GAMS MINF. | |
Member Function Documentation
◆ isEps()
|
static |
Checks if values are GAMS EPS.
b = isEps(v)
checks if the valuesv
are GAMS EPS values
Example:
b
equals [0, 0, 1, 0]
◆ isNA()
|
static |
Checks if values are GAMS NA.
b = isNA(v)
checks if the valuesv
are GAMS NA values
Example:
b
equals [0, 0, 1, 0]
◆ isNegInf()
|
static |
Checks if values are GAMS MINF.
b = isNegInf(v)
checks if the valuesv
are GAMS MINF values
Example:
b
equals [0, 0, 0, 1]
◆ isPosInf()
|
static |
Checks if values are GAMS PINF.
b = isPosInf(v)
checks if the valuesv
are GAMS POSINF values
Example:
b
equals [0, 0, 1, 0]
◆ isUndef()
|
static |
Checks if values are GAMS UNDEF.
b = isUndef(v)
checks if the valuesv
are GAMS UNDEF values
Example:
b
equals [0, 0, 0, 1]