]> git.donarmstrong.com Git - mothur.git/blob - pam.h
update .gitignore
[mothur.git] / pam.h
1 //
2 //  pam.h
3 //  Mothur
4 //
5 //  Created by SarahsWork on 12/10/13.
6 //  Copyright (c) 2013 Schloss Lab. All rights reserved.
7 //
8
9 #ifndef Mothur_pam_h
10 #define Mothur_pam_h
11
12 #include "communitytype.h"
13
14 //Partitioning Around Medoids
15 /**************************************************************************************************/
16
17 class Pam : public CommunityTypeFinder {
18     
19 public:
20     Pam(vector<vector<int> >, vector<vector<double> >, int);
21     double calcCHIndex(vector< vector< double> >);
22     
23 private:
24     set<int> medoids;
25     map<int, int> medoid2Partition;
26     double largestDist;
27     vector<vector<double> > dists;
28     vector<vector< double> > Dp; // [numSamples][2] - It contains Dp and Ep. Dp is in [numSamples][0] and Ep is in [numSamples][1]. Dp is the distance between p and the closest sample in S and Ep is the distance between p and the second closest object in S. Both are used in the build and swap phases.
29     
30     int buildPhase();
31     int swapPhase();
32     int updateDp();
33     
34     
35     
36 /**************************************************************************************************/
37 };
38
39
40 #endif