Overview | Group | Tree | Graph | 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. |
6 | CPXPROB_ZEROEDQP | Problem with quadratic data stored, ignoring Q. |
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
or
CPXPROB_MIQP
) can be changed to a problem
(CPXPROB_FIXEDMILP
or CPXPROB_FIXEDMIQP
) 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 linear program or a quadratic program (CPXPROB_LP
or CPXPROB_QP
), 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
or
CPXPROB_FIXEDMIQP
, any calls to problem modification routines
fail. To modify the problem object, the problem type should be changed to
CPXPROB_MILP
or CPXPROB_MIQP
.
Changing a problem from type CPXPROB_LP
to
CPXPROB_MILP
or from type CPXPROB_QP
to
CPXPROB_MIQP
causes a ctype
array to be created
such that all variables are considered continuous. Changing a problem from
type CPXPROB_MILP
to CPXPROB_MIQP
causes an empty
quadratic matrix to be created such that the objective is quadratic with
Q = 0
. A problem of type CPXPROB_MILP
or
CPXPROB_MIQP
can be solved only by the routine
CPXmipopt
.
A quadratic programming problem (CPXPROB_QP
) 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 type CPXPROB_LP
to
CPXPROB_QP
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. |