X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=communitytype.h;fp=communitytype.h;h=59291f5444f8e00abd4f55a9986f853b285fe8b5;hb=a2cde58c1e72199498a2142983ef040dce36da10;hp=0000000000000000000000000000000000000000;hpb=3e8b80da722e11c72bce957e2f42a6e884dd02b6;p=mothur.git diff --git a/communitytype.h b/communitytype.h new file mode 100644 index 0000000..59291f5 --- /dev/null +++ b/communitytype.h @@ -0,0 +1,75 @@ +// +// communitytype.h +// Mothur +// +// Created by SarahsWork on 12/3/13. +// Copyright (c) 2013 Schloss Lab. All rights reserved. +// + +#ifndef Mothur_communitytype_h +#define Mothur_communitytype_h + +#define EPSILON numeric_limits::epsilon() + + +#include "mothurout.h" +#include "linearalgebra.h" +/**************************************************************************************************/ + +class CommunityTypeFinder { + +public: + CommunityTypeFinder(){ m = MothurOut::getInstance(); } + virtual ~CommunityTypeFinder(){}; + + virtual void printZMatrix(string, vector); + virtual void printRelAbund(string, vector); + virtual void printFitData(ofstream&) {} + virtual void printFitData(ostream&, double) {} + virtual void printSilData(ofstream&, double, vector); + virtual void printSilData(ostream&, double, vector); + + virtual double getNLL() { return currNLL; } + virtual double getAIC() { return aic; } + virtual double getBIC() { return bic; } + virtual double getLogDet() { return logDeterminant; } + virtual double getLaplace() { return laplace; } + + virtual double calcCHIndex(vector< vector< double> >) {return 0;} //Calinski-Harabasz + virtual vector calcSilhouettes(vector< vector< double> >) { vector s; return s; } //if none provided by child class + + +protected: + + int findkMeans(); + vector > getHessian(); + double psi1(double); + double psi(double); + double cheb_eval(const double[], int, double); + + + MothurOut* m; + vector > zMatrix; + vector > lambdaMatrix; + vector > error; + vector > countMatrix; + vector weights; + + + + int numPartitions; + int numSamples; + int numOTUs; + int currentPartition; + + double currNLL, aic, bic, logDeterminant, laplace; + + +}; + +/**************************************************************************************************/ + + + + +#endif