]> git.donarmstrong.com Git - mothur.git/blob - cluster.hpp
changed how rarefaction commands find the lci and hci. they now save values from...
[mothur.git] / cluster.hpp
1 #ifndef CLUSTER_H
2 #define CLUSTER_H
3
4
5
6 #include "mothur.h"
7 #include "sparsedistancematrix.h"
8 #include "mothurout.h"
9
10 class RAbundVector;
11 class ListVector;
12
13 class Cluster {
14         
15 public:
16         Cluster(RAbundVector*, ListVector*, SparseDistanceMatrix*, float, string);
17     virtual ~Cluster() {}
18     virtual void update(double&);                               
19         virtual string getTag() = 0;
20         virtual void setMapWanted(bool m);  
21         virtual map<string, int> getSeqtoBin()  {  return seq2Bin;      }
22     
23 protected:          
24         virtual bool updateDistance(PDistCell& colCell, PDistCell& rowCell) = 0;
25     
26         virtual void clusterBins();
27         virtual void clusterNames();
28         virtual void updateMap();
29         
30         RAbundVector* rabund;
31         ListVector* list;
32         SparseDistanceMatrix* dMatrix;  
33         
34         ull smallRow;
35         ull smallCol;
36         float smallDist;
37         bool mapWanted;
38         float cutoff;
39         map<string, int> seq2Bin;
40         string method;
41         
42         ull nRowCells;
43         ull nColCells;
44         MothurOut* m;
45 };
46
47 /***********************************************************************/
48
49 class CompleteLinkage : public Cluster {
50 public:
51         CompleteLinkage(RAbundVector*, ListVector*, SparseDistanceMatrix*, float, string);
52         bool updateDistance(PDistCell& colCell, PDistCell& rowCell);
53         string getTag();
54         
55 private:
56     
57 };
58
59 /***********************************************************************/
60
61 class SingleLinkage : public Cluster {
62 public:
63         SingleLinkage(RAbundVector*, ListVector*, SparseDistanceMatrix*, float, string);
64     void update(double&);
65         bool updateDistance(PDistCell& colCell, PDistCell& rowCell);
66         string getTag();
67         
68 private:
69     
70 };
71
72 /***********************************************************************/
73
74 class AverageLinkage : public Cluster {
75 public:
76         AverageLinkage(RAbundVector*, ListVector*, SparseDistanceMatrix*, float, string);
77         bool updateDistance(PDistCell& colCell, PDistCell& rowCell);
78         string getTag();
79         
80 private:
81         int saveRow;
82         int saveCol;
83         int rowBin;
84         int colBin;
85         int totalBin;
86     
87 };
88
89 /***********************************************************************/
90
91 class WeightedLinkage : public Cluster {
92 public:
93         WeightedLinkage(RAbundVector*, ListVector*, SparseDistanceMatrix*, float, string);
94         bool updateDistance(PDistCell& colCell, PDistCell& rowCell);
95         string getTag();
96         
97 private:
98         int saveRow;
99         int saveCol;    
100 };
101
102 /***********************************************************************/
103
104
105
106 #endif