]> git.donarmstrong.com Git - mothur.git/blob - heip.cpp
sffinfo bug with flow grams right index when clipQualRight=0
[mothur.git] / heip.cpp
1 /*
2  *  heip.cpp
3  *  Mothur
4  *
5  *  Created by Pat Schloss on 8/21/10.
6  *  Copyright 2010 Schloss Lab. All rights reserved.
7  *
8  */
9
10 #include "heip.h"
11 #include "shannon.h"
12
13 /***********************************************************************/
14
15 EstOutput Heip::getValues(SAbundVector* rank){
16         try {
17                 data.resize(1,0.0000);
18                 vector<double> shanData(3,0);
19                 Shannon* shannon = new Shannon();
20                 shanData = shannon->getValues(rank);
21                 
22                 long int sobs = rank->getNumBins();
23                 if(sobs > 1){
24                         data[0] = (exp(shanData[0])-1) / (sobs - 1);;
25                 }
26                 else{
27                         data[0] = 1;
28                 }
29                 
30                 delete shannon;
31                 return data;
32         }
33         catch(exception& e) {
34                 m->errorOut(e, "Heip", "getValues");
35                 exit(1);
36         }
37 }
38
39 /***********************************************************************/