CPXchgprobtype


Description

The routine CPXchgprobtype() is used to change the current problem to a related problem. There are six problem types that can be used:

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. 
CPXPROB_FIXEDMIQP 
Problem with quadratic data and ctype information, integer variables fixed. 

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.

Return Value

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

Synopsis

  int CPXchgprobtype (CPXCENVptr env,
                      CPXLPptr lp,
                      int type);

Arguments

CPXCENVptr env

The pointer to the CPLEX environment as returned by CPXopenCPLEX().

CPXLPptr lp

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

int type

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

Example

  status = CPXchgprobtype (env, lp, CPXPROB_MILP);


Previous Page: CPXchgprobname Return to Top Next Page: CPXchgqpcoef