X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sharedordervector.h;h=7d383ac84f431830e2324cd51d4777d80a3390e0;hb=541bab1dac00688b4c3a8c4a95ab464412663c50;hp=e941c7e5f860b770c5a766027d3cc658c94e3259;hpb=d59f91eb1230d2c7867a92cb86138b7003100ab4;p=mothur.git diff --git a/sharedordervector.h b/sharedordervector.h index e941c7e..7d383ac 100644 --- a/sharedordervector.h +++ b/sharedordervector.h @@ -15,8 +15,6 @@ the group it is in and the abundance is equal to the OTU number. */ -using namespace std; - #include "datavector.hpp" struct individual { @@ -26,17 +24,25 @@ struct individual { bool operator()(const individual& i1, const individual& i2) { return (i1.abundance > i2.abundance); } + individual() { group = ""; bin = 0; abundance = 0; } }; +struct individualFloat { + string group; + int bin; + float abundance; + bool operator()(const individual& i1, const individual& i2) { + return (i1.abundance > i2.abundance); + } + individualFloat() { group = ""; bin = 0; abundance = 0.0; } +}; + + #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 { @@ -49,15 +55,16 @@ 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(); + void clear(); int getNumBins(); int getNumSeqs(); @@ -72,7 +79,6 @@ public: vector getSharedRAbundVector(); //returns sharedRabundVectors for all the users groups private: - GlobalData* globaldata; GroupMap* groupmap; vector data; map< int, vector >::iterator it; @@ -80,7 +86,8 @@ private: int numBins; int numSeqs; bool needToUpdate; - void updateStats(); + void set(int, int, int, string); //index, OTU, abundance, group + }; #endif