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.
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, anddirection. If the function returns either 0 (zero) orCPXERR_NEGATIVE_SURPLUS, then this value contains the number of elements that were stored inindices,priority, ordirection. 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 entrykin the order information. - priority
-
An array where the priority values are to be returned. The priority corresponding to the
indices[k]is returned inpriority[k]. Can beNULL. Ifpriorityis notNULL, it must be of length at leastordspace. - direction
-
An array where the preferred branching directions are to be returned. The direction corresponding to
indices[k]is returned indirection[k]. Can beNULL. Ifdirectionis notNULL, it must be of length at leastordspace. Possible settings fordirection[k]appear in the table. - ordspace
-
An integer specifying the length of the non-
NULLarraysindices,priority, anddirection. Can be 0 (zero). - surplus_p
-
A pointer to an integer to contain the difference between
ordspaceand the number of entries in each of the arraysindices,priority, anddirection. A nonnegative value of*surplus_preports 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 routineCPXXgetorder/CPXgetorderreturns the valueCPXERR_NEGATIVE_SURPLUS, and the negative value of*surplus_pspecifies the amount of insufficient space in the arrays.
Return
The routine returns 0 (zero) if successful and nonzeroExample
status = CPXgetorder (env, lp, &listsize, indices, priority,
direction, numcols, &surplus);
| 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] |
CPXERR_NEGATIVE_SURPLUS
reports that insufficient space was available in the indices,
priority, and direction arrays to hold the priority order information.