CPXXgetcallbacknodeobjval and CPXgetcallbacknodeobjval

The routine CPXXgetcallbacknodeobjval/CPXgetcallbacknodeobjval retrieves the objective value for the subproblem at the current node during MIP optimization from within a user-written callback.

int  CPXXgetcallbacknodeobjval( CPXCENVptr env, void * cbdata, int wherefrom, double * objval_p )

int  CPXgetcallbacknodeobjval( CPXCENVptr env, void * cbdata, int wherefrom, double * objval_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.

The routine CPXXgetcallbacknodeobjval/CPXgetcallbacknodeobjval retrieves the objective value for the subproblem at the current node during MIP optimization from within a user-written callback.

This routine can be called with any value of wherefrom except CPX_CALLBACK_MIP_DELETENODE.

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. Do not call this routine with wherefrom==CPX_CALLBACK_MIP_DELETENODE.
objval_p
A pointer to a variable of type double where the objective value of the node subproblem is to be stored.

Return

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

Example


 status = CPXgetcallbacknodeobjval (env, cbdata, wherefrom,
                                    &objval);

See also admipex1.c and admipex3.c in the standard distribution.

The value returned in the arguments is the objective value for a valid relaxation of the current node problem. As such, it provides a valid dual bound for the subtree defined by the current node in the search tree. For mixed integer quadratically constrained programs (MIQCP), when the outer approximation algorithm is used, this objective value is not necessarily identical to the value calculated as c*x+1/2*x^T*Q*x, with x being the vector returned by CPXXgetcallbacknodex/CPXgetcallbacknodex. See CPXXgetcallbacknodex/CPXgetcallbacknodex for further details.