ILOG CPLEX 11.0 User's Manual > Languages and APIs > ILOG CPLEX Callable Library > ILOG CPLEX Programming Practices > Checking Problem Data

If you inadvertently make an error entering problem data, the problem object will not correspond to your intentions. One possible result may be a segmentation fault or other disruption of your application. In other cases, ILOG CPLEX may solve a different model from the one you intended, and that situation may or may not result in error messages from ILOG CPLEX.

Using the Data Checking Parameter

To help you detect this kind of error, you can set the parameter CPX_PARAM_DATACHECK (int) to the value CPX_ON to activate additional checking of array arguments for CPXcopyData, CPXreadData, and CPXchgData routines (where Data varies). The additional checks include:

This additional checking may entail overhead (time and memory). When the parameter is set to CPX_OFF, only simple checks, for example checking for the existence of the environment, are performed.

Using Diagnostic Routines for Debugging

ILOG CPLEX also provides diagnostic routines to look for common errors in the definition of problem data. In the standard distribution of ILOG CPLEX, the file check.c contains the source code for these routines:

Each of those routines performs a series of diagnostic tests of the problem data and issues warnings or error messages whenever it detects a potential error. To use them, you must compile and link the file check.c. After compiling and linking that file, you will be able to step through the source code of these routines with a debugger to help isolate problems.

If you have observed anomalies in your application, you can exploit this diagnostic capability by calling the appropriate routines just before a change or copy routine. The diagnostic routine may then detect errors in the problem data that could subsequently cause inexplicable behavior.

Those checking routines send all messages to one of the standard ILOG CPLEX message channels. You capture that output by setting the parameter CPX_PARAM_SCRIND (if you want messages directed to your screen) or by calling the routine CPXsetlogfile.