X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sharedlistvector.cpp;h=2dc4502cd4523a3b679abcc3d3e3156ea60b0ab9;hb=d873f7bf94309317a08c8757e0d0d60b06fbd473;hp=00aef79584951ca468249648bd574ad1c7d42af0;hpb=bfbc55964f1977da72c2cea984288a427d370a59;p=mothur.git diff --git a/sharedlistvector.cpp b/sharedlistvector.cpp index 00aef79..2dc4502 100644 --- a/sharedlistvector.cpp +++ b/sharedlistvector.cpp @@ -14,9 +14,9 @@ using namespace std; #include "sabundvector.hpp" #include "rabundvector.hpp" #include "ordervector.hpp" -#include "utilities.hpp" #include "sharedlistvector.h" #include "sharedordervector.h" +#include "sharedutilities.h" /***********************************************************************/ @@ -234,7 +234,10 @@ SharedOrderVector* SharedListVector::getSharedOrderVector(){ groupName = groupmap->getGroup(names); order->push_back(i, binSize, groupName); } + random_shuffle(order->begin(), order->end()); + order->updateStats(); + return order; } catch(exception& e) { @@ -285,6 +288,33 @@ SharedRAbundVector SharedListVector::getSharedRAbundVector(string groupName) { exit(1); } } +/***********************************************************************/ +vector SharedListVector::getSharedRAbundVector() { + try { + SharedUtil* util; + util = new SharedUtil(); + vector lookup; + + util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups); + + for (int i = 0; i < globaldata->Groups.size(); i++) { + SharedRAbundVector* temp = new SharedRAbundVector(); + *temp = getSharedRAbundVector(globaldata->Groups[i]); + lookup.push_back(temp); + } + + return lookup; + } + catch(exception& e) { + cout << "Standard Error: " << e.what() << " has occurred in the SharedListVector class Function getSharedRAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + exit(1); + } + catch(...) { + cout << "An unknown error has occurred in the SharedListVector class function getSharedRAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + exit(1); + } + +} /***********************************************************************/ SharedSAbundVector SharedListVector::getSharedSAbundVector(string groupName) {