NO FRAMES

CPXchgbds

public int CPXchgbds(CPXCENVptr env, CPXLPptr lp, int cnt, const int * indices, const char * lu, const double * bd)
Definition file: cplex.h

The routine CPXchgbds changes the lower or upper bounds on a set of variables of a problem. Several bounds can be changed at once, with each bound specified by the index of the variable with which it is associated. The value of a variable can be fixed at one value by setting the upper and lower bounds to the same value.

Unbounded Variables

If a variable lacks a lower bound, then CPXgetlb returns a value greater than or equal to -CPX_INFBOUND.

If a variable lacks an upper bound, then CPXgetub returns a value less than or equal to CPX_INFBOUND.

These conventions about unbounded variables should be taken into account when you change bounds with CPXchgbds.

Example

 status = CPXchgbds (env, lp, cnt, indices, lu, bd);
 
Values of lu denoting lower or upper bound in indices[j]
lu[j]= 'L'bd[j] is a lower bound
lu[j]= 'U'bd[j] is an upper bound
lu[j]= 'B'bd[j] is the lower and upper bound

Parameters:

env

A pointer to the CPLEX environment as returned by CPXopenCPLEX.

lp

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

cnt

An integer that specifies the total number of bounds to be changed, and thus specifies the length of the arrays indices, lu, and bd.

indices

An array of length cnt containing the numeric indices of the columns corresponding to the variables for which bounds are to be changed.

lu

An array of length cnt containing characters that tell whether the corresponding entry in the array bd specifies the lower or upper bound on column indices[j]. Possible values appear in the table.

bd

An array of length cnt containing the new values of the lower or upper bounds of the variables present in indices.

Returns:

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