Example: Reading a QP from a File

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, described in the ILOG CPLEX Getting Started manual. The Concert versions of this example, iloqpex2.cpp and QPex2.java, are included online in the standard distribution.

Instead of calling CPXlpopt() to find a solution as we do for the linear programming problem in lpeq2.c, this time we call CPXqpopt() to optimize this quadratic programming problem.

This example also differs in the available algorithms for solving the problem. QP, barrier with crossover, sifting and concurrent are not available for QP.

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().


Previous Page: Example: QPex1.java  Return to Top Next Page: Complete Program: qpex2.c