]> git.donarmstrong.com Git - mothur.git/blob - ordervector.hpp
Initial revision
[mothur.git] / ordervector.hpp
1 #ifndef ORDER_H
2 #define ORDER_H
3
4 #include "datavector.hpp"
5 #include "sabundvector.hpp"
6 #include "rabundvector.hpp"
7
8
9 class OrderVector : public DataVector {
10         
11 public:
12         OrderVector();
13 //      OrderVector(int);
14 //      OrderVector(const OrderVector& ov);
15         OrderVector(int ns, int nb=0, int mr=0) : DataVector(), data(ns, -1), maxRank(0), numBins(0), numSeqs(0) {};
16         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();}};
17
18
19         OrderVector(string, vector<int>);
20         OrderVector(ifstream&);
21         ~OrderVector(){};
22         
23         void set(int, int);
24         int get(int);
25         void push_back(int);
26         void resize(int);
27         int size();
28         void print(string, ostream&);
29         vector<int>::iterator begin();
30         vector<int>::iterator end();
31
32         void print(ostream&);
33
34         int getNumBins();
35         int getNumSeqs();
36         int getMaxRank();
37                 
38         RAbundVector getRAbundVector();
39         SAbundVector getSAbundVector();
40         OrderVector getOrderVector(map<string,int>*);
41         
42 private:
43         vector<int> data;
44         int maxRank;
45         int numBins;
46         int numSeqs;
47         bool needToUpdate;
48         void updateStats();
49 };
50
51 #endif