Previous Page: CPXgetlogfileFirst PageNext Page: CPXgetmethod

CPXgetlpcallbackfunc


Description

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

Return Value

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

Synopsis

void CPXgetlpcallbackfunc (CPXENVptr env,
                           int (CPXPUBLIC **callback_p)
                                    (CPXENVptr, void *, int, void *),
                           void **cbhandle_p);

Arguments


CPXENVptr env
The pointer to the CPLEX environment as returned by one of the CPXopenCPLEX routines.

int (CPXPUBLIC **callback_p) (CPXENVptr, void *, int, void *)
The address of the pointer to the current user-written callback function. If no callback function has been set, the pointer will evaluate to NULL.

void **cbhandle_p
The address of a variable to hold the user's private pointer.

Callback

Synopsis

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

Callback

Arguments


CPXENVptr env
The pointer to the CPLEX environment that was passed into the associated optimization routine.

void *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 CPXgetcallbackinfo() routine.

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

Value  
Symbolic Constant  
Meaning  
1  
CPX_CALLBACK_PRIMAL  
From primal simplex  
2  
CPX_CALLBACK_DUAL  
From dual simplex  
3  
CPX_CALLBACK_NETWORK  
From network simplex  
4  
CPX_CALLBACK_PRIMAL_CROSSOVER  
From primal crossover  
5  
CPX_CALLBACK_DUAL_CROSSOVER  
From dual crossover  
6  
CPX_CALLBACK_BARRIER  
From barrier  
7  
CPX_CALLBACK_PRESOLVE  
From presolve  
101  
CPX_CALLBACK_MIP  
From mipopt  
107  
CPX_CALLBACK_MIP_PROBE  
From probing or clique merging  

void *cbhandle
Pointer to user private data, as passed to CPXsetlpcallbackfunc() or CPXsetmipcallbackfunc().

Example

status = CPXgetlpcallbackfunc (env, mycallback, NULL);

See Also

The example in CPXgetcallbackinfo(), as well as example lpex4.c in the CPLEX User's Manual.

Previous Page: CPXgetlogfileFirst PageNext Page: CPXgetmethod