CPXchgsense


Description

The routine CPXchgsense() is used to change the sense of a set of constraints of a CPLEX problem object. When changing the sense of a row to ranged, CPXchgsense() sets the corresponding range value to 0. The routine CPXchgrngval() 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 (CPXCENVptr env,
                   CPXLPptr lp,
                   int cnt,
                   const int *indices,
                   const char *sense);

Arguments

CPXCENVptr env

The pointer to the CPLEX environment as returned by CPXopenCPLEX().

CPXLPptr lp

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

int cnt

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

const 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.

const char *sense

An array of length cnt containing characters that indicate the new sense of the constraints specified 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 is ranged 

Example

  status = CPXchgsense (env, lp, cnt, indices, sense);


Previous Page: CPXchgrowname Return to Top Next Page: CPXcloneprob