Changeset 3167
- Timestamp:
- Oct 26, 2010 10:05:25 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
coopr.pyomo/trunk/coopr/pyomo/base/rangeset.py
r3149 r3167 11 11 __all__ = ['RangeSet'] 12 12 13 import itertools14 13 import sets 15 14 import expr 16 15 from numvalue import value 17 16 from pyutilib.component.core import * 18 19 def count(start=0, step=1):20 n = start21 while True:22 yield n23 n += step24 17 25 18 class RangeSetValidator(object): … … 97 90 lb = self._start_val 98 91 ub = self._start_val 99 #for val in xrange(self._start_val, self._end_val+1, self._step_val): 100 for val in itertools.islice(count(self._start_val, self._step_val), (self._end_val-self._start_val+self._step_val-1)//self._step_val): 92 for val in xrange(self._start_val, self._end_val+1, self._step_val): 101 93 if self._verify(val,False): 102 94 ub=val
Note: See TracChangeset
for help on using the changeset viewer.