From: Luca Padovani Date: Tue, 9 Nov 2004 07:37:38 +0000 (+0000) Subject: * snapshot X-Git-Tag: v_0_6_4_1~18 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=0e18aaf7ef15cc7054c3a09628394db88faba2fc;p=helm.git * snapshot --- 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) {