getact


Purpose
Returns the value of a general constraint or of a general expression
Synopsis
function getact(c:genctr | g:gexp) :real
Arguments
a general constraint (genctr)
a general expression (gexp)
Return value
For a general constraint the left hand side of the constraint or 0;
for a general expression, the evaluation of the expression using the solution values of the variables.
Example
The following example solves a problem containing the two constraints c1 and c2, and then prints the values (left hand sides) of the constraints:
declarations
  c1, c2: genctr
  x, y: mpvar
end-declarations

  c1:= x^2 + y^2 <= 4
  c2:= x*y >= 1
 
  SLPloadprob(x+y)
  SLPmaximize
  writeln("c1=",getact(c1)," c2=",getact(c2))
Further information

Because of limitations in recalculating functions, this facility is only availably for gexps that do not contain function references.

genctrs contained in the problem will always return their left-hand side value.


Related topics
getdual, getslack, getsol


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