• Home
  • Raw
  • Download

Lines Matching full:max

15 // the half-open interval [min, max). A point p is considered to be contained in
16 // the interval iff p >= min && p < max. One consequence of this definition is
17 // that for any non-empty interval, min is contained in the interval but max is
19 // interval where max <= min is regarded as empty. As a consequence, two empty
21 // underlying min() or max() values. Also beware of the terminology used here:
22 // the library uses the terms "min" and "max" rather than "begin" and "end" as
32 // either they are both empty or if their corresponding min and max fields
102 // Construct an Interval representing the interval [min, max). If min < max,
104 // values from min up to (but not including) max. On the other hand, if min >=
105 // max, the constructed object will represent the empty interval.
106 Interval(const T& min, const T& max) : min_(min), max_(max) {} in Interval() argument
109 const T& max() const { return max_; } in max() function
113 void Set(const T& min, const T& max) { in Set() argument
115 SetMax(max); in Set()
121 bool Empty() const { return min() >= max(); } in Empty()
124 // IsEmpty() is true; otherwise the value returned is max() - min().
127 // Returns true iff t >= min() && t < max().
128 bool Contains(const T& t) const { return min() <= t && max() > t; } in Contains()
135 return !Empty() && !i.Empty() && min() <= i.min() && max() >= i.max(); in Contains()
141 return !Empty() && !i.Empty() && min() < i.max() && max() > i.min(); in Intersects()
176 return a.min() == b.min() && a.max() == b.max();
192 return a.min() < b.min() || (a.min() == b.min() && a.max() > b.max());
196 return out << "[" << i.min() << ", " << i.max() << ")";
212 *out = Interval(std::max(min(), i.min()), std::min(max(), i.max())); in Intersects()
226 if (i.max() < max()) { in IntersectWith()
227 SetMax(i.max()); in IntersectWith()
246 if (i.max() > max()) { in SpanningUnion()
247 SetMax(i.max()); in SpanningUnion()
266 if (min() < i.max() && min() >= i.min() && max() > i.max()) { in Difference()
270 *hi = Interval(i.max(), max()); in Difference()
273 if (max() > i.min() && max() <= i.max() && min() < i.min()) { in Difference()
280 if (min() < i.min() && max() > i.max()) { in Difference()
286 *hi = Interval(i.max(), max()); in Difference()
289 if (min() >= i.min() && max() <= i.max()) { in Difference()