CPXXchgrhs and CPXchgrhs

The routine CPXXchgrhs/CPXchgrhs changes the righthand side coefficients of a set of linear constraints in the CPLEX problem object.

int  CPXXchgrhs( CPXCENVptr env, CPXLPptr lp, CPXDIM cnt, CPXDIM const * indices, double const * values )

int  CPXchgrhs( CPXCENVptr env, CPXLPptr lp, int cnt, int const * indices, double const * values )

Description

The routine CPXXchgrhs/CPXchgrhs changes the righthand side coefficients of a set of linear constraints in the CPLEX problem object.

CPLEX treats a righthand side (rhs) of CPX_INFBOUND as infinite.

Arguments

env
A pointer to the CPLEX environment as returned by CPXXopenCPLEX/CPXopenCPLEX.
lp
A pointer to a CPLEX problem object as returned by CPXXcreateprob/CPXcreateprob.
cnt
An integer that specifies the total number of righthand side coefficients to be changed, and thus specifies the length of the arrays indices and values.
indices
An array of length cnt containing the numeric indices of the rows corresponding to the linear constraints for which righthand side coefficients are to be changed.
values
An array of length cnt containing the new values of the righthand side coefficients of the linear constraints present in indices.

Return

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

Example


status = CPXchgrhs (env, lp, cnt, indices, values);