XPRS_mse_setcbgetsolutiondiff
XPRS_mse_setcbgetsolutiondiff |
Purpose
Declares a user-defined solution difference calculation routine, called each time a new pair of solutions are required to have a difference metric calculated. This functionality is required when the
MSE_METRIC_DIVERSITY metric is applied to the set of stored solutions with a call to
XPRS_mse_getcullchoice and
XPRS_mse_getsolmetric.
Synopsis
int XPRS_CC XPRS_mse_setcbgetsolutiondiff(XPRSmipsolenum mse, int (XPRS_CC * f_mse_getsolutiondiff)(XPRSmipsolenum mse, void * vContext, int nCols, int iSolutionId_1, int iElemCount_1, double dMipObj_1, const double * Vals_1, const int * iSparseIndices_1, int iSolutionId_2, int iElemCount_2, double dMipObj_2, const double * Vals_2, const int * iSparseIndices_2, double * dDiffMetric), void * p)
Arguments
mse
|
The current MIP solution enumerator.
|
f_mse_getsolutiondiff
|
The callback function which takes 14 arguments,
mse,
vContext,
nCols,
iSolutionId_1,
iElemCount_1,
dMipObj_1,
Vals_1,
iSparseIndices_1,
iSolutionId_2,
iElemCount_2,
dMipObj_2,
Vals_2,
iSparseIndices_2 and
dDiffMetric. Use a NULL value to cancel a callback function.
|
mse
|
The current MIP solution enumerator.
|
vContext
|
The user-defined object passed to the callback function.
|
nCols
|
The number of columns in the solutions. This is the same as the column dimension of the problem when the enumeration was started.
|
iSolutionId_1
|
The solution id of the first of the solution pair. This may be -1 in which case the solution has not yet be stored in the MIP solution pool. This happens when the user passes a new solution to
XPRS_mse_getcullchoice using the diversity metric (
MSE_METRIC_DIVERSITY).
|
iElemCount_1
|
The number of non-zero elements in the first solution.
|
dMipObj_1
|
The MIP objective value of the first solution.
|
Vals_1
|
A sparse array of doubles of length
iElemCount_1 containing the first solution's solution values.
|
iSparseIndices_1
|
A sparse array of integers of length
iElemCount_1 containing the first solution's column indices.
|
iSolutionId_2
|
The solution id of the second of the solution pair.
|
iElemCount_2
|
The number of non-zero elements in the second solution.
|
dMipObj_2
|
The MIP objective value of the second solution.
|
Vals_2
|
A sparse array of doubles of length
iElemCount_2 containing the second solution's solution values.
|
iSparseIndices_2
|
A sparse array of integers of length
iElemCount_2 containing the second solution's column indices.
|
dDiffMetric
|
A pointer to a double to return the metric of the difference between the two solutions.
|
p
|
A user-defined object to be passed to the callback function.
|
Further information
If the user does not provide this callback function then the MIP solution enumerator uses a simple difference metric that considers only the MIP entities in the solution.
Related topics