CPXXcopyorder and CPXcopyorder
The routine CPXXcopyorder/CPXcopyorder
copies a priority order
to a CPLEX problem object of type
CPXPROB_MILP
,
CPXPROB_MIQP
, or
CPXPROB_MIQCP
.
int CPXXcopyorder( CPXCENVptrenv, CPXLPptrlp, CPXDIMcnt, CPXDIM const *indices, CPXDIM const *priority, int const *direction )
int CPXcopyorder( CPXCENVptrenv, CPXLPptrlp, intcnt, int const *indices, int const *priority, int const *direction )
Description
The routine CPXXcopyorder/CPXcopyorder
copies a priority order
to a CPLEX problem object of type
CPXPROB_MILP
,
CPXPROB_MIQP
, or
CPXPROB_MIQCP
.
A call to CPXXcopyorder/CPXcopyorder
replaces any other information
about priority order previously stored in that CPLEX problem object.
During branching, integer variables with higher
priorities are given preference over integer variables with lower
priorities. Priorities must be
nonnegative integers. A preferred branching
direction may also be specified for each variable.
The CPLEX parameter
MIP priority order switch
(CPXPARAM_MIP_Strategy_Order
)
must be set to
CPX_ON
, its default value,
for the priority order to be used in
a subsequent optimization.
CPX_BRANCH_GLOBAL |
use global branching direction when setting the
MIP branching direction
(CPXPARAM_MIP_Strategy_Branch )
parameter |
CPX_BRANCH_DOWN |
branch down first on variable indices[i] |
CPX_BRANCH_UP |
branch up first on variable indices[i] |
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
- An integer giving the number of entries in the list.
- indices
-
An array of length
cnt
containing the numeric indices of the columns corresponding to the integer variables that are assigned priorities. - priority
-
An array of length
cnt
containing the nonnegative priorities assigned to the integer variables. The entrypriority[j]
is the priority assigned to variableindices[j]
. Can beNULL
. - direction
-
An array of type
int
containing the branching direction assigned to the integer variables. The entrydirection[j]
is the direction assigned to variableindices[j]
. Can beNULL
. Possible settings fordirection[j]
appear in Table 1.
Return
The routine returns 0 (zero) if successful and nonzero if an error occurs.Example
status = CPXcopyorder (env, lp, cnt, indices, priority,
direction);