X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bergerparker.cpp;h=d00403c9edc8d236ef9cd1cf02dc179001573d75;hb=1a968f34ae2d2680eaf189a197d1a21b8dfd6c03;hp=c8c25ea71f2a87ef8d975b0843a7a7929cd6b9b9;hpb=eb1c88346fb246e95a6b38935b103f95e38b82ca;p=mothur.git diff --git a/bergerparker.cpp b/bergerparker.cpp index c8c25ea..d00403c 100644 --- a/bergerparker.cpp +++ b/bergerparker.cpp @@ -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); - } } /***********************************************************************/