 |
 |
 |
 |
Purpose |
 |
 |
Change the lower or upper bound for a single variable.
|
 |
Synopsis |
 |
 |
int QSchange_bound (QSprob p, int indx, char lu, double bound)
|
 |
Arguments |
 |
p |
 |
a handle to an initialized problem. |
indx |
 |
the index of the variable whose bound will be changed. |
lu |
 |
an 'L' to change the lower bound or a 'U' to change an upper bound. |
bound |
 |
the value of the new bound. |
|
 |
Returns |
 |
 |
A zero value if the function terminated correctly, and a non-zero value if an error occurred.
|
 |
Description |
 |
 |
This function can be used to change the lower or upper bound of a single variable. A bound on a variable can be removed by specifying -QS_MAXDOUBLE as a lower bound, or QS_MAXDOUBLE as an upper bound. A common use of this function is to fix a variable at its lower or upper bound, or to change a bound in a step of a branch-and-bound algorithm. When specifying the lower or upper bound, 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.
|
 |
Example |
 |
 |
/* Assume p is initialized to the problem in the QSload_prob example. */
/* Change the lower bound on variable y to 0. */
int rval;
rval = QSchange_bound (p, 1, 'L', 0.0);
if (rval) {
fprintf (stderr,
"Could not change the bound, error code %d\n",rval);
}
|
 |
|
|