NO FRAMES

CPXgetorder

int CPXPUBLIC CPXgetorder(CPXCENVptr env, CPXCLPptr lp, int * cnt_p, int * indices, int * priority, int * direction, int ordspace, int * surplus_p)
Definition file: cplex.h
Include files: cplex.h

The routine CPXgetorder is used to access all the MIP priority order information stored in a CPLEX problem object. A priority order is generated if there is no order and parameter CPX_PARAM_MIPORDTYPE is nonzero.

Note
If the value of ordspace is 0, then the negative of the value of *surplus_p returned indicates the length needed for the arrays indices, priority, and direction.

Example

 status = CPXgetorder (env, lp, &listsize, indices, priority,
                       direction, numcols, &surplus);
Possible settings for direction
CPX_BRANCH_GLOBAL(0)use global branching direction setting CPX_PARAM_BRDIR
CPX_BRANCH_DOWN(1)branch down first on variable indices[k]
CPX_BRANCH_UP(2)branch up first on variable indices[k]

Parameters:

env

A pointer to the CPLEX environment as returned by CPXopenCPLEX.

lp

A pointer to a CPLEX problem object as returned by 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.

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]. May 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]. May 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 indicating the length of the non-NULL arrays indices, priority, and direction. May be 0.

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 indicates that the length of the arrays was sufficient. A negative value indicates that the length was insufficient and that the routine could not complete its task. In this case, the routine CPXgetorder returns the value CPXERR_NEGATIVE_SURPLUS, and the negative value of *surplus_p indicates the amount of insufficient space in the arrays.

Returns:

The routine returns zero on success and nonzero if an error occurs. The value CPXERR_NEGATIVE_SURPLUS indicates that insufficient space was available in the indices, priority, and direction arrays to hold the priority order information.