5 * Created by westcott on 12/15/10.
6 * Copyright 2010 Schloss Lab. All rights reserved.
10 #include "structchord.h"
12 /***********************************************************************/
13 EstOutput StructChord::getValues(vector<SharedRAbundVector*> shared) {
20 //calc the 2 denominators
21 for (int i = 0; i < shared[0]->getNumBins(); i++) {
23 int Aij = shared[0]->getAbundance(i);
24 int Bij = shared[1]->getAbundance(i);
27 sumAj2 += (Aij * Aij);
28 sumBj2 += (Bij * Bij);
31 sumAj2 = sqrt(sumAj2);
32 sumBj2 = sqrt(sumBj2);
36 for (int i = 0; i < shared[0]->getNumBins(); i++) {
38 int Aij = shared[0]->getAbundance(i);
39 int Bij = shared[1]->getAbundance(i);
41 sum += (((Aij / sumAj2) - (Bij / sumBj2)) * ((Aij / sumAj2) - (Bij / sumBj2)));
46 if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
51 m->errorOut(e, "StructChord", "getValues");
55 /***********************************************************************/