]> git.donarmstrong.com Git - mothur.git/blobdiff - bergerparker.cpp
fixes while testing 1.33.0
[mothur.git] / bergerparker.cpp
index 41e6e9fe97d193b4491fb33e3c5074b817516c8c..d00403c9edc8d236ef9cd1cf02dc179001573d75 100644 (file)
@@ -3,7 +3,7 @@
  *  Mothur
  *
  *  Created by Thomas Ryabin on 3/6/09.
- *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
 
@@ -15,8 +15,7 @@ EstOutput BergerParker::getValues(SAbundVector* rank){
        try {
                data.resize(1,0);
                //Berger-Parker index
-               double BP = (double)rank->getNumSeqs()/(double)rank->getMaxRank();
-               //cout << "BP index = " << 1/BP << "\n\n";
+               double BP = (double)rank->getMaxRank() / (double)rank->getNumSeqs();
                
                data[0] = BP;
                if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
@@ -24,13 +23,9 @@ EstOutput BergerParker::getValues(SAbundVector* rank){
                return data;
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the NPShannon class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               m->errorOut(e, "BergerParker", "getValues");
                exit(1);
        }
-       catch(...) {
-               cout << "An unknown error has occurred in the NPShannon class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }       
 }
 
 /***********************************************************************/