[GIT] ppl/ppl(master): CO_Tree::tree_iterator: rename index() method into dfs_index().

Module: ppl/ppl Branch: master Commit: a293f2ccd692a879441dd9ddb18a8da695a795e5 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=a293f2ccd692a...
Author: Marco Poletti poletti.marco@gmail.com Date: Fri Sep 3 19:01:29 2010 +0200
CO_Tree::tree_iterator: rename index() method into dfs_index().
---
src/CO_Tree.cc | 7 ++++--- src/CO_Tree.defs.hh | 2 +- src/CO_Tree.inlines.hh | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/CO_Tree.cc b/src/CO_Tree.cc index d4b9123..754176f 100644 --- a/src/CO_Tree.cc +++ b/src/CO_Tree.cc @@ -791,14 +791,15 @@ PPL::CO_Tree::rebalance(tree_iterator itr, dimension_type key,
// Step 1: compact elements of this subtree in the rightmost end, from right // to left. - dimension_type last_index_in_subtree = itr.index() + itr.get_offset() - 1; + dimension_type last_index_in_subtree + = itr.dfs_index() + itr.get_offset() - 1;
dimension_type first_unused = compact_elements_in_the_rightmost_end(last_index_in_subtree, subtree_size, key, value, !deleting);
// Step 2: redistribute the elements, from left to right. - redistribute_elements_in_subtree(itr.index(), subtree_size, + redistribute_elements_in_subtree(itr.dfs_index(), subtree_size, first_unused + 1, key, value, first_unused != last_index_in_subtree - subtree_size); @@ -1104,7 +1105,7 @@ PPL::CO_Tree::count_used_in_subtree(tree_iterator itr) { dimension_type n = 0;
const dimension_type k = itr.get_offset(); - const dimension_type root_index = itr.index(); + const dimension_type root_index = itr.dfs_index();
// The complete subtree rooted at itr has 2*k - 1 nodes.
diff --git a/src/CO_Tree.defs.hh b/src/CO_Tree.defs.hh index 3341b64..1501c77 100644 --- a/src/CO_Tree.defs.hh +++ b/src/CO_Tree.defs.hh @@ -1546,7 +1546,7 @@ public: \brief Returns the index of the current node in the DFS layout of the complete tree. */ - dimension_type index() const; + dimension_type dfs_index() const;
/*! \brief Returns 2^h, with h the height of the current node in the tree, diff --git a/src/CO_Tree.inlines.hh b/src/CO_Tree.inlines.hh index ce20bb6..91114b3 100644 --- a/src/CO_Tree.inlines.hh +++ b/src/CO_Tree.inlines.hh @@ -540,8 +540,8 @@ CO_Tree::iterator::swap(iterator& itr) {
inline CO_Tree::iterator& CO_Tree::iterator::operator=(const tree_iterator& itr) { - current_index = &(itr.tree.indexes[itr.index()]); - current_data = &(itr.tree.data[itr.index()]); + current_index = &(itr.tree.indexes[itr.dfs_index()]); + current_data = &(itr.tree.data[itr.dfs_index()]); #if PPL_CO_TREE_EXTRA_DEBUG tree = &(itr.tree); #endif @@ -850,7 +850,7 @@ CO_Tree::tree_iterator::operator->() const { }
inline dimension_type -CO_Tree::tree_iterator::index() const { +CO_Tree::tree_iterator::dfs_index() const { return i; }
participants (1)
-
Marco Poletti