]> git.donarmstrong.com Git - mothur.git/blob - invsimpson.cpp
changing command name classify.shared to classifyrf.shared
[mothur.git] / invsimpson.cpp
1 /*
2  *  invsimpson.cpp
3  *  Mothur
4  *
5  *  Created by Pat Schloss on 8/20/10.
6  *  Copyright 2010 Schloss Lab. All rights reserved.
7  *
8  */
9
10 #include "invsimpson.h"
11 #include "simpson.h"
12
13 /***********************************************************************/
14
15 EstOutput InvSimpson::getValues(SAbundVector* rank){
16         try {
17                 //vector<double> simpsonData(3,0);
18                 data.resize(3,0);
19                 vector<double> simpData(3,0);
20                 Simpson* simp = new Simpson();
21                 simpData = simp->getValues(rank);
22                 
23                 if(simpData[0] != 0){
24                         data[0] = 1/simpData[0];
25                         data[1] = 1/simpData[2];
26                         data[2] = 1/simpData[1];
27                 }
28                 else{
29                         data.assign(3,1);
30                 }
31                 
32                 delete simp;
33                 
34                 return data;
35         }
36         catch(exception& e) {
37                 m->errorOut(e, "InvSimpson", "getValues");
38                 exit(1);
39         }
40 }
41
42 /***********************************************************************/