12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example: Using Query Routines lpex7.cThis example uses the <strong>ILOG</strong> <strong>CPLEX</strong> Callable Library query routine CPXgetcolname to getthe column names from a problem object. To do so, it applies the programming pattern justoutlined in Using Surplus Arguments for Array Allocations on page 128. It derives from theexample lpex2.c from the <strong>ILOG</strong> <strong>CPLEX</strong> Getting Started manual. This query-routineexample differs from that simpler example in several ways:◆The example calls CPXgetcolname twice after optimization: the first call discovers howmuch space to allocate to hold the names; the second call gets the names and stores themin the arrays cur_colname and cur_colnamestore.◆ When the example prints its answer, it uses the names as stored in cur_colname. If nonames exist there, the example creates generic names.This example assumes that the current problem has been read from a file byCPXreadcopyprob. You can adapt the example to use other <strong>ILOG</strong> <strong>CPLEX</strong> query routinesto get information about any problem read from a file.The complete program lpex7.c appears online in the standard distribution atyour<strong>CPLEX</strong>installation/examples/src.130 <strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!