Originally posted by: SystemAdmin
To get the values of variables, use IloCplex::getValue or IloCplex::getValues.
To get the value of the expression in a constraint, I would probably use IloCplex::getSlack or IloCplex::getSlacks (and then use the difference between the slack and the upper limit of the constraint to get the value.
Although I've never tried it, I
think you can use IloCplex::getValue to get the value of any IloNumExpr instance (including the expression in a constraint), since IloNumExpr is a subclass of IloNumExprArg and there's a version of getValue that takes an IloNumExprArg argument. There does not seem to be an array version (getValues), though, so to get values for an array of expressions you'd presumably have to loop through the array.
Paul
Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
#CPLEXOptimizers#DecisionOptimization