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"
if(square == 0){
- reading = new Progress("Reading matrix: ", nseqs * (nseqs - 1) / 2);
+ reading = new Progress("Reading matrix: ", nseqs * (nseqs - 1) / 2);
int index = 0;
}
else{
- reading = new Progress("Reading matrix: ", nseqs * nseqs);
+ reading = new Progress("Reading matrix: ", nseqs * nseqs);
int index = nseqs;
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
//you have two inputs because in the next if statement if you only have one then it moves ahead in the same file.
//So when you run the collect or summary commands you miss a line.
input = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund.
- inputSabund = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund.
+ inputSabund = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund or shared.
}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->getGroupFile() == "") {//you are reading a list, rabund or sabund file for collect, rarefaction or summary.
+ 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 {
- SharedList = input->getSharedListVector(); //you are reading for parselist command, or shared commands.
+ }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;
}
}