From 0e18aaf7ef15cc7054c3a09628394db88faba2fc Mon Sep 17 00:00:00 2001 From: Luca Padovani Date: Tue, 9 Nov 2004 07:37:38 +0000 Subject: [PATCH] * snapshot --- helm/papers/use_case/stats/stats.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/helm/papers/use_case/stats/stats.cc b/helm/papers/use_case/stats/stats.cc index 85ef8ba06..cab4326ce 100644 --- a/helm/papers/use_case/stats/stats.cc +++ b/helm/papers/use_case/stats/stats.cc @@ -3,6 +3,8 @@ #include #include +#include + namespace DOM = GdomeSmartDOM; unsigned n_elements; @@ -13,7 +15,7 @@ unsigned n_attributes; unsigned max_attributes; unsigned max_depth; unsigned max_children; -std::vector depths; +std::hash_map depths; std::vector widths; bool @@ -24,6 +26,16 @@ is_blank(const std::string& s) return true; } +void +add_depth(unsigned depth) +{ + std::hash_map::iterator p = depths.find(depth); + if (p != depths.end()) + p->end++; + else + depths[depth] = 1; +} + void visit(DOM::Node node, unsigned depth) { -- 2.39.2