parent = -1;
lchild = -1;
rchild = -1;
+ length2leaf = 0.0;
}
/****************************************************************/
/****************************************************************/
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; }
/****************************************************************/
float Node::getBranchLength() { return branchLength; }
/****************************************************************/
+float Node::getLengthToLeaves() { return length2leaf; }
+/****************************************************************/
int Node::getParent() { return parent; }
/****************************************************************/
int Node::getLChild() { return lchild; }
int Node::getIndex() { return vectorIndex; }
/****************************************************************/
//to be used by printTree in the Tree class to print the leaf info
-void Node::printNode(ostream& out) {
+void Node::printNode() {
try{
- out << name;
-
+ cout << parent << ' ' << lchild << ' ' << rchild << ' ' << group;
//there is a branch length
if (branchLength != -1) {
- out << ":" << setprecision(4) << branchLength;
+ cout << ' ' << setprecision(4) << branchLength;
}
+ cout << " |";
+ map<string, int>::iterator it;
+ for(it=pGroups.begin();it!=pGroups.end();it++){
+ cout << ' ' << it->first << ':' << it->second;
+ }
+ cout << " |";
+ for(it=pcount.begin();it!=pcount.end();it++){
+ cout << ' ' << it->first << ':' << it->second;
+ }
+ cout << endl;
+
}
catch(exception& e) {