 |
 |
 |
 |
Purpose |
 |
 |
Copy the constraint slack values into an array.
|
 |
Synopsis |
 |
 |
int QSget_slack_array (QSprob p, double *slack)
|
 |
Arguments |
 |
p |
 |
a handle to an initialized problem. |
slack |
 |
returns the values of the slack variables associated with the constraints; this field should point to an array of length at least nrows , the number of rows in the problem. |
|
 |
Returns |
 |
 |
A zero value if the function terminated correctly, and a non-zero value if an error occurred. Note that QSget_slack_array returns an error code if it is called with a specified problem that has not been solved with one of the optimization functions ( QSopt_dual or QSopt_primal) since the last time the problem was loaded or modified.
|
 |
Description |
 |
 |
This function returns the slack values associated with the constraints of the LP problem. The values are given as a dense vector, that is, the values of all slacks (both zero and non-zero) are returned in the array slack .
|
 |
Example |
 |
 |
/* p is an initialized QSprob, a handle to an existing LP problem */
int rval, nrows;
double *slack;
nrows = QSget_rowcount (p);
slack = (double *) malloc (nrows * sizeof (double));
rval = QSget_slack_array (p, slack);
if (rval) {
fprintf (stderr, "Could not get slacks, error code %d\n", rval);
} else {
/* See QSget_solution() to print named slack values */
}
free (slack);
|
 |