From fb01d5df390a98313ca095a812fc240dc079d084 Mon Sep 17 00:00:00 2001 From: westcott Date: Fri, 15 May 2009 12:33:58 +0000 Subject: [PATCH] fixed bug in heatmap --- collectsharedcommand.cpp | 4 ++++ heatmap.cpp | 3 +++ sharedchao1.cpp | 5 +++++ sharedrabundvector.cpp | 4 ++-- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/collectsharedcommand.cpp b/collectsharedcommand.cpp index 06dbce7..4a3a338 100644 --- a/collectsharedcommand.cpp +++ b/collectsharedcommand.cpp @@ -142,8 +142,11 @@ int CollectSharedCommand::execute(){ util->updateGroupIndex(globaldata->Groups, globaldata->gGroupmap->groupIndex); while(order != NULL){ + orderList.insert(order->getLabel()); + if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){ + //create collectors curve cCurve = new Collect(order, cDisplays); convert(globaldata->getFreq(), freq); @@ -163,6 +166,7 @@ int CollectSharedCommand::execute(){ for(i = globaldata->labels.begin(); i != globaldata->labels.end(); ++i) if(orderList.count(*i) == 0) cout << "'" << *i << "'" << " is not a valid label.\n"; + for(int i=0;i& lookup){ } //clear out lookup to create sorted lookup + for (int j = 0; j < lookup.size(); j++) { + delete lookup[j]; + } lookup.clear(); //create and initialize lookup to empty vectors diff --git a/sharedchao1.cpp b/sharedchao1.cpp index 0df0eab..c3388fd 100644 --- a/sharedchao1.cpp +++ b/sharedchao1.cpp @@ -78,6 +78,11 @@ EstOutput SharedChao1::getValues(vector shared){ Chao += leftvalue + rightvalue; } + for (int i = 0; i < numNodes; i++) { + delete f1leaves[i]; + delete f2leaves[i]; + } + // cout << "exiting " << endl; data[0] = Chao; return data; diff --git a/sharedrabundvector.cpp b/sharedrabundvector.cpp index 1b8023d..a6ade30 100644 --- a/sharedrabundvector.cpp +++ b/sharedrabundvector.cpp @@ -78,7 +78,7 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0), holdLabel = label; //add new vector to lookup - lookup.push_back(new SharedRAbundVector(num)); + lookup.push_back(new SharedRAbundVector()); lookup[0]->setLabel(label); lookup[0]->setGroup(groupN); @@ -117,7 +117,7 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0), } //add new vector to lookup - lookup.push_back(new SharedRAbundVector(num)); + lookup.push_back(new SharedRAbundVector()); lookup[count]->setLabel(label); lookup[count]->setGroup(groupN); -- 2.39.2