 |
This function returns the coefficients of the objective function as a dense vector, that is, all coefficients (both zero and non-zero) are returned in the array obj . The calling function must allocate the memory for the obj array; it should be of length at least ncols .
|
 |
/* p is an initialized QSprob, a handle to an existing LP problem */
int rval, ncols;
double *obj;
ncols = QSget_colcount (p);
obj = (double *) malloc (ncols * sizeof (double));
rval = QSget_obj (p, obj);
if (rval) {
fprintf (stderr,
"Could not get objective, error code %d\n", rval);
} else {
printf ("Objective Function\n");
for (i = 0; i < ncols; i++) {
printf ("%f\n", obj[i]);
}
}
free (obj);
|