X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=ordervector.hpp;fp=ordervector.hpp;h=92259a8463625082e8580530ffe2d8a638f1419b;hb=20a2d0350a737a434c89f303662d64a8eeea7b05;hp=0000000000000000000000000000000000000000;hpb=bbb5879a7e566935c23d63d42bb945072424b939;p=mothur.git diff --git a/ordervector.hpp b/ordervector.hpp new file mode 100644 index 0000000..92259a8 --- /dev/null +++ b/ordervector.hpp @@ -0,0 +1,51 @@ +#ifndef ORDER_H +#define ORDER_H + +#include "datavector.hpp" +#include "sabundvector.hpp" +#include "rabundvector.hpp" + + +class OrderVector : public DataVector { + +public: + OrderVector(); +// OrderVector(int); +// OrderVector(const OrderVector& ov); + OrderVector(int ns, int nb=0, int mr=0) : DataVector(), data(ns, -1), maxRank(0), numBins(0), numSeqs(0) {}; + OrderVector(const OrderVector& ov) : DataVector(ov.label), data(ov.data), maxRank(ov.maxRank), numBins(ov.numBins), numSeqs(ov.numSeqs), needToUpdate(ov.needToUpdate) {if(needToUpdate == 1){ updateStats();}}; + + + OrderVector(string, vector); + OrderVector(ifstream&); + ~OrderVector(){}; + + void set(int, int); + int get(int); + void push_back(int); + void resize(int); + int size(); + void print(string, ostream&); + vector::iterator begin(); + vector::iterator end(); + + void print(ostream&); + + int getNumBins(); + int getNumSeqs(); + int getMaxRank(); + + RAbundVector getRAbundVector(); + SAbundVector getSAbundVector(); + OrderVector getOrderVector(map*); + +private: + vector data; + int maxRank; + int numBins; + int numSeqs; + bool needToUpdate; + void updateStats(); +}; + +#endif