ILOG CPLEX 11.0 User's Manual > Languages and APIs > ILOG Concert Technology for C++ Users > Example: Optimizing the Diet Problem in C++ > Solving the Model with IloCplex |
Solving the Model with IloCplex |
INDEX PREVIOUS NEXT |
After the model has been populated, it is time to create the cplex
object and extract the model to it by calling:
It is then ready to solve the model, but for demonstration purposes the extracted model will first be written to the file diet.lp
. Doing so can help you debug your model, as the file contains exactly what ILOG CPLEX sees. If it does not match what you expected, it will probably help you locate the code that generated the wrong part.
The model is then solved by calling method solve
. Finally, the solution status and solution vector are output to the output channel cplex.out
. By default this channel is initialized to cout
. All logging during optimization is also output to this channel. To turn off logging, you would set the out
stream of cplex
to a null stream by calling cplex.setOut(env.getNullStream())
.
Copyright © 1987-2007 ILOG S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |