]> git.donarmstrong.com Git - mothur.git/blob - solow.cpp
enabled ~
[mothur.git] / solow.cpp
1 /*
2  *  solow.cpp
3  *  Mothur
4  *
5  *  Created by Thomas Ryabin on 5/13/09.
6  *  Copyright 2009Schloss Lab UMASS Amherst. All rights reserved.
7  *
8  */
9
10 #include "solow.h"
11 #include <math.h>
12
13         
14 /***********************************************************************/       
15 EstOutput Solow::getValues(SAbundVector* rank){
16
17         try {
18                 data.resize(1,0);
19                 
20                 double n = (double)rank->getNumSeqs();
21                 double f1 = (double)rank->get(1);
22                 double f2 = (double)rank->get(2);
23
24                 data[0] = f1*f1/2/f2 * (1 - pow(1 - 2*f2/n/f1, f));
25                 
26                 return data;
27         }
28         catch(exception& e) {
29                 m->errorOut(e, "Solow", "getValues");
30                 exit(1);
31         }
32 }
33
34
35 /***********************************************************************/