Previous Page: CPXgetobjvalFirst PageNext Page: CPXgetphase1cnt

CPXgetorder


Usage

Mixed Integer Users Only

Description

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

Return Value

The routine returns a zero on success, and a 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.

Synopsis

int CPXgetorder (CPXENVptr env,
                 CPXLPptr lp,
                 int *cnt_p,
                 int *indices,
                 int *priority,
                 int *direction,
                 int ordspace,
                 int *surplus_p);

Arguments


CPXENVptr env
The pointer to the CPLEX environment as returned by one of the CPXopenCPLEX routines.

CPXLPptr lp
A pointer to a CPLEX LP problem object as returned by CPXcreateprob().

int *cnt_p
A pointer to an integer that will contain the number of order entries returned; i.e., the true length of the arrays indices, priority, and direction.

int *indices
An array where the indices of the variables in the order are to be returned. indices[k] will be the index of the variable which is entry k in the order information.

int *priority
An array where the priority values are to be returned. The priority corresponding to the indices[k] is returned in priority[k]. priority may be NULL. If priority is not NULL, it must be of length at least ordspace.

int *direction
An array where the preferred branching directions are to be returned. The direction corresponding to indices[k] is returned in direction[k]. direction may be NULL. If direction is not NULL, it must be of length at least ordspace. Possible settings for direction[k] are:

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]d  

int ordspace
An integer indicating the length of the non-NULL arrays indices, priority, and direction. ordspace may be 0.

int *surplus_p
A pointer to an integer that will contain the difference between ordspace and the number of entries in each of the arrays indices, priority, and direction. A non-negative 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.

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);
Previous Page: CPXgetobjvalFirst PageNext Page: CPXgetphase1cnt