X-Git-Url: https://ruin.nu/git/index.pl?a=blobdiff_plain;ds=sidebyside;f=src%2Fcomponenttree.h;h=84d6270218101fbde5c71c01468837d577dae18d;hb=4462cded18dd80075c3622e5a87ca6f5f3c84f62;hp=816059c29b7fe3c14463bbaf023c905b2907f834;hpb=43b1052d74a207fe667b75e41d0c70c1189c2cc8;p=germs.git diff --git a/src/componenttree.h b/src/componenttree.h index 816059c..84d6270 100644 --- a/src/componenttree.h +++ b/src/componenttree.h @@ -25,8 +25,14 @@ #include #include "misc.h" +/** + * Creates and holds a component tree. + */ class ComponentTree { public: + /** + * A node in the component tree. + */ struct Node { Node(Node* parent, Component comp); ~Node(); @@ -49,8 +55,17 @@ class ComponentTree { */ void makeUnoriented(); + /** + * Count the number of leaves in the component tree. + * This is the number of hurdles, if makeUnoriented has been called. + */ size_t countLeaves(); + /** + * Number of short branches. + * If makeUnoriented has been called and countLeaves is >= 3 + * then we have a super hurdle if short branches = 0. + */ size_t shortBranches(); private: