 |
This function returns the dual solution to the LP problem as a dense vector, that is, the values of all dual variables (both zero and non-zero) are returned in the array pi . Note that the values of the dual variables associated with lower and upper bounds are given implicitly by the array pi .
|
 |
/* p is an initialized QSprob, a handle to an existing LP problem */
int rval, nrows;
double *pi;
nrows = QSget_rowcount (p);
pi = (double *) malloc (nrows * sizeof (double));
rval = QSget_pi_array (p, pi);
if (rval) {
fprintf (stderr,
"Could not get dual values, error code %d\n", rval);
} else {
/* To print dual values with names, see QSget_solution() example. */
}
free (pi);
|