tighten_lower_bounds(self,
*args)
|
|
Tightens the lower bounds on the specified variables.
There are two forms by which
variables.advanced.tighten_lower_bounds may be called.
- variables.advanced.tighten_lower_bounds(i, lb)
- i must be a variable name or index and lb must be a real
number. Sets the lower bound of the variable whose index
or name is i to lb.
- variables.advanced.tighten_lower_bounds(seq_of_pairs)
- seq_of_pairs must be a list or tuple of (i, lb) pairs, each
of which consists of a variable name or index and a real
number. Sets the lower bound of the specified variables to
the corresponding values. Equivalent to
[variables.advanced.tighten_lower_bounds(pair[0], pair[1]) for pair in seq_of_pairs].
>>> import cplex
>>> c = cplex.Cplex()
>>> indices = c.variables.add(names = ["x0", "x1", "x2"])
>>> c.variables.advanced.tighten_lower_bounds(0, 1.0)
>>> c.variables.get_lower_bounds()
[1.0, 0.0, 0.0]
>>> c.variables.advanced.tighten_lower_bounds([(2, 3.0), ("x1", -1.0)])
>>> c.variables.get_lower_bounds()
[1.0, -1.0, 3.0]
|