X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=sharedjclass.cpp;h=2c7d8c9422d4c4c95b74374f05e5f7b0291aa2d9;hb=485c02be0cdcd06ce08dd58d551a525b6a1b47c5;hp=6557a0f16b8d4eab412d82616e8d74cb99374b86;hpb=25cde7ff05bbe741da1712f2c740e0bc8706e523;p=mothur.git diff --git a/sharedjclass.cpp b/sharedjclass.cpp index 6557a0f..2c7d8c9 100644 --- a/sharedjclass.cpp +++ b/sharedjclass.cpp @@ -25,9 +25,10 @@ EstOutput SharedJclass::getValues(SharedRAbundVector* shared1, SharedRAbundVecto //store in temps to avoid multiple repetitive function calls tempA = shared1->getAbundance(i); tempB = shared2->getAbundance(i); - - S1 += tempA; - S2 += tempB; + + //find number of bins in shared1 and shared2 + if (tempA != 0) { S1++; } + if (tempB != 0) { S2++; } //they are shared if ((tempA != 0) && (tempB != 0)) { S12++; }