gettype


Purpose
Returns the type of a general constraint
Synopsis
function gettype(c:genctr) :integer
Argument
a general constraint
Return value
The type of the constraint. This will be one of:
XPRM_CTYPE_LEQ
Maths/leq.png
XPRM_CTYPE_EQ
=
XPRM_CTYPE_GEQ
Maths/geq.png
XPRM_CTYPE_UNCONS
not constraining or not defined
Example
The following code fragment retrieves the type of a previously-defined constraint:
declarations
  c1, c2: genctr
  x, y: mpvar
end-declarations

  c1:= x^2 + y^2 <= 4 - x
  ...
  case (gettype(c1)) of
    XPRM_CTYPE_LEQ: writeln("c1 is less than or equal")
    XPRM_CTYPE_EQ: writeln("c1 is equal")
    XPRM_CTYPE_GEQ: writeln("c1 is greater than or equal")
    XPRM_CTYPE_UNCONS: writeln("c1 is not constraining")
  end-case
Further information
The problem does not need to be loaded in order to retrieve the type of a constraint.
Related topics
settype


If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.