X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=ace.cpp;h=92c023f663fa11e8e2ac9bc0041a15162a1abdb1;hp=639a48f6e45ac2503bbfbea4d2ba368cfadcd293;hb=d1c97b8c04bb75faca1e76ffad60b37a4d789d3d;hpb=510b1cfc25cd79391d6973ca20c5ec25fb1bb3b2 diff --git a/ace.cpp b/ace.cpp index 639a48f..92c023f 100644 --- a/ace.cpp +++ b/ace.cpp @@ -16,12 +16,12 @@ EstOutput Ace::getValues(SAbundVector* rank) { data.resize(3,0); double ace, acelci, acehci; - int nrare = 0; - int srare = 0; - int sabund = 0; + double nrare = 0; + double srare = 0; + double sabund = 0; double Cace, term1, gamace; - int numsum = 0; + double numsum = 0; double maxRank = (double)rank->getMaxRank(); @@ -33,7 +33,7 @@ EstOutput Ace::getValues(SAbundVector* rank) { } else if(i>abund) {sabund += rank->get(i);} } - int sobs = srare + sabund; + double sobs = srare + sabund; if (nrare == 0){ Cace = 0.0000; } else { Cace = 1.0000 -(double)rank->get(1)/(double)nrare; } @@ -62,7 +62,8 @@ EstOutput Ace::getValues(SAbundVector* rank) { I have also added the forumlae to calculate the 95% confidence intervals. */ - int j,D_s=0,nn=0,ww=0,Max_Index=rank->getMaxRank()+1; + double j,D_s=0,nn=0,ww=0; + int Max_Index=rank->getMaxRank()+1; double pp, temp1, temp2; vector Part_N_Part_F(Max_Index+1,0.0); @@ -140,7 +141,7 @@ EstOutput Ace::getValues(SAbundVector* rank) { return data; } catch(exception& e) { - errorOut(e, "Ace", "getValues"); + m->errorOut(e, "Ace", "getValues"); exit(1); } }