- unsigned tot_depth = 0;
- for (std::vector<unsigned>::const_iterator p = depths.begin(); p != depths.end(); p++)
- tot_depth += *p;
-
- unsigned tot_width = 0;
- for (std::vector<unsigned>::const_iterator p = widths.begin(); p != widths.end(); p++)
- tot_width += *p;
+ int n_depths = 0;
+ int tot_depth = 0;
+ int max_depth = 0;
+ for (stdx::hash_map<int,int>::const_iterator p = depths.begin(); p != depths.end(); p++)
+ {
+ n_depths += p->second;
+ tot_depth += p->first * p->second;
+ max_depth = std::max(max_depth, p->first);
+ }
+
+ int tot_width = 0;
+ for (std::vector<int>::const_iterator p = widths.begin(); p != widths.end(); p++)
+ tot_width += *p;