| Overview | Group | Index | Concepts |
The routine CPXcopyctype can be used to copy variable type
information into a given problem. Variable types indicate whether a variable
is continuous, integer, binary, semi-continuous, or semi-integer.
Adding ctype information automatically changes the problem
type from continuous to mixed integer
(from CPXPROB_LP to CPXPROB_MILP,
from CPXPROB_QP to CPXPROB_MIQP, and
from CPXPROB_QCP to CPXPROB_MIQCP), even
if the provided ctype data indicates that all variables
are continuous.
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. A later call to
CPXmipopt
will change the bounds to 0 (zero) and 1 (one) and issue a warning.
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 |
When you build or modify your model with this routine,
you can verify that the results are as you intended
by calling CPXcheckcopyctype
during application development.
Example
status = CPXcopyctype (env, lp, ctype);
See also the example mipex1.c distributed with the product.
| 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 |