]> git.donarmstrong.com Git - mothur.git/blob - bergerparker.cpp
added files for regularized random forest
[mothur.git] / bergerparker.cpp
1 /*
2  *  ssbp.cpp
3  *  Mothur
4  *
5  *  Created by Thomas Ryabin on 3/6/09.
6  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
7  *
8  */
9
10 #include "bergerparker.h"
11
12 /***************************************************************/
13
14 EstOutput BergerParker::getValues(SAbundVector* rank){
15         try {
16                 data.resize(1,0);
17                 //Berger-Parker index
18                 double BP = (double)rank->getMaxRank() / (double)rank->getNumSeqs();
19                 
20                 data[0] = BP;
21                 if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
22
23                 return data;
24         }
25         catch(exception& e) {
26                 m->errorOut(e, "BergerParker", "getValues");
27                 exit(1);
28         }
29 }
30
31 /***********************************************************************/
32