]> git.donarmstrong.com Git - mothur.git/blobdiff - parsimonycommand.cpp
put back no command and worked on libshuff
[mothur.git] / parsimonycommand.cpp
index c7340c7b1704c585b70e2677c0701aaf7edb4e33..493af9b867e5542ee4c4c93acfa6c40a9c95fc5a 100644 (file)
@@ -166,7 +166,11 @@ int ParsimonyCommand::execute() {
                if (randomtree == "") { printUSummaryFile(); }
                
                //reset globaldata's treemap if you just did random distrib
-               if (randomtree != "") { globaldata->gTreemap = savetmap; }
+               if (randomtree != "") {
+                       //memory leak prevention
+                       //if (globaldata->gTreemap != NULL) { delete globaldata->gTreemap;  }
+                       globaldata->gTreemap = savetmap;
+               }
                
                //reset randomTree parameter to ""
                globaldata->setRandomTree("");
@@ -237,8 +241,8 @@ void ParsimonyCommand::printUSummaryFile() {
                for (int i = 0; i< T.size(); i++) {
                        for(int a = 0; a < numComp; a++) {
                                if (UScoreSig[a][i] > (1/(float)iters)) {
-                                       outSum << setprecision(6) << i+1 << '\t' << groupComb[a] << '\t' << '\t' << userTreeScores[a][i] << setprecision(globaldata->getIters().length()) << '\t' << UScoreSig[a][i] << endl;
-                                       cout << setprecision(6) << i+1 << '\t' << groupComb[a] << '\t' << '\t' << userTreeScores[a][i] << setprecision(globaldata->getIters().length()) << '\t' << UScoreSig[a][i] << endl;
+                                       outSum << setprecision(6) << i+1 << '\t' << groupComb[a]  << '\t' << userTreeScores[a][i] << setprecision(globaldata->getIters().length()) << '\t' << UScoreSig[a][i] << endl;
+                                       cout << setprecision(6) << i+1 << '\t' << groupComb[a]  << '\t' << userTreeScores[a][i] << setprecision(globaldata->getIters().length()) << '\t' << UScoreSig[a][i] << endl;
                                }else {
                                        outSum << setprecision(6) << i+1 << '\t' << groupComb[a] << '\t' << userTreeScores[a][i] << setprecision(globaldata->getIters().length())  << '\t' << "<" << (1/float(iters)) << endl;
                                        cout << setprecision(6) << i+1 << '\t' << groupComb[a] << '\t' << userTreeScores[a][i] << setprecision(globaldata->getIters().length()) << '\t' << "<" << (1/float(iters)) << endl;
@@ -293,6 +297,8 @@ void ParsimonyCommand::getUserInput() {
                getline(cin, s);
                
                //save tmap for later
+               //memory leak prevention
+               //if (globaldata->gTreemap != NULL) { delete globaldata->gTreemap;  }
                globaldata->gTreemap = tmap;
                
        }