/***************************************************************************************
***************************************************************************************/
-double SharedJackknife::simpson(int abunds[], double numInd, int numBins){
+double SharedJackknife::simpson(vector<int> abunds, double numInd, int numBins){
double denom = numInd*(numInd-1);
double sum = 0;
for(int i = 0; i < numBins; i++)
double* SharedJackknife::jackknife(){
int numBins = groups.at(0)->getNumBins()-1;
- int cArray[numBins];
+ vector<int> cArray(numBins);
for(int i = 0; i < numBins; i++)
cArray[i] = 0;
double baseD = 1/simpson(cArray, numInd, numBins);
- double pseudoVals[numBins];
+ vector<double> pseudoVals(numBins);
double jackknifeEstimate = 0;
for(int i = 0; i < numGroups; i++) {
for(int j = 0; j < numBins-1; j++) {
SharedRAbundVector* shared1 = vectorShared[0];
SharedRAbundVector* shared2 = vectorShared[1];
if(numGroups == -1) {
- globaldata = GlobalData::getInstance();
- numGroups = globaldata->Groups.size();
+ numGroups = m->getNumGroups();
}
if(callCount == numGroups*(numGroups-1)/2) {
data[0] = rdata[0];
data[1] = rdata[1];
data[2] = rdata[2];
-
- //cout << "sT = " << data[0] << " lower confLimit = " << data[1] << " upper confLimit = " << data[2] << "\n";
+
if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
if (isnan(data[1]) || isinf(data[1])) { data[1] = 0; }
if (isnan(data[2]) || isinf(data[0])) { data[2] = 0; }
- /*for(int i = 0; i < groups.size(); i++)
- cout << groups.at(i)->getGroup() << " ";
- cout << "\n";
- cout << groups.size() << " " << data[0] << " " << data[1] << " " << data[2] << "\n\n";*/
-
return data;
}
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the SharedJackknife class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedJackknife", "getValues");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the SharedJackknife class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/