[PPL-devel] [GIT] ppl/ppl(sparse_matrices): Unlimited_Sparse_Row_Over_CO_Tree: fix and add assertions in lower_bound_hint_assign() methods.
Marco Poletti
poletti.marco at gmail.com
Thu Apr 29 20:37:53 CEST 2010
Module: ppl/ppl
Branch: sparse_matrices
Commit: 2cf56c434df271eaa572391c61ad9e8b184a7f78
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=2cf56c434df271eaa572391c61ad9e8b184a7f78
Author: Marco Poletti <poletti.marco at gmail.com>
Date: Thu Apr 29 20:37:22 2010 +0200
Unlimited_Sparse_Row_Over_CO_Tree: fix and add assertions in lower_bound_hint_assign() methods.
---
src/Unlimited_Sparse_Row_Over_CO_Tree.inlines.hh | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/Unlimited_Sparse_Row_Over_CO_Tree.inlines.hh b/src/Unlimited_Sparse_Row_Over_CO_Tree.inlines.hh
index 8d3614a..ad737d0 100644
--- a/src/Unlimited_Sparse_Row_Over_CO_Tree.inlines.hh
+++ b/src/Unlimited_Sparse_Row_Over_CO_Tree.inlines.hh
@@ -510,8 +510,14 @@ Unlimited_Sparse_Row_Over_CO_Tree
tree.lower_bound(itr, i);
+#ifndef NDEBUG
+ CO_Tree::inorder_iterator itr2(&tree);
+ tree.lower_bound(itr2, i);
+ PPL_ASSERT(itr == itr2);
+#endif
+
if (itr->first < i)
- ++itr;
+ itr.get_next_value();
#ifndef NDEBUG
itr.get_previous_value();
@@ -535,8 +541,14 @@ Unlimited_Sparse_Row_Over_CO_Tree
tree.lower_bound(itr, i);
+#ifndef NDEBUG
+ CO_Tree::inorder_const_iterator itr2(&tree);
+ tree.lower_bound(itr2, i);
+ PPL_ASSERT(itr == itr2);
+#endif
+
if (itr->first < i)
- ++itr;
+ itr.get_next_value();
#ifndef NDEBUG
itr.get_previous_value();
More information about the PPL-devel
mailing list