getact
PurposeReturns the value of a general constraint or of a general expressionSynopsisfunction getact(c:genctr | g:gexp) :real
Arguments
c a general constraint (genctr) g a general expression (gexp)Return valueFor 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.ExampleThe 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 informationBecause 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
If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.