X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=unweighted.cpp;fp=unweighted.cpp;h=a75ddc54058f878f63c579a4834754cb3890a374;hb=f3edf14c46814ca437960f0e1070abfbea582c26;hp=08e83ec5ba4ccbbbefe36163c25d1075fb05a883;hpb=ec5c537e869028c49231dab9a37c00a9edf70723;p=mothur.git diff --git a/unweighted.cpp b/unweighted.cpp index 08e83ec..a75ddc5 100644 --- a/unweighted.cpp +++ b/unweighted.cpp @@ -199,14 +199,14 @@ EstOutput Unweighted::driver(Tree* t, vector< vector > namesOfGroupCombo m->mothurOut(namesOfGroupCombos[h][namesOfGroupCombos[h].size()-1]); m->mothurOut(", skipping."); m->mothurOutEndLine(); results[count] = UW; }else{ - + //cout << "trying to get root" << endl; //if including the root this clears rootForGrouping[namesOfGroupCombos[h]] getRoot(t, nodeBelonging, namesOfGroupCombos[h]); - + //cout << "here" << endl; for(int i=0;igetNumNodes();i++){ if (m->control_pressed) { return data; } - + //cout << i << endl; //pcountSize = 0, they are from a branch that is entirely from a group the user doesn't want //pcountSize = 2, not unique to one group //pcountSize = 1, unique to one group @@ -497,17 +497,18 @@ EstOutput Unweighted::driver(Tree* t, vector< vector > namesOfGroupCombo int Unweighted::getRoot(Tree* t, int v, vector grouping) { try { //you are a leaf so get your parent - int index = t->tree[index].getParent(); + int index = t->tree[v].getParent(); if (includeRoot) { rootForGrouping[grouping].clear(); }else { + //my parent is a potential root rootForGrouping[grouping].insert(index); //while you aren't at root while(t->tree[index].getParent() != -1){ - + //cout << index << endl; if (m->control_pressed) { return 0; } //am I the root for this grouping? if so I want to stop "early"