Modeling by Nonzeros

The last of the three functions for building the model is populateByNonzero(). In this function we create the variables with only their bounds, and the empty constraints, that is, ranged constraints only with lower and upper bound but with no expression. Only after that do we construct the expressions, in a manner similar to the ones already described, using these existing variables and install them in the existing constraints with the method IloRange.setExpr().


Previous Page: Modeling by Columns  Return to Top Next Page: Complete Code of LPex1.java