CPXXsettuningcallbackfunc and CPXsettuningcallbackfunc

Modifies the user-written legacy callback function to be called before each trial run during the tuning process.

int  CPXXsettuningcallbackfunc( CPXENVptr env, int(CPXPUBLIC *callback)(CPXCENVptr, void *, int, void *), void * cbhandle )

int  CPXsettuningcallbackfunc( CPXENVptr env, int(CPXPUBLIC *callback)(CPXCENVptr, void *, int, void *), void * cbhandle )

Description

The routine CPXXsettuningcallbackfunc/CPXsettuningcallbackfunc modifies the user-written legacy callback function to be called before each trial run during the tuning process.

Tip:

This routine is part of legacy callbacks. Do not use this routine with a generic callback in your application. For more about generic callbacks, see the topic Generic callbacks in the CPLEX User's Manual.

Callback description


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

This is the user-written callback routine.

Callback return value

A nonzero terminates the tuning.

Callback arguments

env

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

cbdata

A pointer passed from the tuning routine to the user-written callback function that contains information about the tuning process. The only purpose for the cbdata pointer is to pass it to the routine CPXXgetcallbackinfo/CPXgetcallbackinfo.

wherefrom

An integer value specifying from which procedure the user-written callback function was called. This value will always be CPX_CALLBACK_TUNING for this callback.

cbhandle

Pointer to user private data, as passed to CPXXsettuningcallbackfunc/CPXsettuningcallbackfunc.

Arguments

env

A pointer to the CPLEX environment as returned by CPXXopenCPLEX/CPXopenCPLEX.

callback

A pointer to a user-written callback function. Setting callback to NULL prevents any callback function from being called during tuning. The call to callback occurs before each trial run of the tuning. This function is written by the user; its prototype is documented here.

cbhandle

A pointer to user private data. This pointer is passed to the callback function.

Return

The routine returns 0 (zero) if successful and nonzero if an error occurs.

Example


status = CPXsettuningcallbackfunc (env, myfunc, NULL);