X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=treenode.cpp;h=59fb630ef11373b671f48dfc72459dbc1fa78ad7;hb=c196b6b4768ccb84955d773ff0f22e4994d1ba7b;hp=7fff2c1deae9d687bba9f87229a4d7078cdc861d;hpb=9099173ea17b13be96563c7579ecc8dc2ef65d20;p=mothur.git diff --git a/treenode.cpp b/treenode.cpp index 7fff2c1..59fb630 100644 --- a/treenode.cpp +++ b/treenode.cpp @@ -18,6 +18,7 @@ Node::Node() { parent = -1; lchild = -1; rchild = -1; + length2leaf = 0.0; } /****************************************************************/ @@ -27,6 +28,8 @@ void Node::setGroup(string groups) { group =groups; } /****************************************************************/ void Node::setBranchLength(float l) { branchLength = l; } /****************************************************************/ +void Node::setLengthToLeaves(float l) { length2leaf = l; } +/****************************************************************/ void Node::setParent(int p) { parent = p; } /****************************************************************/ void Node::setIndex(int i) { vectorIndex = i; } @@ -39,6 +42,8 @@ string Node::getGroup() { return group; } /****************************************************************/ float Node::getBranchLength() { return branchLength; } /****************************************************************/ +float Node::getLengthToLeaves() { return length2leaf; } +/****************************************************************/ int Node::getParent() { return parent; } /****************************************************************/ int Node::getLChild() { return lchild; } @@ -64,7 +69,8 @@ void Node::printNode() { for(it=pcount.begin();it!=pcount.end();it++){ cout << ' ' << it->first << ':' << it->second; } - cout << endl; + cout << endl; + } catch(exception& e) {