CPXXcallbacksetuserhandle and CPXcallbacksetuserhandle

The routine CPXXcallbacksetuserhandle/CPXcallbacksetuserhandle sets the user handle at the current node and optionally returns the old user handle stored at the current node.

int  CPXXcallbacksetuserhandle( CPXCENVptr env, void * cbdata, int wherefrom, void * userhandle, void ** olduserhandle_p )

int  CPXcallbacksetuserhandle( CPXCENVptr env, void * cbdata, int wherefrom, void * userhandle, void ** olduserhandle_p )

Description

Warning:

This is an advanced routine. Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead.

Tip:

Although the name of this routine matches the naming pattern of the generic callback, you must not use this routine with that generic callback. Use this routine only with legacy callbacks.

The routine CPXXcallbacksetuserhandle/CPXcallbacksetuserhandle sets the user handle at the current node and optionally returns the old user handle stored at the current node. Invoke this routine only from a legacy callback and only from callbacks that have a node context.

Arguments

env
A pointer to the CPLEX environment, as returned by CPXXopenCPLEX/CPXopenCPLEX.
cbdata
The pointer passed to the user-written callback. This argument must be the value of cbdata passed to the user-written callback.
wherefrom
An integer value reporting from where the user-written callback was called. The argument must be the value of wherefrom passed to the user-written callback.
userhandle
The new user handle for the current node.
olduserhandle_p
If this argument is not NULL, then CPLEX stores here the old user handle of the current node.

Return

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