X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=cooccurrencecommand.cpp;h=8c763e275e5d9cebf885794fafdc3c9f44f0cb6a;hb=2b11c674bb4d57c4542ecb89989e1590dd9f07a7;hp=45bc0f58dd9cbf5fbcb32a7038fde29fb749551d;hpb=4418e128575c1d667720090d7b45d9b48de81a3a;p=mothur.git diff --git a/cooccurrencecommand.cpp b/cooccurrencecommand.cpp index 45bc0f5..8c763e2 100644 --- a/cooccurrencecommand.cpp +++ b/cooccurrencecommand.cpp @@ -385,7 +385,7 @@ int CooccurrenceCommand::getCooccurrence(vector& thisLookUp } } } - else if (matrix == "sim9") { } + else if (matrix == "sim9" || matrix == "sim2") { } else { m->mothurOut("[ERROR]: No model selected! \n"); m->control_pressed = true; @@ -408,11 +408,11 @@ int CooccurrenceCommand::getCooccurrence(vector& thisLookUp //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 h=0;h(ncols, 0)); @@ -451,7 +451,6 @@ int CooccurrenceCommand::getCooccurrence(vector& thisLookUp else if(matrix == "sim4") { for(int i=0;i& thisLookUp randnum = rand() / double(RAND_MAX); for(int j=0;j previous && nullmatrix[i][j] != 1) || (previous==current)){ + if(randnum <= current && randnum > previous && nullmatrix[i][j] != 1) { nullmatrix[i][j] = 1; count++; previous = 0.0; @@ -494,7 +493,7 @@ int CooccurrenceCommand::getCooccurrence(vector& thisLookUp //swap_checkerboards takes the original matrix and swaps checkerboards else if(matrix == "sim9") { - trial.swap_checkerboards (co_matrix, rowtotal, columntotal, ncols, nrows); + trial.swap_checkerboards (co_matrix, ncols, nrows); } else { m->mothurOut("[ERROR]: No null model selected!\n\n"); m->control_pressed = true;