NO FRAMES

CPXgetlpcallbackfunc

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

The routine CPXgetlpcallbackfunc is used to access the user-written callback routine to be called after each iteration during the optimization of a linear or quadratic program, and also periodically during the CPLEX presolve algorithm.

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 LP 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 
1CPX_CALLBACK_PRIMALFrom primal simplex 
2CPX_CALLBACK_DUALFrom dual simplex 
4CPX_CALLBACK_PRIMAL_CROSSOVERFrom primal crossover 
5CPX_CALLBACK_DUAL_CROSSOVERFrom dual crossover 
6CPX_CALLBACK_BARRIERFrom barrier 
7CPX_CALLBACK_PRESOLVEFrom presolve 
8CPX_CALLBACK_QPBARRIERFrom QP barrier 
9CPX_CALLBACK_QPSIMPLEXFrom QP simplex 

cbhandle

Pointer to user private data, as passed to CPXsetlpcallbackfunc.

Parameters

env

A pointer to the CPLEX environment as returned by CPXopenCPLEX.

callback_p

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 user's private pointer.

Example

 status = CPXgetlpcallbackfunc (env, mycallback, NULL);

See Also:

Returns:

The routine returns zero on success and nonzero if an error occurs.