X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=whittaker.cpp;fp=whittaker.cpp;h=5ab1e5dd88eedb8e0fb0dbe52d0b42e0c61d3c44;hb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc;hp=0000000000000000000000000000000000000000;hpb=1b73ff67c83892a025e597dabd9df6fe7b58206a;p=mothur.git diff --git a/whittaker.cpp b/whittaker.cpp new file mode 100644 index 0000000..5ab1e5d --- /dev/null +++ b/whittaker.cpp @@ -0,0 +1,35 @@ +/* + * whittaker.cpp + * Mothur + * + * Created by Pat Schloss on 4/23/09. + * Copyright 2009 Patrick D. Schloss. All rights reserved. + * + */ + +#include "whittaker.h" + +/***********************************************************************/ + +EstOutput Whittaker::getValues(vector shared){ + try{ + data.resize(1); + + int countA = 0; + int countB = 0; + int sTotal = shared[0]->getNumBins(); + for(int i=0;igetAbundance(i) != 0){ countA++; } + if(shared[1]->getAbundance(i) != 0){ countB++; } + } + + data[0] = 2-2*sTotal/(float)(countA+countB); + return data; + } + catch(exception& e) { + m->errorOut(e, "Whittaker", "getValues"); + exit(1); + } +} + +/***********************************************************************/