Previous Page: CPXchgobjsenFirst PageNext Page: CPXchgqpcoef

CPXchgprobtype


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:

Value  
Symbolic Constant  
Meaning  
0  
CPXPROB_LP  
Linear program, no ctype or quadratic data stored.  
1  
CPXPROB_MIP  
Problem with ctype information.  
2  
CPXPROB_RELAXED  
Problem with ctype information, LP relaxation.  
3  
CPXPROB_FIXED  
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.  

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.

From either the relaxed or the fixed LPs, the original mixed integer problem can be recovered. If the current problem type is 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().

A quadratic programming problem (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().

From the relaxed quadratic program, the original quadratic program can be recovered. If the current problem type is 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);

Arguments


CPXENVptr env
The pointer to the CPLEX environment as returned by one of the CPXopenCPLEX routines.

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 above discussion for possible values.

Example

status = CPXchgprobtype (env, lp, CPXPROB_MIP);

Previous Page: CPXchgobjsenFirst PageNext Page: CPXchgqpcoef