[PPL-devel] [GIT] ppl/ppl(master): CO_Tree: add a max_size() static method.
Marco Poletti
poletti.marco at gmail.com
Sat Oct 16 17:51:44 CEST 2010
Module: ppl/ppl
Branch: master
Commit: 3d535b8db149168861bfbb0b9d5880d01d14b4d0
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=3d535b8db149168861bfbb0b9d5880d01d14b4d0
Author: Marco Poletti <poletti.marco at gmail.com>
Date: Sat Oct 16 17:13:35 2010 +0200
CO_Tree: add a max_size() static method.
---
src/CO_Tree.defs.hh | 3 +++
src/CO_Tree.inlines.hh | 5 +++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/CO_Tree.defs.hh b/src/CO_Tree.defs.hh
index 76ff01c..787acd6 100644
--- a/src/CO_Tree.defs.hh
+++ b/src/CO_Tree.defs.hh
@@ -530,6 +530,9 @@ public:
*/
dimension_type size() const;
+ //! Returns the size() of the largest possible CO_Tree.
+ static dimension_type max_size();
+
//! Dumps the tree to stdout, for debugging purposes.
void dump_tree() const;
diff --git a/src/CO_Tree.inlines.hh b/src/CO_Tree.inlines.hh
index de0d8f5..a6a4a88 100644
--- a/src/CO_Tree.inlines.hh
+++ b/src/CO_Tree.inlines.hh
@@ -96,6 +96,11 @@ CO_Tree::size() const {
return size_;
}
+inline dimension_type
+CO_Tree::max_size() {
+ return (-dimension_type(1))/100;
+}
+
inline void
CO_Tree::dump_tree() const {
if (empty())
More information about the PPL-devel
mailing list