NO FRAMES

CPXchgprobtype

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

The routine CPXchgprobtype changes 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.
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, 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_LPCPXPROB_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);
 

See Also:

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 specifying the desired problem type. See the previous discussion for possible values.

Returns:

The routine returns zero if successful and nonzero if an error occurs.