2 * sharedsobscollectsummary.cpp
5 * Created by Sarah Westcott on 2/12/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "sharedsobscollectsummary.h"
12 /***********************************************************************/
13 //This returns the number of shared species observed in several groups.
14 //The shared vector is each groups sharedrabundvector.
16 EstOutput SharedSobsCS::getValues(vector<SharedRAbundVector*> shared){
20 int numGroups = shared.size();
22 for (int i = 0; i < shared[0]->getNumBins(); i++) {
23 //get bin values and set sharedByAll
24 bool sharedByAll = true;
25 for (int j = 0; j < numGroups; j++) {
26 if (shared[j]->getAbundance(i) == 0) { sharedByAll = false; }
30 if (sharedByAll == true) { observed++; }
37 m->errorOut(e, "SharedSobsCS", "getValues");
42 /***********************************************************************/