X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sharedordervector.h;h=3568450d3059e231c310e18e7073b434516f7c07;hb=134a9c1275862a6b3ea10a2c0f11965c0a535854;hp=94d91c5756da05a608253694a307ad6ea931baed;hpb=09a01fb51eea9e81409d367410c831394193fd86;p=mothur.git diff --git a/sharedordervector.h b/sharedordervector.h index 94d91c5..3568450 100644 --- a/sharedordervector.h +++ b/sharedordervector.h @@ -2,7 +2,7 @@ #define SHAREDORDER_H /* * sharedorder.h - * Dotur + * Mothur * * Created by Sarah Westcott on 12/9/08. * Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved. @@ -15,22 +15,36 @@ the group it is in and the abundance is equal to the OTU number. */ -using namespace std; - #include "datavector.hpp" struct individual { string group; int bin; int abundance; + bool operator()(const individual& i1, const individual& i2) { + return (i1.abundance > i2.abundance); + } }; +struct individualFloat { + string group; + int bin; + float abundance; + bool operator()(const individual& i1, const individual& i2) { + return (i1.abundance > i2.abundance); + } +}; + + #include "sabundvector.hpp" #include "rabundvector.hpp" #include "sharedrabundvector.h" #include "sharedsabundvector.h" #include "globaldata.hpp" #include "groupmap.h" +//#include "globaldata.hpp" + +class GlobalData; class SharedOrderVector : public DataVector { @@ -43,15 +57,15 @@ public: SharedOrderVector(ifstream&); ~SharedOrderVector(){}; - void set(int, int, int, string); //index, OTU, abundance, group + individual get(int); - void push_back(int, int, string); //OTU, abundance, group void resize(int); int size(); void print(ostream&); vector::iterator begin(); vector::iterator end(); - + void push_back(int, int, string); //OTU, abundance, group MUST CALL UPDATE STATS AFTER PUSHBACK!!! + void updateStats(); int getNumBins(); int getNumSeqs(); @@ -63,6 +77,7 @@ public: SharedOrderVector getSharedOrderVector(); SharedRAbundVector getSharedRAbundVector(string); //get the sharedRabundvector for a sepecific group SharedSAbundVector getSharedSAbundVector(string); //get the sharedSabundvector for a sepecific group + vector getSharedRAbundVector(); //returns sharedRabundVectors for all the users groups private: GlobalData* globaldata; @@ -73,7 +88,8 @@ private: int numBins; int numSeqs; bool needToUpdate; - void updateStats(); + void set(int, int, int, string); //index, OTU, abundance, group + }; #endif