CPXXcallbackgetrelaxationstatus and CPXcallbackgetrelaxationstatus

Get the solution status for the current node relaxation.

int  CPXXcallbackgetrelaxationstatus( CPXCALLBACKCONTEXTptr context, int *nodelpstat_p, CPXLONG flags )

int  CPXcallbackgetrelaxationstatus( CPXCALLBACKCONTEXTptr context, int *nodelpstat_p, CPXLONG flags )

Description

Queries the solution status of the current node relaxation.

This function obtains the solution status of the continuous relaxation at the current node. This is related to CPXXcallbackgetrelaxationpoint and CPXcallbackgetrelaxationpoint which returns the actual solution values of this relaxation.

The function is intended mainly for use with the CPX_CALLBACKCONTEXT_BRANCHING context. When the callback is invoked in this context then the continuous relaxation may not be solved to optimality for various reasons (for example an iteration limit, an infeasible status, etc.). The function gives the user a chance to catch this and potentially take different actions than one would take in case the relaxation is solve to optimality.

Note that none of this can happen if the callback was invoked in context CPX_CALLBACKCONTEXT_RELAXATION, so in this case you usually don't have to bother with this.

By default (flags=0) the function will make (another) attempt to solve the relaxation to optimality in case the status is currently non-optimal. This can change the search path. The default behavior can be changed by specifying the flag value CPX_RELAXATION_FLAG_NOSOLVE. If that flag is specified then the function just queries the current status and returns. With that flag set, the search path will not change.

Warning: Your call of this function is valid only if the callback was invoked in the contexts CPX_CALLBACKCONTEXT_RELAXATION or CPX_CALLBACKCONTEXT_BRANCHING. In all other contexts, it returns an error.

Arguments

context

The callback context as passed into the callback function.

nodelpstat_p

If not NULL the function returns in this value the status of the node LP (as CPXXgetstat and CPXgetstat would do).

flags

0 gives default behavior, CPX_RELAXATION_FLAG_NOSOLVE inhibits additional solves.

Return

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