X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=rabundvector.hpp;h=fab02a921a602524e7516bdcbd7efc64326cbbea;hb=b447f829850ae054e42560c7c3ed71b14f3f40bb;hp=a0807e5126b62969c967a49e96cb11299302f21c;hpb=20a2d0350a737a434c89f303662d64a8eeea7b05;p=mothur.git diff --git a/rabundvector.hpp b/rabundvector.hpp index a0807e5..fab02a9 100644 --- a/rabundvector.hpp +++ b/rabundvector.hpp @@ -3,11 +3,24 @@ #include "datavector.hpp" +/* This class is a child to datavector. It represents OTU information at a certain distance. + A rabundvector can be converted into and ordervector, listvector or sabundvector. + Each member of the internal container "data" represents an individual OTU. + So data[0] = 6, because there are six member in that OTU. + example: listvector = a,b,c,d,e,f g,h,i j,k l m + rabundvector = 6 3 2 1 1 + sabundvector = 2 1 1 0 0 1 + ordervector = 1 1 1 1 1 1 2 2 2 3 3 4 5 */ + +//class SAbundVector; +//class OrderVector; + class RAbundVector : public DataVector { public: RAbundVector(); RAbundVector(int); + RAbundVector(vector, int, int, int); // RAbundVector(const RAbundVector&); RAbundVector(string, vector); RAbundVector(const RAbundVector& bv) : DataVector(bv), data(bv.data), maxRank(bv.maxRank), numBins(bv.numBins), numSeqs(bv.numSeqs){}; @@ -24,11 +37,16 @@ public: void pop_back(); void resize(int); int size(); + void quicksort(); + int sum(); + int sum(int); + int numNZ(); vector::reverse_iterator rbegin(); vector::reverse_iterator rend(); void print(ostream&); void print(string, ostream&); + void nonSortedPrint(ostream&); RAbundVector getRAbundVector(); SAbundVector getSAbundVector();