X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=boneh.cpp;h=b4ce2baf81a4371a2f59959f0658f11e50a13fe3;hp=f5c8f90a175aa8d8e54190b7e49e8df9bf0cb683;hb=df7e3ff9f68ef157b0328a2d353c3258c5d45d89;hpb=cdcf99b7760701e6869ca8e4e6e91c8e8c4ae186 diff --git a/boneh.cpp b/boneh.cpp index f5c8f90..b4ce2ba 100644 --- a/boneh.cpp +++ b/boneh.cpp @@ -44,7 +44,7 @@ EstOutput Boneh::getValues(SAbundVector* sabund){ bool valid = false; double sum = 0; double n = (double)sabund->getNumSeqs(); - if(m==0){ m=n; } + if(f==0){ f=n; } double f1 = (double)sabund->get(1); @@ -66,10 +66,10 @@ EstOutput Boneh::getValues(SAbundVector* sabund){ sum = 0; for(int j = 1; j < sabund->size(); j++) { for (int i = 0; i < sabund->get(j); i++) { - sum += pow(1 - j / n, n) * (1 - pow(1 - j / n, m)); + sum += pow(1 - j / n, n) * (1 - pow(1 - j / n, f)); } } - sum += v * pow(1 - f1/(n*v), n) * (1 - pow(1 - f1/(n*v), m)); + sum += v * pow(1 - f1/(n*v), n) * (1 - pow(1 - f1/(n*v), f)); } data[0] = sum; @@ -77,14 +77,10 @@ EstOutput Boneh::getValues(SAbundVector* sabund){ return data; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the Coverage class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "Boneh", "getValues"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the Coverage class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } -}; +} /***********************************************************************/