NO FRAMES

CPXchgctype

int CPXPUBLIC CPXchgctype(CPXCENVptr env, CPXLPptr lp, int cnt, const int * indices, const char * xctype)
Definition file: cplex.h
Include files: cplex.h

The routine CPXchgctype is used to change the types of a set of variables of a CPLEX problem object. Several types can be changed at once, with each type specified by the index of the variable with which it is associated.

Note
If a variable is to be changed to binary, a call to CPXchgbds should also be made to change the bounds to 0 and 1.
Table 1: Values of elements of ctype
CPX_CONTINUOUS'C'make column indices[j] continuous
CPX_BINARY'B'make column indices[j] binary
CPX_INTEGER'I'make column indices[j] general integer
CPX_SEMICONT'S'make column indices[j] semi-continuous
CPX_SEMIINT'N'make column indices[j] semi-integer

Example

 status = CPXchgctype (env, lp, cnt, indices, ctype);

Parameters:

env

A pointer to the CPLEX environment as returned by the CPXopenCPLEX routine.

lp

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

cnt

An integer that indicates the total number of types to be changed, and thus specifies the length of the arrays indices and ctype.

indices

An array containing the numeric indices of the columns corresponding to the variables the types of which are to be changed.

xctype

An array containing characters that represent the new types for the columns specified in indices. Possible values for ctype[j] appear in Table 1.

Returns:

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