X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=rarefact.cpp;h=cb4bbbce9a4047ae08b5f37b807be3f78c255d89;hb=599af78a6ea4916919d460a131e2d0dffa28d35e;hp=2f5f5067a388f1c9c6026a32cff81f003fec1106;hpb=c5c7502f435e1413c19e373dab1dfebcaa67588d;p=mothur.git diff --git a/rarefact.cpp b/rarefact.cpp index 2f5f506..cb4bbbc 100644 --- a/rarefact.cpp +++ b/rarefact.cpp @@ -52,11 +52,15 @@ void Rarefact::getCurve(int increment = 1, int nIters = 1000){ for(int i=0;ireset(); } + + delete lookup; + delete rank; } for(int i=0;iclose(); } + delete rcd; } catch(exception& e) { cout << "Standard Error: " << e.what() << " has occurred in the Rarefact class Function getCurve. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; @@ -114,10 +118,15 @@ try { //randomize the groups random_shuffle(lookup.begin(), lookup.end()); - + + vector subset; //send each group one at a time for (int k = 0; k < lookup.size(); k++) { - rcd->updateSharedData(lookup[0], lookup[k], k+1, numGroupComb); + subset.clear(); //clears out old pair of sharedrabunds + //add in new pair of sharedrabunds + subset.push_back(lookup[0]); subset.push_back(lookup[k]); + + rcd->updateSharedData(subset, k+1, numGroupComb); mergeVectors(lookup[0], lookup[k]); } @@ -125,12 +134,17 @@ try { for(int i=0;ireset(); } + + for (int i = 0; i < lookup.size(); i++) { + delete lookup[i]; + } } for(int i=0;iclose(); } - + + delete rcd; } catch(exception& e) { cout << "Standard Error: " << e.what() << " has occurred in the Rarefact class Function getSharedCurve. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";