Lines Matching defs:intervals

13  * non-overlapping intervals. It is particularly efficient for representing
25 protected $intervals = [];
101 while ($resultI < \count($result->intervals) && $rightI < \count($right->intervals)) {
102 $resultInterval = $result->intervals[$resultI];
103 $rightInterval = $right->intervals[$rightI];
132 $result->intervals[$resultI] = $beforeCurrent;
133 $result->intervals[$resultI + 1] = $afterCurrent;
141 $result->intervals[$resultI] = $beforeCurrent;
148 $result->intervals[$resultI] = $afterCurrent;
155 \array_splice($result->intervals, $resultI, 1);
160 // If rightI reached right.intervals.size(), no more intervals to subtract from result.
161 // If resultI reached result.intervals.size(), we would be subtracting from an empty set.
178 if ($this->intervals === null || \count($this->intervals) === 0) {
182 return $this->intervals[0]->start;
207 for ($i = 0, $count = \count($this->intervals); $i < $count; $i++) {
209 $resilt = $this->intervals[$i];
218 $this->intervals[$i] = $bigger;
223 while ($i < \count($this->intervals)) {
224 $next = $this->intervals[$i];
231 \array_splice($this->intervals, $i, 1); // remove this one
235 $this->intervals[$i] = $bigger->union($next); // set to 3 merged ones
245 \array_splice($this->intervals, $i, 0, [$addition]);
254 $this->intervals[] = $addition;
259 if ($other->intervals !== null) {
260 foreach ($other->intervals as $i) {
270 $count = \count($this->intervals);
273 // Binary search for the element in the (sorted, disjoint) array of intervals.
278 $interval = $this->intervals[$m];
298 foreach ($this->intervals as $i) {
307 foreach ($this->intervals as $k => $i) {
308 // intervals is ordered
315 \array_splice($this->intervals, $k, 1);
322 $this->intervals[$k] = new Interval($i->start + 1, $i->stop);
329 $this->intervals[$k] = new Interval($i->start, $i->stop - 1);
340 \array_splice($this->intervals, $k, 0, [$x]);
349 return \count($this->intervals) === 0;
365 return $this->intervals[\count($this->intervals)-1]->stop;
381 return $this->intervals[0]->start;
386 if (!$this->intervals) {
396 $iter = new \ArrayIterator($this->intervals);
438 if (!$this->intervals) {
447 $iterator = new \ArrayIterator($this->intervals);
503 && Equality::equals($this->intervals, $other->intervals);
512 foreach ($this->intervals as $interval) {