XPRS_mse_defaulthandler
XPRS_mse_defaulthandler |
Purpose
A routine defined in xprs_mse_defaulthandler.h intended only to be passed as a callback into the enumeration-run routines
XPRS_mse_minim,
XPRS_mse_maxim and
XPRS_mse_opt. When used to run an enumeration this routine is called each time a solution is found in the enumeration. This routine provides simple functionality to manage common strategies for keeping a 'good' set of solutions found during enumeration and controlling the enumeration run e.g., n-best solutions. The user may wish to base any customized version of the callback on the contents of this routine.
Synopsis
int XPRS_CC XPRS_mse_defaulthandler(XPRSmipsolenum mse, XPRSprob prob, XPRSmipsolpool msp, void *ctx, int *const nMaxSols, const double *const x, const int nCols, const double dMipObject, double *const dModifiedObject, int *const bRejectSoln, int *const bUpdateMipAbsCutOffOnCurrentSet)
Arguments
mse
|
The current MIP solution enumerator.
|
prob
|
The problem used to enumerate solutions.
|
msp
|
The MIP solution pool used to store the solutions found during enumeration.
|
ctx
|
The user-defined object passed into the enumeration-run routine that started this run (i.e.,
XPRS_mse_minim,
XPRS_mse_maxim or
XPRS_mse_opt).
|
nMaxSols
|
The integer pointer passed into the enumeration-run routine that started this run (i.e.,
XPRS_mse_minim,
XPRS_mse_maxim or
XPRS_mse_opt). Note that this pointer is only used by the callback and is intended to store the maximum number of solutions the user is prepared to capture during the enumeration.
|
x
|
A dense solution array of doubles containing the
nCols solution values of the new solution.
|
nCols
|
The number elements in
x. This is the same as the column dimension of the problem when the enumeration was started.
|
dMipObject
|
A double with the value of the MIP objective of the solution.
|
dModifiedObject
|
A pointer to a double that contains, on entry to the routine, the MIP objective. The user can assign it a new value that reflects the 'true' objective of the solution in cases where the MIP objective does not completely model the user's problem. The returned value is stored as the
MSE_METRIC_MODOBJECT metric of the solution.
|
bRejectSoln
|
A pointer to an integer that is at value zero on entry to the routine. The solution will not be stored if the user returns this variable at a non-zero value.
|
bUpdateMipAbsCutOffOnCurrentSet
|
A pointer to an integer that is at value zero on entry to the routine. If the user returns this variable with a non-zero value then the MIP solution enumerator will update the
MIPABSCUTOFF of the problem to reflect the worst MIP objective of the stored solutions (including the new solution if it is not rejected).
|
Further information
This simple routine uses only four different API function calls. These calls are to the MIP solution enumerator routines
XPRS_mse_getcullchoice,
XPRS_mse_getintattrib and
XPRS_mse_getintcontrol and the MIP solution pool routine
XPRS_msp_delsol.
Related topics
XPRS_mse_minim,
XPRS_mse_maxim,
XPRS_mse_opt,
XPRS_mse_getcullchoice,
XPRS_mse_getintattrib,
XPRS_mse_getintcontrol,
XPRS_msp_delsol.