11 #ifndef TREE_POSITION_H
12 #define TREE_POSITION_H
17 #ifndef _GLIBCXX_STRING
39 : relpos_sum(relpos_sum_),
43 : relpos_sum(p1.relpos_sum + p2.relpos_sum),
44 count(p1.count + p2.count)
50 return relpos_sum / count;
60 typedef std::map<std::string, unsigned> PosMap;
65 size_t pos = spos.size();
66 spos[node->
name] = pos;
69 fillFromTree(node->get_leftson());
70 fillFromTree(node->get_rightson());
75 if (tree) fillFromTree(tree);
81 PosMap::const_iterator found = spos.find(name);
90 #error tree_position.h included twice
91 #endif // TREE_POSITION_H
static TreeRelativePosition unknown()
int compare(const TreeRelativePosition &right) const
TreePositionLookup(const TreeNode *tree)
TreeRelativePosition(double relpos_sum_)
TreeRelativePosition(const TreeRelativePosition &p1, const TreeRelativePosition &p2)
TreeRelativePosition relative(const char *name) const