X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=logsd.cpp;h=6a795415d832f265325138422f48d77afe3315be;hp=782af2a5dc0514c838a0be217d44fab1ceffdecd;hb=615301e57c25e241356a9c2380648d117709458d;hpb=c196b6b4768ccb84955d773ff0f22e4994d1ba7b diff --git a/logsd.cpp b/logsd.cpp index 782af2a..6a79541 100644 --- a/logsd.cpp +++ b/logsd.cpp @@ -14,6 +14,7 @@ double LogSD::logS(double x){ return -(1-x)*log(1-x)/x; } +/***********************************************************************/ EstOutput LogSD::getValues(SAbundVector* rank){ try { @@ -29,8 +30,8 @@ EstOutput LogSD::getValues(SAbundVector* rank){ SAbundVector *rank = &rankw;*/ data.resize(3,0); - int numInd = rank->getNumSeqs(); - int numSpec = rank->getNumBins(); + double numInd = rank->getNumSeqs(); + double numSpec = rank->getNumBins(); double snRatio = (double)numSpec/numInd; double x = .5; double step = .4999999999; @@ -44,7 +45,7 @@ EstOutput LogSD::getValues(SAbundVector* rank){ } double alpha = numInd*(1-x)/x; - int oct = 1; + double oct = 1; double octSumObs = 0; double sumObs = 0; double octSumExp = 0; @@ -74,13 +75,6 @@ EstOutput LogSD::getValues(SAbundVector* rank){ maxDiff = diff; } - - /*cout << "LogSD:\n"; - cout << "D Test Statistic = " << DStatistic << "\n"; - cout << ".05 confidence value = " << .89196/sqrt(numSpec) << "\n"; - cout << "If D Test Statistic is greater than the critical value then the data fits the Log Series Distribution model w/ 95% confidence.\n\n";*/ - - data[0] = (maxDiff + .5)/numSpec; data[1] = 0.886/sqrt(numSpec); data[2] = 1.031/sqrt(numSpec); @@ -92,13 +86,9 @@ EstOutput LogSD::getValues(SAbundVector* rank){ return data; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the LogSD class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "LogSD", "getValues"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the LogSD class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /***********************************************************************/