QSopt QSchange_bounds QSopt > Callable Library > Function List
  QSopt
  Downloads
  LP Info
  Software
  Problem Formats
  Callable Library
  Overview
Function List
  Rational Solver
  Beta
  Contact Info
Purpose
Change the lower or upper bounds for a set of variables.
Synopsis
int QSchange_bounds (QSprob p, int num, int *collist, char *lu,
    double *bounds)
Arguments
p a handle to an initialized problem.
num the number of bounds to be changed.
collist an array of length num specifying the indices of the variables whose bounds will be changed.
lu an array of length num specifying the type of each bound to be changed ('L' for a lower bound, 'U' for an upper bound).
bounds an array of length num specifying the values of the new bounds.
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 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.

Example
/* 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);
}
 
QSopt | Problem Formats | Downloads Back
Last Updated: November 2003