CPXXchgsense and CPXchgsense
The routine CPXXchgsense/CPXchgsense changes the sense of a
set of linear constraints of a CPLEX problem object.
int CPXXchgsense( CPXCENVptr env, CPXLPptr lp, CPXDIM cnt, CPXDIM const * indices, char const * sense )
int CPXchgsense( CPXCENVptr env, CPXLPptr lp, int cnt, int const * indices, char const * sense )
Description
The routine CPXXchgsense/CPXchgsense changes the sense of a
set of linear constraints of a CPLEX problem object.
When changing the sense of a
row to ranged, CPXXchgsense/CPXchgsense sets the corresponding range value
to 0 (zero). The routine
CPXXchgrngval/CPXchgrngval can then be
used to change the range value.
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 linear constraints to be changed, and thus represents the length of the arrays
indicesandsense. - indices
-
An array of length
cntcontaining the numeric indices of the rows corresponding to the linear constraints which are to have their senses changed. - sense
-
An array of length
cntcontaining characters that tell the new sense of the linear constraints specified inindices. Possible values appear in the table.
Return
The routine returns 0 (zero) if successful and nonzero if an error occurs.Example
status = CPXchgsense (env, lp, cnt, indices, sense);
sense[i] |
= 'L' |
The new sense is <= |
sense[i] |
= 'E' |
The new sense is = |
sense[i] |
= 'G' |
The new sense is >= |
sense[i] |
= 'R' |
The constraint is ranged |