CPXXchgrngval and CPXchgrngval
The routine CPXXchgrngval/CPXchgrngval changes the range
coefficients of a set of linear constraints in the CPLEX problem object.
int CPXXchgrngval( CPXCENVptr env, CPXLPptr lp, CPXDIM cnt, CPXDIM const * indices, double const * values )
int CPXchgrngval( CPXCENVptr env, CPXLPptr lp, int cnt, int const * indices, double const * values )
Description
The routine CPXXchgrngval/CPXchgrngval changes the range
coefficients of a set of linear constraints in the CPLEX problem object.
Note that changing the range coefficients will not change the sense of a constraint.
You must call
CPXXchgsense/CPXchgsense
to change the sense of a ranged row if the previous range coefficient was 0 (zero) and the
constraint sense was not 'R'. Similarly, changing the range coefficient from a nonzero
value to 0 (zero) will not change the constraint sense from 'R' to 'E'; an additional call of
CPXXchgsense/CPXchgsense
is required to accomplish that.
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 range coefficients to be changed, and thus specifies the length of the arrays
indicesandvalues. - indices
-
An array of length
cntcontaining the numeric indices of the rows corresponding to the linear constraints for which range coefficients are to be changed. - values
-
An array of length
cntcontaining the new values of the range coefficients of the linear constraints present inindices.
Return
The routine returns 0 (zero) if successful and nonzero if an error occurs.Example
status = CPXchgrngval (env, lp, cnt, indices, values);