/* print out a node (test function) Parmas: node - node to print indent - indent level Notes: recursive */ static void printnewicknode(NEWICKNODE *node, int indent) { int i; for(i=0;i<indent;i++) printf(" "); printf("%s : %f\n", node->label, node->weight); for(i=0;i<node->Nchildren;i++) printnewicknode(node->child[i], indent + 5); }
/* print out a node (test function) Parmas: node - node to print indent - indent level Notes: recursive */ void TreeOPE::printnewicknode(NEWICKNODE *node, int indent) { int i; for(i=0;i<indent;i++) cout << " "; cout << (long) node << ":"; if(node->label == NULL) cout << "NULL"; else cout << node->label; cout << " : " << node->weight << " : " << node->Nchildren << endl; for(i=0;i<node->Nchildren;i++) printnewicknode(node->child[i], indent + 5); }
/* print the Newick tree in a human-readable format (test function) Params: tree - the tree */ void printnewicktree(NEWICKTREE *tree) { printnewicknode(tree->root, 0); }
void TreeOPE::printnewicktree(const NEWICKTREE *tree) { printnewicknode(tree->root, 0); }