ILOG CPLEX 11.0 User's Manual > Continuous Optimization > Solving Problems with a Quadratic Objective (QP) > Example: Reading a QP from a File qpex2.c

This example shows you how to optimize a QP with routines from the ILOG CPLEX Callable Library when the problem data is stored in a file. The example derives from lpex2.c discussed in ILOG CPLEX Getting Started. The Concert forms of this example, iloqpex2.cpp and QPex2.java, are included online in the standard distribution.

Instead of calling CPXlpopt to find a solution as for the linear programming problem in lpeq2.c, this example calls CPXqpopt to optimize this quadratic programming problem.

Like other applications based on the ILOG CPLEX Callable Library, this one begins with calls to CPXopenCPLEX to initialize the ILOG CPLEX environment and to CPXcreateprob to create the problem object. Before it ends, it frees the problem object with a call to CPXfreeprob, and it frees the environment with a call to CPXcloseCPLEX.

The complete program, qpex2.c, appears online in the standard distribution at yourCPLEXinstallation/examples/src.