]> git.donarmstrong.com Git - mothur.git/commitdiff
fixing minor bugs
authorwestcott <westcott>
Mon, 15 Jun 2009 19:13:51 +0000 (19:13 +0000)
committerwestcott <westcott>
Mon, 15 Jun 2009 19:13:51 +0000 (19:13 +0000)
22 files changed:
Mothur.xcodeproj/project.pbxproj
clustercommand.cpp
collectsharedcommand.cpp
engine.cpp
getoturepcommand.cpp
heatmapcommand.cpp
inputdata.cpp
parselistcommand.cpp
parselistcommand.h
rarefactsharedcommand.cpp
readotu.cpp
readotucommand.cpp
readotucommand.h
shared.cpp
shared.h
sharedcommand.cpp
sharedcommand.h
sharedlistvector.cpp
sharedlistvector.h
sharedrabundvector.cpp
sharedutilities.cpp
summarysharedcommand.cpp

index 8b890ae6b59a2088be0ac1b385d30620ef2a65ab..25e6296c919929232721518d587ba9da02c421c4 100644 (file)
                37D928A90F2133E5001D4494 /* commands */ = {
                        isa = PBXGroup;
                        children = (
-                               7E5A17AE0FE57292003C6A03 /* mergefilecommand.cpp */,
-                               7E5A17AD0FE57292003C6A03 /* mergefilecommand.h */,
                                37D927CD0F21331F001D4494 /* command.hpp */,
                                378DC5CD0FBDE1C8003B8607 /* aligncommand.h */,
                                378DC5CE0FBDE1C8003B8607 /* aligncommand.cpp */,
                                375873F30F7D648F0040F377 /* libshuffcommand.cpp */,
                                21E859D60FC4632E005E1A48 /* matrixoutputcommand.h */,
                                21E859D70FC4632E005E1A48 /* matrixoutputcommand.cpp */,
+                               7E5A17AD0FE57292003C6A03 /* mergefilecommand.h */,
+                               7E5A17AE0FE57292003C6A03 /* mergefilecommand.cpp */,
                                375873F70F7D649C0040F377 /* nocommands.h */,
                                375873F60F7D649C0040F377 /* nocommands.cpp */,
                                37D927FA0F21331F001D4494 /* parselistcommand.h */,
index 706ff6735b32d2f93c723a5f4af2d7a402b4bb75..4db95b45d00e3857513606383f05810f31a30ecd 100644 (file)
@@ -62,10 +62,10 @@ ClusterCommand::ClusterCommand(string option){
                        if (abort == false) {
                        
                                //get matrix, list and rabund for execute
-                               if(globaldata->gSparseMatrix != NULL)   {       matrix = new SparseMatrix(*globaldata->gSparseMatrix);          }
+                               if(globaldata->gSparseMatrix != NULL)   {       matrix = globaldata->gSparseMatrix;             }
                        
                                if(globaldata->gListVector != NULL){
-                                       list = new ListVector(*globaldata->gListVector);
+                                       list = globaldata->gListVector;
                                        rabund = new RAbundVector(list->getRAbundVector());
                                }
                                
@@ -121,8 +121,6 @@ void ClusterCommand::help(){
 
 ClusterCommand::~ClusterCommand(){
        delete cluster;
-       delete matrix;
-       delete list;
        delete rabund;
 }
 
index 36b0dc141406286b44130de699fea92f971d167f..6127c2d6da7717112fb2c7fdb5c82910f03f8323 100644 (file)
@@ -44,6 +44,7 @@ CollectSharedCommand::CollectSharedCommand(string option){
                lines.clear();
                labels.clear();
                Estimators.clear();
+               Groups.clear();
                
                //allow user to run help
                if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
@@ -106,8 +107,8 @@ CollectSharedCommand::CollectSharedCommand(string option){
                        if (groups == "not found") { groups = ""; }
                        else { 
                                splitAtDash(groups, Groups);
-                               globaldata->Groups = Groups;
                        }
+                       globaldata->Groups = Groups;
                        
                        string temp;
                        temp = validParameter.validFile(parameters, "freq", false);                     if (temp == "not found") { temp = "100"; }
@@ -242,16 +243,16 @@ int CollectSharedCommand::execute(){
                
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
-               set<string> userLabels = globaldata->labels;
-               set<int> userLines = globaldata->lines;
+               set<string> userLabels = labels;
+               set<int> userLines = lines;
                                
                //set users groups
                util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups, "collect");
                util->updateGroupIndex(globaldata->Groups, globaldata->gGroupmap->groupIndex);
 
-               while((order != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+               while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
 
-                       if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){
+                       if(allLines == 1 || lines.count(count) == 1 || labels.count(order->getLabel()) == 1){
                                
                                //create collectors curve
                                cCurve = new Collect(order, cDisplays);
index b0371378c29d72a7b37717e5c5d43cbc8f6ef23c..df65678912b1f3bd112e630b13ef934eebc5e219 100644 (file)
@@ -169,6 +169,7 @@ bool BatchEngine::getInput(){
                                }else {         cout << "Invalid." << endl;             }
                                
                        }
+                       gobble(inputBatchFile);
                }
                return 1;
        }
index 791889996a0ec1d7c726885d22eb7277388d7f14..35e6924414931a11a5b476e5ecd77a9622bad8c2 100644 (file)
@@ -91,7 +91,7 @@ GetOTURepCommand::GetOTURepCommand(string option){
                
                        if (abort == false) {
                        
-                               if(globaldata->gSparseMatrix != NULL)   {       matrix = new SparseMatrix(*globaldata->gSparseMatrix);          }       
+                               if(globaldata->gSparseMatrix != NULL)   {       matrix = globaldata->gSparseMatrix;             }       
                                        
                                //globaldata->gListVector bin 0 = first name read in distance matrix, globaldata->gListVector bin 1 = second name read in distance matrix
                                if(globaldata->gListVector != NULL)             {
index 766f7da570168ca456b0ca0a9356911fa5c93f80..d4e893b27edbda150ea961ddc3e6484d268a78c8 100644 (file)
@@ -128,7 +128,7 @@ void HeatMapCommand::help(){
 //**********************************************************************************************************************
 
 HeatMapCommand::~HeatMapCommand(){
-       delete input;
+       
        delete read;
        delete heatmap;
 }
@@ -276,6 +276,7 @@ int HeatMapCommand::execute(){
 
                }
                
+               delete input;
                return 0;
        }
        catch(exception& e) {
index 05eaaca210ce4fe1fc5413a6feb9a9347bb7206b..b237bb4fc55b0bacafa3815f9619f0345bd31492 100644 (file)
@@ -24,7 +24,7 @@ InputData::InputData(string fName, string f) : format(f){
 
 
 InputData::~InputData(){
-       
+       fileHandle.close();
 //     delete output;
        
 }
index c0622f219cc252be7ca0bf29d28ac349cddb3357..5de3b72daa63b962ff9be84b5665e7230fb2470b 100644 (file)
@@ -15,10 +15,8 @@ ParseListCommand::ParseListCommand(){
                globaldata = GlobalData::getInstance();
                
                //read in group map info.
-               groupMap = new GroupMap(globaldata->getGroupFile());
-               groupMap->readMap();
+               groupMap = globaldata->gGroupmap;
 
-               
                //fill filehandles with neccessary ofstreams
                int i;
                ofstream* temp;
@@ -86,7 +84,6 @@ void ParseListCommand::parse(int index, SharedListVector* list) {
 
 int ParseListCommand::execute(){
        try{
-                       globaldata = GlobalData::getInstance();
                        int count = 1;
                        
                        //read in listfile
@@ -100,10 +97,6 @@ int ParseListCommand::execute(){
                        set<string> processedLabels;
                        set<string> userLabels = globaldata->labels;
                        set<int> userLines = globaldata->lines;
-
-                       //read in group map info.
-                       groupMap = new GroupMap(globaldata->getGroupFile());
-                       groupMap->readMap();
                        
                        //create new list vectors to fill with parsed data
                        for (int i=0; i<groupMap->getNumGroups(); i++) {
@@ -163,6 +156,18 @@ int ParseListCommand::execute(){
                        if (globaldata->gGroupmap != NULL) { delete globaldata->gGroupmap; }
                        globaldata->gGroupmap = groupMap; 
                        
+                       //close files
+                       for (it3 = filehandles.begin(); it3 != filehandles.end(); it3++) { 
+                               ofstream* temp = it3->second;
+                               (*temp).close(); 
+                               delete it3->second;
+                       }
+                       
+                       //delete list vectors to fill with parsed data
+                       for (it2 = groupOfLists.begin(); it2 != groupOfLists.end(); it2++) {
+                               delete it2->second;
+                       }
+
                        return 0;
        }
        catch(exception& e) {
index 9f88bc6d9ddc28b4d9b713ade80663be2b7e56e6..b3a2f9c71c5a5657c5cef0ccb17c13e43dd673d5 100644 (file)
@@ -44,6 +44,7 @@ private:
        SharedListVector* list;
        map<string, string> listGroups; //maps group name to sequences from that group in a specific OTU
        map<string, string>::iterator it;
+       map<string, SharedListVector*>::iterator it2;
        map<string, ofstream*>::iterator it3;
        void parse(int, SharedListVector*);
        void process(SharedListVector*);
index d0179be91a5b2eac505632797a8ebb3f74232282..fdc967856043fc8e191c9b3167fb83634f82ec0a 100644 (file)
 RareFactSharedCommand::RareFactSharedCommand(string option){
        try {
                globaldata = GlobalData::getInstance();
+               
                abort = false;
                allLines = 1;
                lines.clear();
                labels.clear();
                Estimators.clear();
-               
+               Groups.clear();
+                               
                //allow user to run help
                if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; }
                
@@ -83,8 +85,8 @@ RareFactSharedCommand::RareFactSharedCommand(string option){
                        if (groups == "not found") { groups = ""; }
                        else { 
                                splitAtDash(groups, Groups);
-                               globaldata->Groups = Groups;
                        }
+                       globaldata->Groups = Groups;
                        
                        string temp;
                        temp = validParameter.validFile(parameters, "iters", false);                    if (temp == "not found") { temp = "1000"; }
@@ -176,7 +178,7 @@ int RareFactSharedCommand::execute(){
                input = globaldata->ginput;
                lookup = input->getSharedRAbundVectors();
                vector<SharedRAbundVector*> lastLookup = lookup;
-               
+
                if (lookup.size() < 2) { 
                        cout << "I cannot run the command without at least 2 valid groups."; 
                        for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
index 09a6c4cd00f58d5fc09424972c3f6ae93c88542d..286a2be271a4a7bb2225a71c7081b1a5c8eb4571 100644 (file)
@@ -31,21 +31,24 @@ void ReadOTUFile::read(GlobalData* globaldata){
                }else {//there is an orderfile
                        input = new InputData(philFile, globaldata->getOrderFile(), globaldata->getFormat());
                }
-               
+//cout << "made it here"       << endl;        
                //memory leak prevention
                //if (globaldata->ginput != NULL) { delete globaldata->ginput;  }
                globaldata->ginput = input;     //saving to be used by collector and rarefact commands.
-               
+//cout << "after input" << endl;               
                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(); 
+                       //if (globaldata->sabund != NULL) { delete globaldata->sabund;  }
                        globaldata->sabund = sabund; //saving to be used by summary command.
                        rabund = inputRabund->getRAbundVector(); 
+                       //if (globaldata->rabund != NULL) { delete globaldata->rabund;  }
                        globaldata->rabund = rabund; //saving to be used by heatmap.bin command.
                        list = inputList->getListVector();
+                       //if (globaldata->gListVector != NULL) { delete globaldata->gListVector;  }
                        globaldata->gListVector = list;
 
                }else if (globaldata->getFormat() == "shared") {
index 7c3e1995ecf9315839b5f26ab9f7768d59e6ca08..ba7eae42a668e7fa9bf3a9f8d33c4746b55ce810 100644 (file)
@@ -106,7 +106,7 @@ ReadOtuCommand::ReadOtuCommand(string option){
                        if (abort == false) {
                                //gets whichever one of the above is set
                                filename = globaldata->inputFileName;
-                               read = new ReadOTUFile(filename);
+                               //read = new ReadOTUFile(filename);
                        }
 
                }
@@ -155,7 +155,8 @@ void ReadOtuCommand::help(){
 //**********************************************************************************************************************
 
 ReadOtuCommand::~ReadOtuCommand(){
-       if (abort == false) {  delete read;  }
+       if (abort == false) {  //delete read; 
+        }
 }
 
 //**********************************************************************************************************************
@@ -165,17 +166,20 @@ int ReadOtuCommand::execute(){
        
                if (abort == true) {    return 0;       }
                
-               read->read(&*globaldata); 
+               //read->read(&*globaldata); 
                if (globaldata->getFormat() == "shared") {
                        groupMap->readMap();
                        
                        //if (globaldata->gGroupmap != NULL) { delete globaldata->gGroupmap;  }
-                       globaldata->gGroupmap = groupMap;               
-                       shared = new SharedCommand();
-                       shared->execute();
-
+                       globaldata->gGroupmap = groupMap;
+                       
                        parselist = new ParseListCommand();
                        parselist->execute();
+                       delete parselist;
+                       
+                       shared = new SharedCommand();
+                       shared->execute();
+                       delete shared;
                        
                        //change format to shared  to speed up commands
                        globaldata->setFormat("sharedfile");
index c38d0a5f3d38916681db8b254fe11b5c9eec03f2..e07dadc1713989455a7fa1f35b6cdaa6767abf6c 100644 (file)
@@ -40,7 +40,7 @@ public:
        
 private:
        GlobalData* globaldata;
-       ReadOTUFile* read;
+       //ReadOTUFile* read;
        InputData* input;
        Command* shared;
        Command* parselist;
index 73f283ae7b697c95ec5eacf5195a809162ca94a8..36dbbb1117067253b04150cbf5a4c6f592906861 100644 (file)
@@ -21,6 +21,7 @@ void Shared::getSharedVectors(SharedListVector* list) {
                int i,j;
                label = list->getLabel();
                
+               for (it = sharedGroups.begin(); it != sharedGroups.end(); it++) {  delete it->second;  }
                sharedGroups.clear();  //removes old info.
                
                //initalize sharedGroups 
index 06d558d2deebf3af2cda8fb7f2193a39b932d2f2..c80ef6606216b6747f0d407cf1895ebbb33ed22e 100644 (file)
--- a/shared.h
+++ b/shared.h
@@ -24,6 +24,7 @@ class Shared {
                
        private:
                GlobalData* globaldata;
+               map<string, SharedRAbundVector*>::iterator it;
                void parse(int, SharedListVector*);
                vector< map<string, SharedRAbundVector*> > sharedRAbund;  //contains all the info needed to create the .shared file not sure if we will need 
 };
index 22dc2e9f7ab15a671f4a3dd699ca570655b688a4..dd900643a741d576d1595c1a9c346d6b6c334361 100644 (file)
@@ -36,15 +36,19 @@ SharedCommand::SharedCommand(){
 int SharedCommand::execute(){
        try {
                globaldata = GlobalData::getInstance();
+               //lookup.clear();
                int count = 1;
                string errorOff = "no error";
                        
                //read in listfile
                read = new ReadOTUFile(globaldata->inputFileName);      
                read->read(&*globaldata); 
+
                input = globaldata->ginput;
                SharedList = globaldata->gSharedList;
                SharedListVector* lastList = SharedList;
+               //lookup = SharedList->getSharedRAbundVector();
+               //vector<SharedRAbundVector*> lastLookup = lookup;
                
                //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
                set<string> processedLabels;
@@ -55,9 +59,9 @@ int SharedCommand::execute(){
                
                while((SharedList != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
                        
-                                               
+
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(SharedList->getLabel()) == 1){
-                       
+                                       
                                        shared->getSharedVectors(SharedList); //fills sharedGroups with new info and updates sharedVector
                                        printSharedData(); //prints info to the .shared file
                                
@@ -76,8 +80,11 @@ int SharedCommand::execute(){
                        
                        if (count != 1) { delete lastList; }
                        lastList = SharedList;                  
-
                        SharedList = input->getSharedListVector(); //get new list vector to process
+                       
+                       //if (count != 1) { for (int i = 0; i < lastLookup.size(); i++) {  delete lastLookup[i];  } }
+                       //lastLookup = lookup; 
+                       //if (SharedList != NULL) { lookup = SharedList->getSharedRAbundVector(); }
                }
                
                //output error messages about any remaining user labels
@@ -101,6 +108,7 @@ int SharedCommand::execute(){
                
                delete lastList;
                delete shared;
+               out.close();
                
                return 0;
        }
@@ -117,6 +125,12 @@ int SharedCommand::execute(){
 //**********************************************************************************************************************
 void SharedCommand::printSharedData() {
        try {
+       
+               ///for (int i = 0; i < thislookup.size(); i++) {
+               //      out << thislookup[i]->getLabel() << '\t' << thislookup[i]->getGroup() << '\t';
+//cout << thislookup[i]->getLabel() << '\t' << thislookup[i]->getGroup() << endl;                      
+               //      thislookup[i]->print(out);
+       //      }
                //prints out horizontally
                for (it = shared->sharedGroups.begin(); it != shared->sharedGroups.end(); it++) {
                        out << it->second->getLabel() << "\t" << it->first << "\t"; //prints out label and groupname
index 08314b56590b70dcb56b29f0c08a454da9ebac5d..e5be50a8b9f80488449db640e65721d32f395a5d 100644 (file)
@@ -40,6 +40,7 @@ private:
        InputData* input;
        Shared* shared;
        map<string, SharedRAbundVector*>::iterator it;
+       //vector<SharedRAbundVector*> lookup;
        ofstream out;
        string filename;
 
index 33d3692659fefde48883e83dd0c7dcaf3fbdb67e..4774180dd6032c0de1b87597360af6d14e7c2a2d 100644 (file)
 
 /***********************************************************************/
 
-SharedListVector::SharedListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){}
+SharedListVector::SharedListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){globaldata = GlobalData::getInstance();}
 
 /***********************************************************************/
 
-SharedListVector::SharedListVector(int n):     DataVector(), data(n, "") , maxRank(0), numBins(0), numSeqs(0){}
+SharedListVector::SharedListVector(int n):     DataVector(), data(n, "") , maxRank(0), numBins(0), numSeqs(0){globaldata = GlobalData::getInstance();}
 
 /***********************************************************************/
 SharedListVector::SharedListVector(ifstream& f) : DataVector(), maxRank(0), numBins(0), numSeqs(0) {
@@ -272,6 +272,7 @@ SharedRAbundVector SharedListVector::getSharedRAbundVector(string groupName) {
                
                rav.setLabel(label);
                rav.setGroup(groupName);
+
                return rav;
                
        }
@@ -292,6 +293,8 @@ vector<SharedRAbundVector*> SharedListVector::getSharedRAbundVector() {
                vector<SharedRAbundVector*> lookup;
                
                util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups);
+               
+               delete util;
 
                for (int i = 0; i < globaldata->Groups.size(); i++) {
                        SharedRAbundVector* temp = new SharedRAbundVector();
index 8cfb7e000a9427921ce9e951c040c06c50cc71d8..2c8d01bf4c257a715f789412a4391169138af9b6 100644 (file)
@@ -33,7 +33,7 @@ public:
        SharedListVector();
        SharedListVector(int);
        SharedListVector(ifstream&);
-       SharedListVector(const SharedListVector& lv) : DataVector(lv.label), data(lv.data), maxRank(lv.maxRank), numBins(lv.numBins), numSeqs(lv.numSeqs){};
+       SharedListVector(const SharedListVector& lv) : DataVector(lv.label), data(lv.data), maxRank(lv.maxRank), numBins(lv.numBins), numSeqs(lv.numSeqs){globaldata = GlobalData::getInstance();};
        ~SharedListVector(){};
        
        int getNumBins()                                                        {       return numBins;         }
index 135763e49ad192911497434ff3aeeddcd5cfd5ed..f60562a75a5202a366a6bf9cbd831421133feab0 100644 (file)
 
 /***********************************************************************/
 
-SharedRAbundVector::SharedRAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0) {}
+SharedRAbundVector::SharedRAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0) {globaldata = GlobalData::getInstance();}
 
 /***********************************************************************/
 
 SharedRAbundVector::SharedRAbundVector(int n) : DataVector(), maxRank(0), numBins(n), numSeqs(0) {
+               globaldata = GlobalData::getInstance();
                individual newGuy;
                //initialize data
                for (int i=0; i< n; i++) {
index 703241b532504ac6f4ab3b761507b089e41c58a5..de627c643c9ff277854a1d8b8ffcb595004d0a85 100644 (file)
@@ -66,7 +66,6 @@ void SharedUtil::getSharedVectorswithReplacement(vector<string> Groups, vector<S
                for (int j = 0; j < lookup.size(); j++) {
                        delete lookup[j];
                }
-               
                lookup.clear();
                
                //create and initialize vector of sharedvectors, one for each group
@@ -111,7 +110,6 @@ void SharedUtil::getSharedVectorswithReplacement(vector<string> Groups, vector<S
 //need to have mode because different commands require different number of valid groups
 void SharedUtil::setGroups(vector<string>& userGroups, vector<string>& allGroups) {
        try {
-//cout << "groups size" << userGroups.size() << endl;
                if (userGroups.size() != 0) {
                        if (userGroups[0] != "all") {
                                //check that groups are valid
index a32b202d827d8df18c5696c3fc9ace85f3ddbf22..7c1275f3a8ea9977a39e5294fa7ac330de59d857 100644 (file)
@@ -64,10 +64,8 @@ SummarySharedCommand::SummarySharedCommand(string option){
                        
                        //make sure the user has already run the read.otu command
                        if (globaldata->getSharedFile() == "") {
-                               if (globaldata->getListFile() == "") { cout << "You must read a list and a group, or a shared before you can use the summary.shared command." << endl; abort = true; }
-                               else if (globaldata->getGroupFile() == "") { cout << "You must read a list and a group, or a shared before you can use the summary.shared command." << endl; abort = true; }
+                                cout << "You must read a list and a group, or a shared before you can use the summary.shared command." << endl; abort = true; 
                        }
-
                        
                        //check for optional parameter and set defaults
                        // ...at some point should added some additional type checking...
@@ -163,11 +161,9 @@ SummarySharedCommand::SummarySharedCommand(string option){
                                
                                outputFileName = ((getRootName(globaldata->inputFileName)) + "shared.summary");
                                openOutputFile(outputFileName, outputFileHandle);
-//                             format = globaldata->getFormat();
                                mult = false;
                        }
                }
-
        }
        catch(exception& e) {
                cout << "Standard Error: " << e.what() << " has occurred in the SummarySharedCommand class Function SummarySharedCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
@@ -208,7 +204,6 @@ void SummarySharedCommand::help(){
 //**********************************************************************************************************************
 
 SummarySharedCommand::~SummarySharedCommand(){
-       delete input;
        delete read;
        delete validCalculator;
 }
@@ -337,6 +332,10 @@ int SummarySharedCommand::execute(){
                //close files
                outputFileHandle.close();
                if (mult == true) {  outAll.close();  }
+               
+               for(int i=0;i<sumCalculators.size();i++){  delete sumCalculators[i]; }
+               
+               delete input;
 
                return 0;
        }