• Home
  • Raw
  • Download

Lines Matching full:ranges

37     ranges: Vec<I>,  field
44 /// The given ranges do not need to be in any specific order, and ranges
47 let mut set = IntervalSet { ranges: intervals.into_iter().collect() }; in new()
56 self.ranges.push(interval); in push()
64 IntervalSetIter(self.ranges.iter()) in iter()
71 &self.ranges in intervals()
77 /// ranges `a-z` and `A-Z`.
82 let len = self.ranges.len(); in case_fold_simple()
84 let range = self.ranges[i]; in case_fold_simple()
85 if let Err(err) = range.case_fold_simple(&mut self.ranges) { in case_fold_simple()
97 self.ranges.extend(&other.ranges); in union()
103 if self.ranges.is_empty() { in intersect()
106 if other.ranges.is_empty() { in intersect()
107 self.ranges.clear(); in intersect()
115 let drain_end = self.ranges.len(); in intersect()
118 let mut itb = (0..other.ranges.len()).into_iter(); in intersect()
122 if let Some(ab) = self.ranges[a].intersect(&other.ranges[b]) { in intersect()
123 self.ranges.push(ab); in intersect()
126 if self.ranges[a].upper() < other.ranges[b].upper() { in intersect()
136 self.ranges.drain(..drain_end); in intersect()
141 if self.ranges.is_empty() || other.ranges.is_empty() { in difference()
155 // says that all ranges are sorted, not overlapping and not adjacent in in difference()
157 let drain_end = self.ranges.len(); in difference()
159 'LOOP: while a < drain_end && b < other.ranges.len() { in difference()
163 if other.ranges[b].upper() < self.ranges[a].lower() { in difference()
169 if self.ranges[a].upper() < other.ranges[b].lower() { in difference()
170 let range = self.ranges[a]; in difference()
171 self.ranges.push(range); in difference()
175 // Otherwise, we have overlapping ranges. in difference()
176 assert!(!self.ranges[a].is_intersection_empty(&other.ranges[b])); in difference()
181 // yield two ranges and 2) after subtracting a range, it's possible in difference()
182 // that future ranges can have an impact. The loop below advances in difference()
183 // the `b` ranges until they can't possible impact the current in difference()
187 // ranges are `a-c`, `g-i`, `r-t` and `x-z`, then we need to apply in difference()
189 let mut range = self.ranges[a]; in difference()
190 while b < other.ranges.len() in difference()
191 && !range.is_intersection_empty(&other.ranges[b]) in difference()
194 range = match range.difference(&other.ranges[b]) { in difference()
203 self.ranges.push(range1); in difference()
213 if other.ranges[b].upper() > old_range.upper() { in difference()
220 self.ranges.push(range); in difference()
224 let range = self.ranges[a]; in difference()
225 self.ranges.push(range); in difference()
228 self.ranges.drain(..drain_end); in difference()
251 if self.ranges.is_empty() { in negate()
253 self.ranges.push(I::create(min, max)); in negate()
261 let drain_end = self.ranges.len(); in negate()
265 if self.ranges[0].lower() > I::Bound::min_value() { in negate()
266 let upper = self.ranges[0].lower().decrement(); in negate()
267 self.ranges.push(I::create(I::Bound::min_value(), upper)); in negate()
270 let lower = self.ranges[i - 1].upper().increment(); in negate()
271 let upper = self.ranges[i].lower().decrement(); in negate()
272 self.ranges.push(I::create(lower, upper)); in negate()
274 if self.ranges[drain_end - 1].upper() < I::Bound::max_value() { in negate()
275 let lower = self.ranges[drain_end - 1].upper().increment(); in negate()
276 self.ranges.push(I::create(lower, I::Bound::max_value())); in negate()
278 self.ranges.drain(..drain_end); in negate()
286 self.ranges.sort(); in canonicalize()
287 assert!(!self.ranges.is_empty()); in canonicalize()
292 let drain_end = self.ranges.len(); in canonicalize()
296 if self.ranges.len() > drain_end { in canonicalize()
297 let (last, rest) = self.ranges.split_last_mut().unwrap(); in canonicalize()
303 let range = self.ranges[oldi]; in canonicalize()
304 self.ranges.push(range); in canonicalize()
306 self.ranges.drain(..drain_end); in canonicalize()
311 for pair in self.ranges.windows(2) { in is_canonical()
364 /// If the two ranges aren't contiguous, then this returns `None`.
388 /// ranges.
390 /// If subtraction would result in an empty range, then no ranges are
401 // We know this because !self.is_subset(other) and the ranges have in difference()
422 /// returns the union of the two ranges minus its intersection.
438 /// Returns true if and only if the two ranges are contiguous. Two ranges
439 /// are contiguous if and only if the ranges are either overlapping or