5 * Created by Sarah Westcott on 1/26/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "parsimony.h"
12 /**************************************************************************************************/
14 EstOutput Parsimony::getValues(Tree* t) {
16 globaldata = GlobalData::getInstance();
22 //create pgroups that reflect the groups the user want to use
23 for(int i=t->getNumLeaves();i<t->getNumNodes();i++){
24 t->tree[i].pGroups = (t->mergeUserGroups(i));
27 for(int i=t->getNumLeaves();i<t->getNumNodes();i++){
28 int lc = t->tree[i].getLChild();
29 int rc = t->tree[i].getRChild();
31 int iSize = t->tree[i].pGroups.size();
32 int rcSize = t->tree[rc].pGroups.size();
33 int lcSize = t->tree[lc].pGroups.size();
35 //if isize are 0 then that branch is to be ignored
37 else if ((rcSize == 0) || (lcSize == 0)) { }
38 //if you have more groups than either of your kids then theres been a change.
39 else if(iSize > rcSize || iSize > lcSize){
50 cout << "Standard Error: " << e.what() << " has occurred in the Parsimony class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
54 cout << "An unknown error has occurred in the Parsimony class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
60 /**************************************************************************************************/