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