Lines Matching defs:start
19 // Ranges allows holding an ordered list of ranges of [start,end) intervals.
27 // Add (start,end) to this object, coallescing overlaps as appropriate.
29 size_t Add(T start, T end);
34 // Return the "i"'th range's start & end (0-based).
35 T start(int i) const;
48 // Disjoint, in increasing order of start.
57 size_t Ranges<T>::Add(T start, T end) {
58 if (start == end) // Nothing to be done with empty ranges.
61 DCheckLT(start, end);
63 // Walk along the array of ranges until |start| is no longer larger than the
65 for (i = 0; i < ranges_.size() && ranges_[i].second < start; ++i) {
69 // Now we know |start| belongs in the i'th slot.
72 ranges_.push_back(std::make_pair(start, end));
76 // If |end| is less than i->first, then [start,end) is a new (non-overlapping)
79 ranges_.insert(ranges_.begin() + i, std::make_pair(start, end));
83 // Easy cases done. Getting here means there is overlap between [start,end)
86 // Now: start <= i->second && i->first <= end
87 if (start < ranges_[i].first)
88 ranges_[i].first = start;
92 // Now: [start,end) is contained in the i'th range, and we'd be done, except
122 T Ranges<T>::start(int i) const {
144 T max_start = std::max(start(i), other.start(j));