5 * Created by westcott on 12/17/10.
6 * Copyright 2010 Schloss Lab. All rights reserved.
12 /***********************************************************************/
13 EstOutput MemChord::getValues(vector<SharedRAbundVector*> shared) {
21 for (int i = 0; i < shared[0]->getNumBins(); i++) {
22 if (shared[0]->getAbundance(i) != 0) { nonZeroA++; }
23 if (shared[1]->getAbundance(i) != 0) { nonZeroB++; }
26 nonZeroA = sqrt(nonZeroA);
27 nonZeroB = sqrt(nonZeroB);
30 for (int i = 0; i < shared[0]->getNumBins(); i++) {
31 int A = shared[0]->getAbundance(i);
32 int B = shared[1]->getAbundance(i);
37 double Aterm = A / nonZeroA;
38 double Bterm = B / nonZeroB;
40 sum += ((Aterm-Bterm)*(Aterm-Bterm));
45 if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
50 m->errorOut(e, "MemChord", "getValues");
54 /***********************************************************************/