The routine CPXcopyorder() is used to copy a priority order to a CPLEX problem object of type CPXPROB_MILP or CPXPROB_MIQP. During branching, integer variables with higher priorities are given preference over integer variables with lower priorities. Priorities must be positive integers. A preferred branching direction may also be specified for each variable.

Parameter CPX_PARAM_MIPORDIND must be set to CPX_ON, its default value, for the priority order to be used in a subsequent optimization.

Return Value

The routine returns a zero on success, and a nonzero if an error occurs.


  int CPXcopyorder (CPXCENVptr env,
                    CPXLPptr lp,
                    int cnt,
                    const int *indices,
                    const int *priority,
                    const int *direction);


CPXCENVptr env

The pointer to the CPLEX environment as returned by CPXopenCPLEX().

CPXLPptr lp

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

int cnt

An integer giving the number of entries in the list.

const int *indices

An array of length cnt containing the numerical indices of the columns corresponding to the integer variables that are assigned priorities.

const int *priority

An array of length cnt containing the priorities assigned to the integer variables. The entry priority[j] is the priority assigned to variable indices[j]. May be NULL.

const int *direction

An array of type integer containing the branching direction assigned to the integer variables. The entry direction[j] is the direction assigned to variable indices [j]. May be NULL. Possible settings for direction[j] are:

use global branching direction when setting the parameter CPX_PARAM_BRDIR 
branch down first on variable indices[i] 
branch up first on variable indices[i] 


  status = CPXcopyorder (env, lp, cnt, indices, priority,

See Also

Example mipex3.c in the CPLEX User's Manual.

Previous Page: CPXcopyobjname Return to Top Next Page: CPXcopyqpsep