+ m->errorOut(e, "SharedSobsCS", "getValues");
+ exit(1);
+ }
+}
+/***********************************************************************/
+//This returns the number of shared species observed in several groups.
+//The shared vector is each groups sharedrabundvector.
+
+EstOutput SharedSobsCS::getValues(vector<SharedRAbundVector*> shared, vector<string>& labels){
+ try {
+ data.resize(1,0);
+ double observed = 0;
+ int numGroups = shared.size();
+ labels.clear();
+
+ for (int i = 0; i < shared[0]->getNumBins(); i++) {
+ //get bin values and set sharedByAll
+ bool sharedByAll = true;
+ for (int j = 0; j < numGroups; j++) {
+ if (shared[j]->getAbundance(i) == 0) { sharedByAll = false; }
+ }
+
+ //they are shared
+ if (sharedByAll == true) { observed++; labels.push_back(m->currentBinLabels[i]); }
+ }
+
+ data[0] = observed;
+ return data;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SharedSobsCS", "getValues");