5 * Created by Sarah Westcott on 1/23/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
13 /****************************************************************/
23 /****************************************************************/
24 void Node::setName(string Name) { name = Name; }
25 /****************************************************************/
26 //non leaf nodes will belong to multiple groups, leaf nodes will only belong to one.
27 void Node::setGroup(string groups) { group.push_back(groups); }
28 /****************************************************************/
29 void Node::setBranchLength(float l) { branchLength = l; }
30 /****************************************************************/
31 void Node::setParent(int p) { parent = p; }
32 /****************************************************************/
33 void Node::setIndex(int i) { vectorIndex = i; }
34 /****************************************************************/
35 void Node::setChildren(int lc, int rc) { lchild = lc; rchild = rc; } //leftchild, rightchild
36 /****************************************************************/
37 string Node::getName() { return name; }
38 /****************************************************************/
39 vector<string> Node::getGroup() { return group; }
40 /****************************************************************/
41 float Node::getBranchLength() { return branchLength; }
42 /****************************************************************/
43 int Node::getParent() { return parent; }
44 /****************************************************************/
45 int Node::getLChild() { return lchild; }
46 /****************************************************************/
47 int Node::getRChild() { return rchild; }
48 /****************************************************************/
49 int Node::getIndex() { return vectorIndex; }
50 /****************************************************************/
51 //to be used by printTree in the Tree class to print the leaf info
52 void Node::printNode(ostream& out) {
56 //there is a branch length
57 if (branchLength != -1) {
58 out << ":" << setprecision(4) << branchLength;
63 cout << "Standard Error: " << e.what() << " has occurred in the Node class Function printNode. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
67 cout << "An unknown error has occurred in the Node class function printNode. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
71 /****************************************************************/