Overview
The sample ilolpex2.cpp reads
a model from a file, solves the problem with a specified optimizer,
prints the basis, and accesses quality information about the solution.
This example shows how to read an optimization problem from a file and solve it with a specified optimizer. It prints solution information, including a simplex basis, if available. Finally, the application prints the maximum infeasibility of any variable of the solution.
The file to read and the optimizer choice are passed to the program via command line arguments. For example, this command:
ilolpex2 example.mps d
reads the file example.mps and
solves the problem with the dual simplex optimizer.
Example ilolpex2 demonstrates:
The general structure of this example is the same as
for example ilolpex1.cpp . It starts by
creating the environment and terminates with destroying it by calling
the end method. The code in between is
enclosed in try/catch statements for error
handling.
You can view the complete program online in the standard
distribution of the product at yourCPLEXinstallation /examples/src/ilolpex2.cpp .