27 namespace treeTraversal {
40 if (!histogram.empty())
42 Histogram::const_iterator endIt = histogram.end();
44 const int largest = endIt->first;
45 for (
int bin = 0; bin <= largest; ++bin)
47 Histogram::const_iterator item = histogram.find(bin);
48 const int count = (item == histogram.end() ? 0 : *item->second);
49 outStream << bin <<
" " << count <<
"\n";
60 (*
stats->problemSizeHistogram[node->problemSize()]) ++;
61 (*
stats->numberOfChildrenHistogram[(
int)node->children.size()]) ++;
62 if (node->children.size() > 1)
64 int largestProblemSize = 0;
65 int secondLargestProblemSize = 0;
66 for(
const std::shared_ptr<NODE>& child: node->children)
68 if (child->problemSize() > largestProblemSize)
70 secondLargestProblemSize = largestProblemSize;
71 largestProblemSize = child->problemSize();
73 else if (child->problemSize() > secondLargestProblemSize)
75 secondLargestProblemSize = child->problemSize();
78 (*
stats->problemSizeOfSecondLargestChildHistogram[secondLargestProblemSize]) ++;
85 template<
class FOREST>
90 DepthFirstForest(forest, statsPtr, internal::statisticsVisitor<typename FOREST::Node>);