Overview | Group | Index | Concepts |
The routine CPXchgprobtype
is used to change the current
problem to a related problem. The problem types that can be
used appear in the table.
Value | Symbolic Constant | Meaning |
0 | CPXPROB_LP | Linear program, no ctype or quadratic data stored. |
1 | CPXPROB_MILP | Problem with ctype information. |
3 | CPXPROB_FIXEDMILP | Problem with ctype information, integer variables fixed. |
5 | CPXPROB_QP | Problem with quadratic data stored. |
7 | CPXPROB_MIQP | Problem with quadratic data and ctype information. |
8 | CPXPROB_FIXEDMIQP | Problem with quadratic data and ctype information, integer variables fixed. |
10 | CPXPROB_QCP | Problem with quadratic constraints. |
11 | CPXPROB_MIQCP | Problem with quadratic constraints and ctype information. |
A mixed integer problem (CPXPROB_MILP
,
CPXPROB_MIQP
, or
CPXPROB_MIQCP
)
can be changed to a fixed problem
(CPXPROB_FIXEDMILP
,
CPXPROB_FIXEDMIQP
,
or CPXPROB_FIXEDMIQCP
), where
bounds on integer variables are fixed to the values attained in the integer
solution. A mixed integer problem (or its related fixed type) can also be
changed to a continuous problem (CPXPROB_LP
CPXPROB_QP
or
CPXPROB_QCP
),
which causes any existing ctype
values to be permanently discarded from the problem object.
The original mixed integer problem can be recovered from the fixed
problem. If the current problem type is CPXPROB_FIXEDMILP
,
CPXPROB_FIXEDMIQP
, or
CPXPROB_FIXEDMIQCP
, any calls to problem modification routines
fail. To modify the problem object, the problem type should be changed to
CPXPROB_MILP
,
CPXPROB_MIQP
, or
CPXPROB_MIQCP
.
Changing a problem from a continuous type to a mixed integer type
causes a ctype
array to be created
such that all variables are considered continuous.
A problem of type CPXPROB_MILP
,
CPXPROB_MIQP
, or CPXPROB_MIQCP
can be solved only by the routine CPXmipopt
, even if
all of its variables are continuous.
A quadratic problem (CPXPROB_QP
,
CPXPROB_MIQP
, CPXPROB_QCP
, or
CPXPROB_MIQCP
) can be changed
to a linear program (CPXPROB_LP
), causing any existing
quadratic information to be permanently discarded from the problem object.
Changing a problem from a linear program (CPXPROB_LP
or
CPXPROB_MILP
) to a quadratic program
(CPXPROB_QP
or
CPXPROB_MIQP
) causes an empty quadratic matrix to be created
such that the problem is quadratic with the matrix Q = 0
.
Example
status = CPXchgprobtype (env, lp, CPXPROB_MILP);
env | A pointer to the CPLEX environment as returned by |
lp | A pointer to a CPLEX LP problem object as returned by |
type | An integer indicating the desired problem type. See the previous discussion for possible values. |