]> git.donarmstrong.com Git - mothur.git/blobdiff - bergerparker.cpp
fixes while testing 1.33.0
[mothur.git] / bergerparker.cpp
index c8c25ea71f2a87ef8d975b0843a7a7929cd6b9b9..d00403c9edc8d236ef9cd1cf02dc179001573d75 100644 (file)
@@ -3,12 +3,11 @@
  *  Mothur
  *
  *  Created by Thomas Ryabin on 3/6/09.
- *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
 
 #include "bergerparker.h"
-#include "calculator.h"
 
 /***************************************************************/
 
@@ -16,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; }
@@ -25,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);
-       }       
 }
 
 /***********************************************************************/