5 * Created by Thomas Ryabin on 4/8/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "sharedmarczewski.h"
12 EstOutput SharedMarczewski::getValues(vector<SharedRAbundVector*> vectorShared){
14 SharedRAbundVector* shared1 = vectorShared[0];
15 SharedRAbundVector* shared2 = vectorShared[1];
22 for(int i = 1; i < shared1->size(); i++)
24 int abund1 = shared1->get(i).abundance;
25 int abund2 = shared2->get(i).abundance;
27 if(abund1 > 0 && abund2 > 0)
29 else if(abund1 > 0 && abund2 == 0)
31 else if(abund1 == 0 && abund2 > 0)
34 data[0] = (b+c)/(a+b+c);
36 if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
41 m->errorOut(e, "SharedMarczewski", "getValues");
46 /***********************************************************************/