Overview | Group | Tree | Graph | Index | Concepts |
The routine CPXcopyctype
can be used to copy variable type
information to a given problem. Variable types indicate whether a variable
is continuous, integer, binary, semi-continuous, or semi-integer.
If the
type of the problem object is CPXPROB_LP
, it is changed to
CPXPROB_MILP
.
If the type of the problem object is
CPXPROB_QP
, it is changed to CPXPROB_MIQP
.
If the type of the problem object is
CPXPROB_QCP
, it is changed to CPXPROB_MIQCP
.
This routine allows the types of all the variables to be set in one
function call. When CPXcopyctype
is called, any current
solution information is freed.
j
to be binary by setting the corresponding ctype[j]='B'
does not change the bounds associated with that variable. Because a call to
CPXmipopt
fails if the value of the corresponding variable is not between 0 and 1 in
the solution of the LP relaxation at the root of the search tree, explicitly
setting the bounds of binary variables to 0 and 1 is recommended.CPX_CONTINUOUS | 'C' | continuous variable |
CPX_BINARY | 'B' | binary variable |
CPX_INTEGER | 'I' | general integer variable |
CPX_SEMICONT | 'S' | semi-continuous variable |
CPX_SEMIINT | 'N' | semi-integer variable |
Example
status = CPXcopyctype (env, lp, ctype);
See also the example mipex1.c
in the standard distribution.
env | A pointer to the CPLEX environment as returned by |
lp | A pointer to a CPLEX problem object as returned by |
xctype | An array of length |