]> git.donarmstrong.com Git - mothur.git/blob - rabundvector.hpp
added the Calculators Thomas made in the fall. Added parameter and command error...
[mothur.git] / rabundvector.hpp
1 #ifndef RABUND_H
2 #define RABUND_H
3
4 #include "datavector.hpp"
5
6 /* This class is a child to datavector.  It represents OTU information at a certain distance. 
7         A rabundvector can be converted into and ordervector, listvector or sabundvector.
8         Each member of the internal container "data" represents an individual OTU.
9         So data[0] = 6, because there are six member in that OTU.
10         example: listvector             =       a,b,c,d,e,f             g,h,i           j,k             l               m  
11                          rabundvector   =       6                               3                       2               1               1
12                          sabundvector   =       2               1               1               0               0               1
13                          ordervector    =       1       1       1       1       1       1       2       2       2       3       3       4       5 */
14
15 class RAbundVector : public DataVector {
16         
17 public:
18         RAbundVector();
19         RAbundVector(int);
20         RAbundVector(vector<int>, int, int, int);
21 //      RAbundVector(const RAbundVector&);
22         RAbundVector(string, vector<int>);
23         RAbundVector(const RAbundVector& bv) : DataVector(bv), data(bv.data), maxRank(bv.maxRank), numBins(bv.numBins), numSeqs(bv.numSeqs){};
24         RAbundVector(ifstream&);
25         ~RAbundVector();
26
27         int getNumBins();               
28         int getNumSeqs();                                                       
29         int getMaxRank();                                                       
30
31         void set(int, int);     
32         int get(int);
33         void push_back(int);
34         void pop_back();
35         void resize(int);
36         int size();
37         void quicksort();
38         int sum();
39         int sum(int);
40         int numNZ();
41         vector<int>::reverse_iterator rbegin();
42         vector<int>::reverse_iterator rend();
43         
44         void print(ostream&);
45         void print(string, ostream&);
46         
47         RAbundVector getRAbundVector();
48         SAbundVector getSAbundVector();
49         OrderVector getOrderVector(map<string,int>*);
50         
51 private:
52         vector<int> data;
53         int maxRank;
54         int numBins;
55         int numSeqs;    
56 };
57
58
59 #endif