Version: 1.0
forest_statistics.h
Go to the documentation of this file.
1 // Copyright (c) 2020, the GRAPHGEN contributors, as
2 // shown by the AUTHORS file. All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
6 
7 #ifndef GRAPHGEN_FOREST_STATISTICS_H_
8 #define GRAPHGEN_FOREST_STATISTICS_H_
9 
10 #include <set>
11 
12 #include "forest.h"
13 
14 //class ForestStatistics {
15 // std::set<const BinaryDrag<conact>::node*> visited_nodes;
16 // std::set<const BinaryDrag<conact>::node*> visited_leaves;
17 //
18 // std::set<const BinaryDrag<conact>::node*> visited_end_nodes;
19 // std::set<const BinaryDrag<conact>::node*> visited_end_leaves;
20 //
21 // void PerformStatistics(const BinaryDrag<conact>::node *n) {
22 // if (n->isleaf()) {
23 // visited_leaves.insert(n);
24 // return;
25 // }
26 //
27 // if (visited_nodes.insert(n).second) {
28 // PerformStatistics(n->left);
29 // PerformStatistics(n->right);
30 // }
31 // }
32 //
33 // void PerformEndStatistics(const BinaryDrag<conact>::node *n) {
34 // if (n->isleaf()) {
35 // visited_end_leaves.insert(n);
36 // return;
37 // }
38 //
39 // if (visited_end_nodes.insert(n).second) {
40 // PerformEndStatistics(n->left);
41 // PerformEndStatistics(n->right);
42 // }
43 // }
44 //
45 //public:
46 // ForestStatistics(const LineForestHandler& f) {
47 // // Internal trees statistics
48 // for (const auto& t : f.trees_) {
49 // PerformStatistics(t.GetRoot());
50 // }
51 //
52 // // End trees statistics
53 // for (const auto& g : f.end_trees_) {
54 // for (const auto& t : g) {
55 // PerformEndStatistics(t.GetRoot());
56 // }
57 // }
58 // }
59 //
60 // auto nodes() const { return visited_nodes.size(); }
61 // auto leaves() const { return visited_leaves.size(); }
62 // auto end_nodes() const { return visited_end_nodes.size(); }
63 // auto end_leaves() const { return visited_end_leaves.size(); }
64 //};
65 //
66 //void PrintStats(const LineForestHandler& f);
67 
68 
69 #endif // !GRAPHGEN_FOREST_STATISTICS_H_