Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49673 - in sandbox/SOC/2006/tree/trunk: . boost/tree boost/tree/detail/algorithm boost/tree/detail/augmentors boost/tree/detail/balancers boost/tree/detail/cursor boost/tree/detail/node libs/tree/test
From: ockham_at_[hidden]
Date: 2008-11-10 08:42:33


Author: bernhard.reiter
Date: 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
New Revision: 49673
URL: http://svn.boost.org/trac/boost/changeset/49673

Log:
Rename parity to index
Text files modified:
   sandbox/SOC/2006/tree/trunk/TODO | 2 --
   sandbox/SOC/2006/tree/trunk/boost/tree/algorithm.hpp | 2 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/ascending_cursor.hpp | 2 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/binary_tree.hpp | 2 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/cursor.hpp | 2 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/cursor_adaptor.hpp | 2 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/cursor_facade.hpp | 2 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/general.hpp | 6 +++---
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/inorder.hpp | 12 ++++++------
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/postorder.hpp | 6 +++---
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/preorder.hpp | 6 +++---
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/rank.hpp | 8 ++++----
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/red_black.hpp | 4 ++--
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/forest.hpp | 6 +++---
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/multiway.hpp | 6 +++---
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/nary.hpp | 27 +++++++++++++++++++++------
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/node/nary.hpp | 14 +++++++-------
   sandbox/SOC/2006/tree/trunk/boost/tree/forest_tree.hpp | 2 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/insert_cursor.hpp | 2 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/iterator.hpp | 4 ++--
   sandbox/SOC/2006/tree/trunk/boost/tree/multiway_tree.hpp | 4 ++--
   sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp | 4 ++--
   sandbox/SOC/2006/tree/trunk/libs/tree/test/key_search_binary_tree_test.cpp | 14 +++++++-------
   23 files changed, 76 insertions(+), 63 deletions(-)

Modified: sandbox/SOC/2006/tree/trunk/TODO
==============================================================================
--- sandbox/SOC/2006/tree/trunk/TODO (original)
+++ sandbox/SOC/2006/tree/trunk/TODO 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -72,8 +72,6 @@
     the complete test data.)
   * With the tree complete, do the same recursively for all its subtrees.
 * Also test copy with two trees (not just one tree and a container/output iterator)
-* Rename parity() (which looks somewhat binary-related) to index (more general for forest
- trees etc)?
 * /Possibly/ move detail/algorithm/cursor/ to detail/cursor/algorithm/ or even just
   detail/cursor/ (same for iterator).
 * Make *order iterators work with empty subtrees; same for cursor algorithms.

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/algorithm.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/algorithm.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/algorithm.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -83,7 +83,7 @@
 }
 
 template <class AscendingCursor>
-typename AscendingCursor::size_type parity(AscendingCursor& cur)
+typename AscendingCursor::size_type index(AscendingCursor const& cur)
 {
     return std::distance(cur.parent().begin(), cur);
 }

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/ascending_cursor.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/ascending_cursor.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/ascending_cursor.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -149,7 +149,7 @@
     
     size_type const par() const
     {
- return m_s.top().parity();
+ return m_s.top().index();
     }
 
     void left()

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/binary_tree.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/binary_tree.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/binary_tree.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -480,7 +480,7 @@
             static_cast<node_base_pointer>(p_node->m_parent)
                 ->node_base_type::operator[](0) = (*p_node)[0];
                 
- while (position.parity())
+ while (position.index())
                 position = position.parent();
         } else {
             position = position.begin();

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/cursor.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/cursor.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/cursor.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -234,7 +234,7 @@
     /// Returns true, in case an algorithm has a loop only terminating at a leaf.
     bool empty() const { return true; }
     
- std::size_t const parity() const { return 0; }
+ std::size_t const index() const { return 0; }
 };
 
 /**

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/cursor_adaptor.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/cursor_adaptor.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/cursor_adaptor.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -203,7 +203,7 @@
 
     size_type const par() const
     {
- return m_cursor.parity();
+ return m_cursor.index();
     }
 
     void left()

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/cursor_facade.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/cursor_facade.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/cursor_facade.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -145,7 +145,7 @@
         return cursor_core_access::max_size_(this->derived());
     }
 
- size_type const parity() const
+ size_type const index() const
     {
         return cursor_core_access::par(this->derived());
     }

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/general.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/general.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/general.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -93,7 +93,7 @@
  * After finishing, s will have been increased by the number of elements in c.
  */
 template <class InCursor>
-void size(InCursor c, typename InCursor::size_type& s)
+void size(InCursor c, typename InCursor::subtree_size_type& s)
 {
     InCursor d = c.end();
     c.to_begin();
@@ -111,10 +111,10 @@
  */
 //[ size
 template <class InCursor>
-typename InCursor::size_type size(InCursor c)
+typename InCursor::subtree_size_type size(InCursor c)
 //]
 {
- typename InCursor::size_type s = 0;
+ typename InCursor::subtree_size_type s = 0;
     InCursor d = c.end();
     c.to_begin();
     ++s;

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/inorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/inorder.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/inorder.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -40,7 +40,7 @@
         return;
     }
     
- while (c.parity() && !c.is_root())
+ while (c.index() && !c.is_root())
         c.to_parent();
     return;
 }
@@ -58,7 +58,7 @@
         return;
     }
     
- while (!c.parity() && !c.is_root())
+ while (!c.index() && !c.is_root())
         c.to_parent();
     if (!c.is_root())
         --c;
@@ -196,7 +196,7 @@
     MultiwayCursor y = x;
     while (!x.empty()) {
         x = std::lower_bound(x.begin(), x.end(), val);
- if (x.parity() == 0)
+ if (x.index() == 0)
             y = x;
     }
     return y;
@@ -221,7 +221,7 @@
     MultiwayCursor y = x;
     while (!x.empty()) {
         x = std::lower_bound(x.begin(), x.end(), val, cmp);
- if (x.parity() == 0)
+ if (x.index() == 0)
             y = x;
     }
     return y;
@@ -245,7 +245,7 @@
     MultiwayCursor y = x;
     while (!x.empty()) {
         x = std::upper_bound(x.begin(), x.end(), val);
- if (x.parity() == 0)
+ if (x.index() == 0)
             y = x;
     }
     return y;
@@ -270,7 +270,7 @@
     MultiwayCursor y = x;
     while (!x.empty()) {
         x = std::upper_bound(x.begin(), x.end(), val, cmp);
- if (x.parity() == 0)
+ if (x.index() == 0)
             y = x;
     }
     return y;

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/postorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/postorder.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/postorder.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -37,7 +37,7 @@
     if (c.is_root())
         return;
 
- if (c.parity()) { // Right child? Return parent.
+ if (c.index()) { // Right child? Return parent.
         --c;
         return;
     }
@@ -49,7 +49,7 @@
         if (c.empty())
             ++c;
     }
- if (c.parity())
+ if (c.index())
         --c;
     return;
 }
@@ -79,7 +79,7 @@
     // child (which is what we'll return) or we land at root.
     while (!c.is_root()) {
         c.to_parent();
- if (c.parity())
+ if (c.index())
             if (!(--c).empty()) {
                 c.to_begin();
                 return;

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/preorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/preorder.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/preorder.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -53,7 +53,7 @@
     // we find an ancestor that has a right child.
     while (!c.is_root()) { // Doesn't work with subtrees!
         c.to_parent();
- if (!c.is_root() && !c.parity()) {
+ if (!c.is_root() && !c.index()) {
             if (!(++c).empty()) {
                 c.to_begin();
                 return;
@@ -74,7 +74,7 @@
         c.to_parent();
         
         // If a left child was given, just move to its parent.
- if (!c.parity())
+ if (!c.index())
             return;
         
         // So this is a right child.
@@ -88,7 +88,7 @@
         else
             c.to_begin();
 
- if (c.parity())
+ if (c.index())
         --c;
     return;
 }

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/rank.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/rank.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/rank.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -61,7 +61,7 @@
      void pre_rotate(Tree&, typename Tree::cursor& q)
      {
          typename Tree::cursor p = q->parent();
- if (!q.parity())
+ if (!q.index())
             p.metadata().rank() -= q.metadata().rank();
         else
             q.metadata().rank() += p.metadata().rank();
@@ -72,7 +72,7 @@
      {
          typename Tree::cursor p = y;
          while (p.parent() != t.root()) {
- if (!p.parity())
+ if (!p.index())
                  --p.parent().metadata().rank();
              p = p.parent();
          }
@@ -83,7 +83,7 @@
      {
          typename Tree::cursor p = y;
          while (p.parent() != t.root()) {
- if (!p.parity())
+ if (!p.index())
                  --p.parent().metadata().rank();
              p = p.parent();
          }
@@ -94,7 +94,7 @@
      template <class Tree>
      void descend(Tree&, typename Tree::cursor& p)
      {
- if (p.parity() == 0) {
+ if (p.index() == 0) {
              ++p.metadata().rank();
          }
      }

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/red_black.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/red_black.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/red_black.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -55,9 +55,9 @@
                 y->metadata().set_color(black);
                 x = x.parent().parent();
             } else {
- if (x.parity() != x.parent().parity()) {
+ if (x.index() != x.parent().index()) {
                     t.rotate(x);
- x = (x.parity() ? x.end() : x.begin());
+ x = (x.index() ? x.end() : x.begin());
                 }
                 x.parent()->metadata().set_color(black);
                 x.parent().parent()->metadata().set_color(red);

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/forest.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/forest.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/forest.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -89,7 +89,7 @@
 
 // bool empty_() const
 // {
-// if (this->base().parity())
+// if (this->base().index())
 // return true;
 // return this->base().empty();
 // }
@@ -102,7 +102,7 @@
     
     void decrement()
     {
- if (!this->base().parity())
+ if (!this->base().index())
             this->base_reference().to_parent();
         --this->base_reference();
     }
@@ -120,7 +120,7 @@
     
     void up()
     {
- if (!this->base().parity())
+ if (!this->base().index())
             this->base_reference().to_parent();
     }
 };

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/multiway.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/multiway.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/multiway.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -85,7 +85,7 @@
     
     typename const_multiway_tree_cursor::cursor_adaptor_::reference dereference() const
     {
- return this->base()->m_parent->operator[](this->parity());
+ return this->base()->m_parent->operator[](this->index());
     }
 };
 
@@ -146,7 +146,7 @@
     
     typename multiway_tree_cursor::cursor_adaptor_::reference dereference() const
     {
- return this->base()->m_parent->operator[](this->parity());
+ return this->base()->m_parent->operator[](this->index());
     }
     
 public:
@@ -165,7 +165,7 @@
     
 // const_cursor parent() const
 // {
-// if (!this->base_reference().parity())) {
+// if (!this->base_reference().index())) {
 // return this->base_reference().parent();
 // }
 // }

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/nary.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/nary.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/nary.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -42,9 +42,9 @@
       , bidirectional_traversal_tag
> {
  private:
- typedef typename Node::base_type node_base;
+ typedef typename Node::base_type node_base;
       
- typedef typename mpl::eval_if<
+ typedef typename mpl::eval_if<
                         is_const<Node>
                       , add_const<node_base>
                       , mpl::identity<node_base>
@@ -71,6 +71,7 @@
     // Cursor-specific
     typedef nary_tree_cursor<node_type> cursor;
     typedef nary_tree_cursor<node_type const> const_cursor;
+ typedef std::size_t subtree_size_type;
     
     // Container-specific:
     typedef cursor iterator;
@@ -120,28 +121,33 @@
     void increment()
     {
         ++m_pos;
+ // m_node += sizeof(node_type);
     }
     
     void decrement()
     {
         --m_pos;
+ //m_node -= sizeof(node_type);
     }
     
     void advance(typename nary_tree_cursor::cursor_facade_::difference_type n)
     {
- m_pos += n;
+ m_pos += n;
+ //m_node += n * sizeof(node_type);
     }
     
     typename nary_tree_cursor::cursor_facade_::difference_type
     distance_to(nary_tree_cursor z) const //FIXME: convertible to instead of nary_tree_cursor
     {
- return (z.m_pos - this->m_pos);
+ return (z.m_pos - this->m_pos);
+ //return (z.m_node - this->m_node) / sizeof(node_type);
     }
     
     // Container specific
     bool empty_() const
     {
         return m_node->operator[](m_pos)->empty();
+ //return m_node->operator[](1) == static_cast<node_type*>(m_node);
     }
     
     size_type size_() const
@@ -157,12 +163,14 @@
     size_type par() const
     {
         return m_pos;
+ //return
     }
 
     void left()
     {
         m_node = m_node->operator[](m_pos);
         m_pos = 0;
+ //m_node = m_node->operator[0];
     }
 
     void right()
@@ -170,13 +178,15 @@
         size_type new_pos = m_node->size()-1;
         m_node = m_node->operator[](m_pos);
         m_pos = new_pos;
+ //m_node = m_node->operator[0];
     }
 
     // Cursor stuff
     void up()
     {
- m_pos = m_node->get_parity();
+ m_pos = m_node->get_index();
         m_node = static_cast<base_pointer>(m_node->parent());
+ //m_node = m_node->parent();
     }
     
 protected:
@@ -184,7 +194,7 @@
     {
         base_pointer parent_begin_node =
             static_cast<base_pointer>(m_node->parent())
- ->operator[](m_node->get_parity());
+ ->operator[](m_node->get_index());
         return (!m_pos && (m_node != parent_begin_node));
         // (*this != this->parent().begin())
     }
@@ -218,6 +228,11 @@
 
 };
 
+template <class Node>
+typename nary_tree_cursor<Node>::size_type index(nary_tree_cursor<Node> const& cur)
+{
+ return cur.index();
+}
 
 } // namespace detail
 } // namespace tree

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/node/nary.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/node/nary.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/node/nary.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -98,7 +98,7 @@
     }
 
     // O(n); n is number of parent's children
- typename base_type::size_type const get_parity() const
+ typename base_type::size_type const get_index() const
     {
         typename base_type::size_type i = 0;
         while (static_cast<base_pointer>(this->m_parent)->base_type::operator[](i++) != this);
@@ -156,7 +156,7 @@
         B->m_parent = this;
         q->m_parent = this->m_parent;
 
- base_type::size_type qp = get_parity();
+ base_type::size_type qp = get_index();
         static_cast<base_pointer>(q->m_parent)->base_type::operator[](qp) = q;
         this->m_parent = q;
         q->base_type::operator[](c ? 0 : 1) = this;
@@ -176,16 +176,16 @@
     }
     
     // TODO: actually implement this.
- base_pointer detach(base_type::size_type parity,
- base_type::size_type other_parity,
+ base_pointer detach(base_type::size_type index,
+ base_type::size_type other_index,
                         base_pointer other)
     {
         //Node::pre_splice(q, r);
         // splice out q
- base_pointer x = detach(parity);
+ base_pointer x = detach(index);
 
         // q has been spliced out, now relink it in place of r.
- static_cast<base_pointer>(other->m_parent)->base_type::operator[](other_parity) = this;
+ static_cast<base_pointer>(other->m_parent)->base_type::operator[](other_index) = this;
         m_parent = other->m_parent;
 
         for (base_type::size_type i=0; i<base_type::max_size(); ++i) {
@@ -196,7 +196,7 @@
     }
     
     // O(1)
- base_type::size_type const get_parity() const
+ base_type::size_type const get_index() const
     {
         return (static_cast<base_pointer>(this->m_parent)->base_type::operator[](0) == this ? 0 : 1);
     }

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/forest_tree.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/forest_tree.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/forest_tree.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -95,7 +95,7 @@
         base_cursor bc = base_cursor(pos);
         if (bc != h.root())
             bc = bc.parent();
- //if (bc.parity())
+ //if (bc.index())
         return cursor(h.insert(bc, val));
     }
     

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/insert_cursor.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/insert_cursor.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/insert_cursor.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -67,7 +67,7 @@
 
     typename insert_cursor::cursor_adaptor_::reference dereference() const
     {
- if (this->base_reference().parity()) {
+ if (this->base_reference().index()) {
             const_cast<typename Tree::cursor&>(this->base_reference())
             = tree.insert(this->base_reference(), typename Tree::value_type());
         }

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/iterator.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/iterator.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/iterator.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -63,13 +63,13 @@
     void increment()
     {
         forward(Order(), this->base_reference());
- //BOOST_ASSERT(!this->base_reference().parity() || this->base_reference().is_root());
+ //BOOST_ASSERT(!this->base_reference().index() || this->base_reference().is_root());
     }
     
     void decrement()
     {
         back(Order(), this->base_reference());
- //BOOST_ASSERT(!this->base_reference().parity() || this->base_reference().is_root());
+ //BOOST_ASSERT(!this->base_reference().index() || this->base_reference().is_root());
     }
 };
 

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/multiway_tree.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/multiway_tree.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/multiway_tree.hpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -120,7 +120,7 @@
         base_cursor bc = base_cursor(pos);
 // if (bc != h.root())
 // bc = bc.parent();
-//if (bc.parity())
+//if (bc.index())
         //h.insert(bc, val);
         //if (bc == h.root())
         // bc =
@@ -129,7 +129,7 @@
             bc.m_pos = 0;
         }
         else {
- bc->insert((bc->begin()+bc.parity()), val);
+ bc->insert((bc->begin()+bc.index()), val);
         }
         return cursor(bc);
         

Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -49,7 +49,7 @@
     c3 = c1.end();
     BOOST_CHECK(c3 == c1.end());
     --c3;
- BOOST_CHECK_EQUAL(c3.parity(), 0);
+ BOOST_CHECK_EQUAL(c3.index(), 0);
     BOOST_CHECK(c3.parent() != c3);
     BOOST_CHECK(c3.parent() == c1);
     BOOST_CHECK(c3 == c1.begin());
@@ -230,7 +230,7 @@
     BOOST_CHECK_EQUAL(*((++c).begin()).begin(), 4);
     BOOST_CHECK_EQUAL(*(++c.begin()).begin(), 7);
 
- BOOST_CHECK_EQUAL(c.parity(), 1);
+ BOOST_CHECK_EQUAL(c.index(), 1);
     BOOST_CHECK_EQUAL(*c.begin(), 6);
         
     bt.rotate(c); // Left rotate

Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/key_search_binary_tree_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/key_search_binary_tree_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/key_search_binary_tree_test.cpp 2008-11-10 08:42:30 EST (Mon, 10 Nov 2008)
@@ -39,16 +39,16 @@
     c1 = my_tree.insert(c, 8);
     
     BOOST_CHECK_EQUAL(*c1, 8);
-// BOOST_CHECK_EQUAL(searcher_t::cursor(c1).parity(), 0);
+// BOOST_CHECK_EQUAL(searcher_t::cursor(c1).index(), 0);
     BOOST_CHECK(c != my_tree.end());
     BOOST_CHECK(c1 != my_tree.end());
     
 // cur = searcher_t::cursor(c1);
 // BOOST_CHECK((++cur).empty());
-// BOOST_CHECK(cur.parity());
+// BOOST_CHECK(cur.index());
 //
 // cur = cur.parent(); //header-cursor(,1) (root)
-// BOOST_CHECK(!cur.parity());
+// BOOST_CHECK(!cur.index());
 // BOOST_CHECK_EQUAL(searcher_t::iterator(cur), my_tree.end());
     BOOST_CHECK(*c1 = 8);
 
@@ -58,16 +58,16 @@
     --c1;
     BOOST_CHECK_EQUAL(*c1, 8);
     
-// BOOST_CHECK_EQUAL(searcher_t::cursor(my_tree.end()).parity(), 1);
+// BOOST_CHECK_EQUAL(searcher_t::cursor(my_tree.end()).index(), 1);
 //
-// BOOST_CHECK_EQUAL(cur.end().parity(), 1);
+// BOOST_CHECK_EQUAL(cur.end().index(), 1);
 //
 // cur = searcher_t::cursor(c1);
 //
 // BOOST_CHECK_EQUAL(*cur, 8);
 //
 // BOOST_CHECK((++cur).empty());
-// BOOST_CHECK(!(--cur).parent().parity()); // root's parity...
+// BOOST_CHECK(!(--cur).parent().index()); // root's index...
 //
 // BOOST_CHECK_EQUAL(*(searcher_t::cursor(c).begin()), 8);
     
@@ -106,7 +106,7 @@
     BOOST_CHECK_EQUAL(*c, 39);
     
     c = my_tree.begin();
-// BOOST_CHECK_EQUAL(searcher_t::cursor(c).parity(), 0);
+// BOOST_CHECK_EQUAL(searcher_t::cursor(c).index(), 0);
 // BOOST_CHECK(*(searcher_t::cursor(c).parent()) != 412);
     BOOST_CHECK(*c < 413);
     


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk