Usage
(Mixed Integer or Barrier Users Only)Description
The routine CPXchgprobtype() is used to change the current problem to a related problem. There are six problem types that can be used:
A mixed integer problem (
CPXPROB_MIP) can be changed to its linear programming relaxation (CPXPROB_RELAXED), where all integrality restrictions are removed, or it can be changed to a problem (CPXPROB_FIXED) where bounds on integer variables are fixed to the values attained in the integer solution. A mixed integer problem (or its two related types) can also be changed to a linear program (CPXPROB_LP), which causes any existing ctype values to be permanently discarded from the problem object.CPXPROB_RELAXED or CPXPROB_FIXED, then any calls to problem modification routines will fail. To modify the problem object, the problem type should be changed to CPXPROB_MIP. Changing a problem from type CPXPROB_LP to CPXPROB_MIP causes a ctype array to be created such that all variables are considered continuous. A problem that is of type CPXPROB_MIP can be solved only with a call to CPXmipopt().CPXPROB_QP) can be changed to its linear programming relaxation (CPXPROB_ZEROEDQP), where the quadratic coefficient matrix is assumed to be identically 0. A quadratic program (or its related type) can also be changed to a linear program (CPXPROB_LP), which causes 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. A problem that is of type CPXPROB_QP can only be solved with a call to CPXbaropt().CPXPROB_ZEROEDQP, then any calls to problem modification routines will fail. To modify the problem object, the problem type should be changed to CPXPROB_QP.Return Value
The routine returns a zero on success, and a nonzero if an error occurs.Synopsis
int CPXchgprobtype (CPXENVptr env,
CPXLPptr lp,
int type);
CPXENVptr envThe pointer to the CPLEX environment as returned by one of the
CPXopenCPLEX routines.
CPXLPptr lpA pointer to a CPLEX LP problem object as returned by
CPXcreateprob().
int typeAn integer indicating the desired problem type. See the above discussion for possible values.
status = CPXchgprobtype (env, lp, CPXPROB_MIP);