Home | History | Annotate | Download | only in ADT

Lines Matching refs:stop

28 // value. The interval bounds are accessible through the start() and stop()
52 // KeyT stop() const;
75 // const KeyT &stop() const;
550 // - Traits::stopLess(start(i), stop(i)) - Non-empty, sane intervals.
552 // - Traits::stopLess(stop(i), start(i + 1) - Sorted.
554 // - value(i) != value(i + 1) || !Traits::adjacent(stop(i), start(i + 1))
563 const KeyT &stop(unsigned i) const { return this->first[i].second; }
567 KeyT &stop(unsigned i) { return this->first[i].second; }
574 /// @return First index with !stopLess(key[i].stop, x), or size.
578 assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
580 while (i != Size && Traits::stopLess(stop(i), x)) ++i;
589 /// @return First index with !stopLess(key[i].stop, x), never size.
593 assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
595 while (Traits::stopLess(stop(i), x)) ++i;
619 /// @param b Interval stop.
630 assert((i == 0 || Traits::stopLess(stop(i - 1), a)));
631 assert((i == Size || !Traits::stopLess(stop(i), a)));
635 if (i && value(i - 1) == y && Traits::adjacent(stop(i - 1), a)) {
639 stop(i - 1) = stop(i);
643 stop(i - 1) = b;
654 stop(i) = b;
672 stop(i) = b;
684 // The key array in a branch node holds the rightmost stop key of each subtree.
685 // It is redundant to store the last stop key since it can be found in the
700 const KeyT &stop(unsigned i) const { return this->second[i]; }
703 KeyT &stop(unsigned i) { return this->second[i]; }
714 assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
716 while (i != Size && Traits::stopLess(stop(i), x)) ++i;
728 assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
730 while (Traits::stopLess(stop(i), x)) ++i;
742 /// insert - Insert a new (subtree, stop) pair.
746 /// @param Stop Last key in subtree.
747 void insert(unsigned i, unsigned Size, NodeRef Node, KeyT Stop) {
752 stop(i) = Stop;
1065 /// stop - Return the largest mapped key in a non-empty map.
1066 KeyT stop() const {
1067 assert(!empty() && "Empty IntervalMap has no stop");
1068 return !branched() ? rootLeaf().stop(rootSize - 1) :
1069 rootBranch().stop(rootSize - 1);
1074 if (empty() || Traits::startLess(x, start()) || Traits::stopLess(stop(), x))
1186 rootBranch().stop(n) = node[n].template get<Leaf>().stop(size[n]-1);
1225 rootBranch().stop(n) = Node[n].template get<Branch>().stop(Size[n]-1);
1323 /// unsafeStop - Writable access to stop() for iterator.
1326 return branched() ? path.leaf<Leaf>().stop(path.leafOffset()) :
1327 path.leaf<RootLeaf>().stop(path.leafOffset());
1354 /// stop - Return the end of the current interval.
1355 const KeyT &stop() const { return unsafeStop(); }
1418 /// find - Move to the first interval with stop >= x, or end().
1427 /// advanceTo - Move to the first interval with stop >= x, or end().
1472 if (!Traits::stopLess(path.leaf<Leaf>().stop(path.leafSize() - 1), x)) {
1483 if (!Traits::stopLess(path.node<Branch>(l).stop(path.offset(l)), x)) {
1492 if (!Traits::stopLess(map->rootBranch().stop(path.offset(0)), x)) {
1515 void setNodeStop(unsigned Level, KeyT Stop);
1516 bool insertNode(unsigned Level, IntervalMapImpl::NodeRef Node, KeyT Stop);
1522 bool canCoalesceRight(KeyT Stop, ValT x);
1535 /// @param b New stop key, must not overlap the following interval.
1552 /// @param b New stop key.
1609 Traits::adjacent(Node.stop(i-1), Start);
1614 return Node.value(i-1) == Value && Traits::adjacent(Node.stop(i-1), Start);
1618 return Node.value(i) == Value && Traits::adjacent(Node.stop(i), Start);
1624 /// changing stop or value?
1625 /// @param Stop New stop of current interval.
1630 iterator::canCoalesceRight(KeyT Stop, ValT Value) {
1638 return Node.value(i) == Value && Traits::adjacent(Stop, Node.start(i));
1643 return Node.value(i) == Value && Traits::adjacent(Stop, Node.start(i));
1646 return Node.value(0) == Value && Traits::adjacent(Stop, Node.start(0));
1651 /// setNodeStop - Update the stop key of the current node at level and above.
1654 iterator::setNodeStop(unsigned Level, KeyT Stop) {
1661 P.node<Branch>(Level).stop(P.offset(Level)) = Stop;
1666 P.node<RootBranch>(Level).stop(P.offset(Level)) = Stop;
1672 assert(Traits::stopLess(a, this->stop()) && "Cannot move start beyond stop");
1688 assert(Traits::stopLess(this->start(), b) && "Cannot move stop beyond start");
1689 if (Traits::startLess(b, this->stop()) ||
1704 if (canCoalesceRight(this->stop(), x)) {
1721 /// @param Stop The last index in the new node.
1725 iterator::insertNode(unsigned Level, IntervalMapImpl::NodeRef Node, KeyT Stop) {
1734 IM.rootBranch().insert(P.offset(0), IM.rootSize, Node, Stop);
1759 P.node<Branch>(Level).insert(P.offset(Level), P.size(Level), Node, Stop);
1762 setNodeStop(Level, Stop);
1810 Traits::adjacent(SibLeaf.stop(SibOfs), a)) {
1813 // 1. Extend SibLeaf.stop to b and be done, or
1821 setNodeStop(P.height(), SibLeaf.stop(SibOfs) = b);
1892 // When we erase the last entry, update stop and move to a legal position.
1894 setNodeStop(IM.height, Node.stop(NewSize - 1));
1932 // If we removed the last branch, update stop and move to a legal pos.
1934 setNodeStop(Level, Parent.stop(NewSize - 1));
2008 KeyT Stop = Node[Pos]->stop(NewSize[Pos]-1);
2010 SplitRoot = insertNode(Level, NodeRef(Node[Pos], NewSize[Pos]), Stop);
2014 setNodeStop(Level, Stop);
2061 if (Traits::stopLess(posA.stop(), posB.start())) {
2064 if (!posA.valid() || !Traits::stopLess(posB.stop(), posA.start()))
2066 } else if (Traits::stopLess(posB.stop(), posA.start())) {
2069 if (!posB.valid() || !Traits::stopLess(posA.stop(), posB.start()))
2078 if (!posA.valid() || !Traits::stopLess(posB.stop(), posA.start()))
2082 if (!posB.valid() || !Traits::stopLess(posA.stop(), posB.start()))
2111 /// stop - End of the overlapping interval.
2112 KeyType stop() const {
2113 KeyType ak = a().stop();
2114 KeyType bk = b().stop();
2133 if (Traits::startLess(posB.stop(), posA.stop()))
2141 /// stopLess(x, stop()).
2146 if (Traits::stopLess(posA.stop(), x))
2148 if (Traits::stopLess(posB.stop(), x))