/****************************************************************/
void Node::setName(string Name) { name = Name; }
/****************************************************************/
-//non leaf nodes will belong to multiple groups, leaf nodes will only belong to one.
-void Node::setGroup(string groups) { group.push_back(groups); }
+void Node::setGroup(string groups) { group =groups; }
/****************************************************************/
void Node::setBranchLength(float l) { branchLength = l; }
/****************************************************************/
/****************************************************************/
string Node::getName() { return name; }
/****************************************************************/
-vector<string> Node::getGroup() { return group; }
+string Node::getGroup() { return group; }
/****************************************************************/
float Node::getBranchLength() { return branchLength; }
/****************************************************************/
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) {