CPXXgetorder and CPXgetorder

The routine CPXXgetorder/CPXgetorder accesses all the MIP priority order information stored in a CPLEX problem object.

int  CPXXgetorder( CPXCENVptr env, CPXCLPptr lp, CPXDIM * cnt_p, CPXDIM * indices, CPXDIM * priority, int * direction, CPXDIM ordspace, CPXDIM * surplus_p )

int  CPXgetorder( CPXCENVptr env, CPXCLPptr lp, int * cnt_p, int * indices, int * priority, int * direction, int ordspace, int * surplus_p )

Description

The routine CPXXgetorder/CPXgetorder accesses all the MIP priority order information stored in a CPLEX problem object. A priority order is generated if there is no order and the parameter to control MIP priority order generation (CPXPARAM_MIP_OrderType) is nonzero.

Note: If the value of ordspace is 0 (zero), then the negative of the value of *surplus_p returned specifies the length needed for the arrays indices, priority, and direction.

Arguments

env
A pointer to the CPLEX environment as returned by CPXXopenCPLEX/CPXopenCPLEX.
lp
A pointer to a CPLEX problem object as returned by CPXXcreateprob/CPXcreateprob.
cnt_p
A pointer to an integer to contain the number of order entries returned; i.e., the true length of the arrays indices, priority, and direction. If the function returns either 0 (zero) or CPXERR_NEGATIVE_SURPLUS, then this value contains the number of elements that were stored in indices, priority, or direction. Otherwise, the value is either unchanged or set to 0 (zero).
indices
An array where the indices of the variables in the order are to be returned. indices[k] is the index of the variable which is entry k in the order information.
priority
An array where the priority values are to be returned. The priority corresponding to the indices[k] is returned in priority[k]. Can be NULL. If priority is not NULL, it must be of length at least ordspace.
direction
An array where the preferred branching directions are to be returned. The direction corresponding to indices[k] is returned in direction[k]. Can be NULL. If direction is not NULL, it must be of length at least ordspace. Possible settings for direction[k] appear in the table.
ordspace
An integer specifying the length of the non-NULL arrays indices, priority, and direction. Can be 0 (zero).
surplus_p
A pointer to an integer to contain the difference between ordspace and the number of entries in each of the arrays indices, priority, and direction. A nonnegative value of *surplus_p reports that the length of the arrays was sufficient. A negative value reports that the length was insufficient and that the routine could not complete its task. In this case, the routine CPXXgetorder/CPXgetorder returns the value CPXERR_NEGATIVE_SURPLUS, and the negative value of *surplus_p specifies the amount of insufficient space in the arrays.

Return

The routine returns 0 (zero) if successful and nonzero

Example


 status = CPXgetorder (env, lp, &listsize, indices, priority,
                       direction, numcols, &surplus);
Table 1. Possible settings for direction
CPX_BRANCH_GLOBAL (0) use global branching direction setting MIP branching direction (CPXPARAM_MIP_Strategy_Branch)
CPX_BRANCH_DOWN (1) branch down first on variable indices[k]
CPX_BRANCH_UP (2) branch up first on variable indices[k]
if an error occurs. The value CPXERR_NEGATIVE_SURPLUS reports that insufficient space was available in the indices, priority, and direction arrays to hold the priority order information.