Previous Page: CPXchgrowname First PageNext Page: CPXcloseCPLEX

CPXchgsense


Description

The routine CPXchgsense() is used to change the sense of a set of constraints of an LP problem object. When changing the sense of a row to ranged, CPXchgsense() sets the corresponding range value to 0. The CPXchgcoef() routine can then be used to change the range value.

Return Value

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

Synopsis

int CPXchgsense (CPXENVptr env,
                 CPXLPptr lp,
                 int cnt,
                 int *indices,
                 char *sense);

Arguments


CPXENVptr env
The pointer to the CPLEX environment as returned by one of the CPXopenCPLEX routines.

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

int cnt
An integer that indicates the total number of constraints to be changed. cnt thus represents the length of the arrays indices and sense.

int *indices
An array of length cnt containing the numerical indices of the rows corresponding to the constraints which are to have their senses changed. Note that row i of the constraint matrix has the internal index i-1.

char *sense
An array of length cnt containing characters that indicate the new sense of the constraints present in indices.

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 will be ranged  

Example

status = CPXchgsense (env, lp, cnt, indices, sense);
Previous Page: CPXchgrowname First PageNext Page: CPXcloseCPLEX