]> git.donarmstrong.com Git - mothur.git/blobdiff - parsimony.cpp
finished sub.sample command
[mothur.git] / parsimony.cpp
index db6ed1d862d4ee3d9a4037b672ee63cdcacd03a6..efc7d3a4dfcdcb9db47dc24de5a7a412953a7aba 100644 (file)
@@ -34,7 +34,7 @@ EstOutput Parsimony::getValues(Tree* t) {
                
                int count = 0;
                for (int a=0; a<numGroups; a++) { 
-                       for (int l = a+1; l < numGroups; l++) {
+                       for (int l = 0; l < a; l++) {
                                int score = 0;
                                
                                //groups in this combo
@@ -49,6 +49,9 @@ EstOutput Parsimony::getValues(Tree* t) {
                                }
                
                                for(int i=copyTree->getNumLeaves();i<copyTree->getNumNodes();i++){
+                               
+                                       if (m->control_pressed) { return data; }
+                                       
                                        int lc = copyTree->tree[i].getLChild();
                                        int rc = copyTree->tree[i].getRChild();
                        
@@ -97,6 +100,9 @@ EstOutput Parsimony::getValues(Tree* t) {
 //                     map<string,int>::iterator it;
                        
                        for(int i=copyTree->getNumLeaves();i<copyTree->getNumNodes();i++){
+                       
+                               if (m->control_pressed) { return data; }
+                               
                                int lc = copyTree->tree[i].getLChild();
                                int rc = copyTree->tree[i].getRChild();
                        
@@ -123,7 +129,7 @@ EstOutput Parsimony::getValues(Tree* t) {
                return data;
        }
        catch(exception& e) {
-               errorOut(e, "Parsimony", "getValues");
+               m->errorOut(e, "Parsimony", "getValues");
                exit(1);
        }
 }