Purpose
Return the slack value of a general constraint
Synopsis
function getslack(c:genctr) :real
Argument
Return value
The slack value of the constraint, or zero if the constraint is not part of the
current problem.
Example
The following example solves a problem and retrieves the slack
value of a constraint:
declarations
c1, c2: genctr
x, y: mpvar
end-declarations
x <= 10
y <= 10
c1:= x^2 + y^2 <= 4 - x
c2:= x*y >= 1
SLPloadprob(x+y)
SLPmaximize
writeln("c1 slack value=",getslack(c1))
Further information
This function returns the slack value of the constraint if the problem has been solved
successfully and the constraint is in the problem, or zero otherwise.
Related topics
If you have any comments or suggestions about these pages,
please send mail to docs@dashoptimization.com.