 |
 |
 |
 |
Purpose |
 |
 |
Change the sense of a set of constraints.
|
 |
Synopsis |
 |
 |
int QSchange_senses (QSprob p, int num, int *rowlist, char *sense)
|
 |
Arguments |
 |
p |
 |
a handle to an initialized problem. |
num |
 |
the number of constraints to be changed. |
rowlist |
 |
an array of length num specifying the indices of the constraints to be changed. |
sense |
 |
an array of length num specifying the new sense of each of the constraints; entries should be 'E' , 'L' , or 'G' . |
|
 |
Returns |
 |
 |
A zero value if the function terminated correctly, and a non-zero value if an error occurred.
|
 |
Description |
 |
 |
The sense of each constraint in an LP problem is either ≥ , = , or ≤ . This function can be used to change the sense of each constraint in a given list, specifying new values using the encoding 'E' for ≥ , 'L' for = , and 'G' for ≤ . To change the sense of a single constraint it is easier to use the function QSchange_sense.
|
 |
Example |
 |
 |
/* Assume p is initialized to the problem in the QSload_prob example. */
/* Change the first constraint to an "=" and change the second */
/* constraint to a "<=". */
int rval;
int rowlist[2] = { 0, 1 };
char sense[2] = { 'E', 'L' };
rval = QSchange_senses (p, 2, rowlist, sense);
if (rval) {
fprintf (stderr,
"Could not change the senses, error code %d\n",rval);
}
|
 |
|
|