]> git.donarmstrong.com Git - mothur.git/blobdiff - readmatrix.cpp
fixed libshuff signif. values
[mothur.git] / readmatrix.cpp
index 72dd799ec6d2e419dd843db6288de313fa0b4078..529eef5c7cf8b70e12f30dde6b4c2b661a01207f 100644 (file)
@@ -9,15 +9,11 @@
 
 using namespace std;
 
-#include <string>
-#include <map>
 #include "utilities.hpp"
 #include "sparsematrix.hpp"
 #include "progress.hpp"
 #include "listvector.hpp"
 #include "rabundvector.hpp"
-#include <exception>
-
 #include "readmatrix.hpp"
 
 
@@ -73,7 +69,7 @@ void ReadPhylipMatrix::read(NameAssignment* nameMap){
        
                        if(square == 0){
 
-                               reading = new Progress("Reading matrix:    ", nseqs * (nseqs - 1) / 2);
+                               reading = new Progress("Reading matrix:     ", nseqs * (nseqs - 1) / 2);
                
                                int     index = 0;
                
@@ -115,7 +111,7 @@ void ReadPhylipMatrix::read(NameAssignment* nameMap){
                        }
                        else{
 
-                               reading = new Progress("Reading matrix:    ", nseqs * nseqs);
+                               reading = new Progress("Reading matrix:     ", nseqs * nseqs);
                        
                                int index = nseqs;
                
@@ -206,7 +202,7 @@ void ReadColumnMatrix::read(NameAssignment* nameMap){
 
                        list = new ListVector(nameMap->getListVector());
                
-                       Progress* reading = new Progress("Reading matrix:    ", nseqs * nseqs);
+                       Progress* reading = new Progress("Reading matrix:     ", nseqs * nseqs);
        
                        int lt = 1;
                        int refRow = 0; //we'll keep track of one cell - Cell(refRow,refCol) - and see if it's transpose
@@ -350,15 +346,22 @@ void ReadPhilFile::read(GlobalData* globaldata){
                }else {//there is an orderfile
                        input = new InputData(philFile, globaldata->getOrderFile(), globaldata->getFormat());
                }
+               
+               //memory leak prevention
+               //if (globaldata->ginput != NULL) { delete globaldata->ginput;  }
                globaldata->ginput = input;     //saving to be used by collector and rarefact commands.
                
                if ((globaldata->getFormat() == "list") || (globaldata->getFormat() == "rabund") || (globaldata->getFormat() == "sabund")) {//you are reading a list, rabund or sabund file for collect, rarefaction or summary.
                        order = input->getOrderVector();
+                       //memory leak prevention
+                       //if (globaldata->gorder != NULL) { delete globaldata->gorder;  }
                        globaldata->gorder = order;     //saving to be used by collect and rarefact commands.
                        sabund = inputSabund->getSAbundVector(); 
                        globaldata->sabund = sabund; //saving to be used by summary command.
                }else if (globaldata->getFormat() == "shared") {
                        SharedList = input->getSharedListVector(); //you are reading for collect.shared, rarefaction.shared, summary.shared, parselist command, or shared commands.
+                       //memory leak prevention
+                       //if (globaldata->gSharedList != NULL) { delete globaldata->gSharedList;  }
                        globaldata->gSharedList = SharedList;
                }
        }