From: Sarah Westcott Date: Tue, 1 May 2012 12:19:31 +0000 (-0400) Subject: Merge remote-tracking branch 'mothur/master' X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4b5845a9cb928110bd1e9ec8368727b0198ce49b;hp=-c;p=mothur.git Merge remote-tracking branch 'mothur/master' --- 4b5845a9cb928110bd1e9ec8368727b0198ce49b diff --combined cooccurrencecommand.cpp index 45bc0f5,f0a46aa..cfde0a9 --- a/cooccurrencecommand.cpp +++ b/cooccurrencecommand.cpp @@@ -318,7 -318,7 +318,7 @@@ int CooccurrenceCommand::getCooccurrenc } } //don't need a prob matrix because we just shuffle the rows, may use this in the future -// else if (matrix == "sim2") { + else if (matrix == "sim2") { } // for(int i=0;imothurOut("[ERROR]: No model selected! \n"); m->control_pressed = true; @@@ -408,11 -408,11 +408,11 @@@ //burn-in for sim9 if(matrix == "sim9") { - for(int i=0;i<10000;i++) trial.swap_checkerboards (co_matrix, rowtotal, columntotal, ncols, nrows); + for(int i=0;i<10000;i++) trial.swap_checkerboards (co_matrix, ncols, nrows); } //populate null matrix from probability matrix, do this a lot. - for(int k=0;k(ncols, 0)); @@@ -420,7 -420,6 +420,7 @@@ if(matrix == "sim1" || matrix == "sim6" || matrix == "sim8" || matrix == "sim7") { count = 0; while(count < n) { + if (m->control_pressed) { return 0; } nextnum2: previous = 0.0; randnum = rand() / double(RAND_MAX); @@@ -451,15 -450,13 +451,14 @@@ else if(matrix == "sim4") { for(int i=0;icontrol_pressed) { return 0; } randnum = rand() / double(RAND_MAX); for(int j=0;j previous && nullmatrix[i][j] != 1) { + if((randnum <= current && randnum > previous && nullmatrix[i][j] != 1) || (previous==current)){ nullmatrix[i][j] = 1; count++; previous = 0.0; @@@ -476,7 -473,6 +475,7 @@@ for(int j=0;jcontrol_pressed) { return 0; } randnum = rand() / double(RAND_MAX); for(int i=0;imothurOut("[ERROR]: No null model selected!\n\n"); m->control_pressed = true;