]> git.donarmstrong.com Git - mothur.git/blob - communitytype.h
working on pam
[mothur.git] / communitytype.h
1 //
2 //  communitytype.h
3 //  Mothur
4 //
5 //  Created by SarahsWork on 12/3/13.
6 //  Copyright (c) 2013 Schloss Lab. All rights reserved.
7 //
8
9 #ifndef Mothur_communitytype_h
10 #define Mothur_communitytype_h
11
12 #define EPSILON numeric_limits<double>::epsilon()
13
14
15 #include "mothurout.h"
16 #include "linearalgebra.h"
17 /**************************************************************************************************/
18
19 class CommunityTypeFinder {
20     
21 public:
22         CommunityTypeFinder(){  m = MothurOut::getInstance();  }
23         virtual ~CommunityTypeFinder(){};
24     
25     virtual void printZMatrix(string, vector<string>);
26     virtual void printRelAbund(string, vector<string>);
27     virtual void printFitData(ofstream&) {}
28     virtual void printFitData(ostream&, double) {}
29     virtual void printSilData(ofstream&, double, vector<double>);
30     virtual void printSilData(ostream&, double, vector<double>);
31     
32     virtual double getNLL()     {    return currNLL;        }
33     virtual double getAIC()     {    return aic;            }
34     virtual double getBIC()     {    return bic;            }
35     virtual double getLogDet()  {    return logDeterminant; }
36     virtual double getLaplace() {    return laplace;        }
37     
38     virtual double calcCHIndex(vector< vector< double> >) {return 0;}  //Calinski-Harabasz
39     virtual vector<double> calcSilhouettes(vector< vector< double> >) {  vector<double> s; return s; } //if none provided by child class
40
41
42 protected:
43     
44     int findkMeans();
45     vector<vector<double> > getHessian();
46     double psi1(double);
47     double psi(double);
48     double cheb_eval(const double[], int, double);
49
50     
51         MothurOut* m;
52     vector<vector<double> > zMatrix;
53     vector<vector<double> > lambdaMatrix;
54     vector<vector<double> > error;
55     vector<vector<int> > countMatrix;
56     vector<double> weights;
57
58
59
60     int numPartitions;
61     int numSamples;
62     int numOTUs;
63     int currentPartition;
64     
65     double currNLL, aic, bic, logDeterminant, laplace;
66      
67         
68 };
69
70 /**************************************************************************************************/
71
72
73
74
75 #endif