int QSget_rows_list (QSprob p, int num, int *rowlist, int **rowcnt,
int **rowbeg, int **rowind, double **rowval, double **rhs,
char **sense, char ***names)
/* p is an initialized QSprob, a handle to an existing LP problem */
/* Obtain the row information for row 0 and row 2. */
double *rowval = NULL, *rhs = NULL;
int *rowcnt = NULL, *rowbeg = NULL, *rowind = NULL;
char *sense = NULL, **names = NULL;
int rowlist[2] = { 0, 2 };
int i, j, rval;
rval = QSget_rows_list (p,
2, rowlist, &rowcnt, &rowbeg, &rowind, &rowval,
&rhs, &sense, &names);
if (rval) {
fprintf (stderr, "could not obtain rows, error code %d\n", rval);
} else {
for (i = 0; i < 2; i++) {
printf ("%s RHS = %f, SENSE = %c\n",
names[i], rhs[i], sense[i]);
printf (" Coefficients: ");
for (j = rowbeg[i]; j < rowbeg[i] + rowcnt[i]; j++) {
printf ("(%d, %f) ", rowind[j], rowval[j]);
}
printf ("\n");
}
}
QSfree (rowcnt);
QSfree (rowbeg);
QSfree (rowind);
QSfree (rowval);
QSfree (rhs);
QSfree (sense);
if (names) {
for (i = 0; i < 2; i++) {
QSfree (names[i]);
}
QSfree (names);
}