NO FRAMES

CPXchgprobtype

int CPXPUBLIC CPXchgprobtype(CPXCENVptr env, CPXLPptr lp, int type)
Definition file: cplex.h
Include files: cplex.h

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.

Table 1: Problem Types
ValueSymbolic ConstantMeaning
0CPXPROB_LPLinear program, no ctype or quadratic data stored.
1CPXPROB_MILPProblem with ctype information.
3CPXPROB_FIXEDMILPProblem with ctype information, integer variables fixed.
5CPXPROB_QPProblem with quadratic data stored.
6CPXPROB_ZEROEDQPProblem with quadratic data stored, ignoring Q.
7CPXPROB_MIQPProblem with quadratic data and ctype information.
8CPXPROB_FIXEDMIQPProblem with quadratic data and ctype information, integer variables fixed.
10CPXPROB_QCPProblem with quadratic constraints.
11CPXPROB_MIQCPProblem 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);
 

Parameters:

env

A pointer to the CPLEX environment as returned by CPXopenCPLEX.

lp

A pointer to a CPLEX LP problem object as returned by CPXcreateprob.

type

An integer indicating the desired problem type. See the previous discussion for possible values.

Returns:

The routine returns zero on success and nonzero if an error occurs.