X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=whittaker.cpp;h=5ab1e5dd88eedb8e0fb0dbe52d0b42e0c61d3c44;hp=95f1c9c5fcb789a19a7496a83177ab639d0067e6;hb=615301e57c25e241356a9c2380648d117709458d;hpb=477e76a8a79b60f6cd4253324dd830bdea25e3e9 diff --git a/whittaker.cpp b/whittaker.cpp index 95f1c9c..5ab1e5d 100644 --- a/whittaker.cpp +++ b/whittaker.cpp @@ -11,29 +11,25 @@ /***********************************************************************/ -EstOutput Whittaker::getValues(SharedRAbundVector* shared1, SharedRAbundVector* shared2){ +EstOutput Whittaker::getValues(vector shared){ try{ data.resize(1); int countA = 0; int countB = 0; - int sTotal = shared1->getNumBins(); + int sTotal = shared[0]->getNumBins(); for(int i=0;igetAbundance(i) != 0){ countA++; } - if(shared2->getAbundance(i) != 0){ countB++; } + if(shared[0]->getAbundance(i) != 0){ countA++; } + if(shared[1]->getAbundance(i) != 0){ countB++; } } - data[0] = 2*sTotal/(float)(countA+countB)-1; + data[0] = 2-2*sTotal/(float)(countA+countB); return data; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the Whittaker class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "Whittaker", "getValues"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the Whittaker class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } -/***********************************************************************/ \ No newline at end of file +/***********************************************************************/