NO FRAMES

CPXgetnetcallbackfunc

int CPXPUBLIC CPXgetnetcallbackfunc(CPXCENVptr env, int(CPXPUBLIC **callback_p)(CPXCENVptr, void *, int, void *) , void ** cbhandle_p)
Definition file: cplex.h

The CPXgetnetcallbackfunc is used to access the user-written callback routine to be called each time a log message is issued during the optimization of a network problem. If the display log is turned off, the callback routine is still called.

This routine works in the same way as the routine CPXgetlpcallbackfunc. It enables the user to create a separate callback function to be called during the solution of a network problem. The prototype for the callback function is identical to that of CPXgetlpcallbackfunc.

Callback description

 int callback (CPXENVptr env,
               void      *cbdata,
               int       wherefrom,
               void      *cbhandle);
 

This is the user-written callback routine.

Callback return value

A nonzero terminates the optimization.

Callback arguments

env

A pointer to the CPLEX environment that was passed into the associated optimization routine.

cbdata

A pointer passed from the optimization routine to the user-written callback function that identifies the problem being optimized. The only purpose for the cbdata pointer is to pass it to the routine CPXgetcallbackinfo.

wherefrom

An integer value indicating which optimization algorithm the user-written callback function was called from. Possible values and their meaning appear in the table.

Value Symbolic Constant Meaning 
3CPX_CALLBACK_NETWORKFrom network simplex 

cbhandle

Pointer to user private data, as passed to CPXsetlpcallbackfunc.

Parameters

env

A pointer to the CPLEX environment as returned by CPXopenCPLEX.

callback

The address of the pointer to the current user-written callback function. If no callback function has been set, the pointer evaluates to NULL.

cbhandle_p

The address of a variable to hold the private pointer of the user.

Example

 status = CPXgetnetcallbackfunc (env, mycallback, NULL);
 

See Also:

Returns:

A nonzero terminates the optimization.