 |
int QSchange_bounds (QSprob p, int num, int *collist, char *lu,
double *bounds)
|
 |
This function can be used to change the lower and upper bounds for a list of variables. Bounds on variables can be removed by specifying -QS_MAXDOUBLE as a lower bound, or QS_MAXDOUBLE as an upper bound. (To change a bound on a single variable it is easier to use the function QSchange_bound.) When specifying the upper and lower bounds, it is important not to give any value larger in magnitude than QS_MAXDOUBLE (1e30). This restriction is due to the internal structures used in the QSopt solvers.
|
 |
/* Assume p is initialized to the problem in the QSload_prob example. */
/* Change the bounds on variable y to 0 <= y <= 1, and change the */
/* upper bound on x to 3, giving x the bounds 2 <= x <= 3. */
int rval;
int collist[3] = { 1, 1, 0};
char lu[3] = { 'L', 'U', 'U'};
double bounds[3] = { 0.0, 1.0, 3.0 };
rval = QSchange_bounds (p, 3, collist, lu, bounds);
if (rval) {
fprintf (stderr,
"Could not change the bounds, error code %d\n",rval);
}
|