]> git.donarmstrong.com Git - mothur.git/blob - sharedordervector.h
Initial revision
[mothur.git] / sharedordervector.h
1 #ifndef SHAREDORDER_H
2 #define SHAREDORDER_H
3 /*
4  *  sharedorder.h
5  *  Dotur
6  *
7  *  Created by Sarah Westcott on 12/9/08.
8  *  Copyright 2008 __MyCompanyName__. All rights reserved.
9  *
10  */
11
12 #include <Carbon/Carbon.h>
13 #include "datavector.hpp"
14 #include "sabundvector.hpp"
15 #include "rabundvector.hpp"
16
17 struct individual {
18                 string group;
19                 int bin;
20                 int abundance;
21 };
22
23
24 class SharedOrderVector : public DataVector {
25         
26 public:
27         SharedOrderVector();
28 //      SharedOrderVector(int ns, int nb=0, int mr=0)   : DataVector(), data(ns, -1), maxRank(0), numBins(0), numSeqs(0) {};
29         SharedOrderVector(const SharedOrderVector& ov)  : DataVector(ov.label), data(ov.data), maxRank(ov.maxRank), numBins(ov.numBins), numSeqs(ov.numSeqs), needToUpdate(ov.needToUpdate) {if(needToUpdate == 1){     updateStats();}};
30
31         SharedOrderVector(string, vector<individual>);
32 //      SharedOrderVector(ifstream&);
33         ~SharedOrderVector(){};
34         
35         void set(int, int, int, string);
36         individual get(int);
37         void push_back(int, int, string);
38         void resize(int);
39         int size();
40         void print(ostream&);
41         vector<individual>::iterator begin();
42         vector<individual>::iterator end();
43
44
45         int getNumBins();
46         int getNumSeqs();
47         int getMaxRank();
48                 
49         RAbundVector getRAbundVector();
50         SAbundVector getSAbundVector();
51         OrderVector getOrderVector(map<string,int>*);
52         SharedOrderVector getSharedOrderVector();
53         
54 private:
55         vector<individual>  data; 
56         map< int, vector<individual> >::iterator it;
57         int maxRank;
58         int numBins;
59         int numSeqs;
60         bool needToUpdate;
61         void updateStats();
62 };
63
64 #endif
65