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.

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.

Return Value

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


  int CPXchgctype (CPXCENVptr env,
                   CPXLPptr lp,
                   int cnt,
                   const int *indices,
                   const char *xctype);


CPXCENVptr env

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

CPXLPptr lp

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

int cnt

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

const int *indices

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

const char *xctype

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

make column indices[j] continuous 
make column indices[j] binary 
make column indices[j] general integer 
make column indices[j] semi-continuous 
make column indices[j] semi-integer 


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

Previous Page: CPXchgcolname Return to Top Next Page: CPXchgname