X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=cooccurrencecommand.cpp;h=75b87fae4303f161a1f75fb632e831672a80e29d;hb=15b252e317fde72ce0a5de8776cb88112e0ed2b6;hp=cfde0a906d7a3138160205623bd42b59f9c2918f;hpb=4b5845a9cb928110bd1e9ec8368727b0198ce49b;p=mothur.git diff --git a/cooccurrencecommand.cpp b/cooccurrencecommand.cpp index cfde0a9..75b87fa 100644 --- a/cooccurrencecommand.cpp +++ b/cooccurrencecommand.cpp @@ -412,7 +412,7 @@ int CooccurrenceCommand::getCooccurrence(vector& thisLookUp } //populate null matrix from probability matrix, do this a lot. - for(int h=0;h(ncols, 0)); @@ -458,7 +458,7 @@ int CooccurrenceCommand::getCooccurrence(vector& 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,6 +494,7 @@ int CooccurrenceCommand::getCooccurrence(vector& thisLookUp //swap_checkerboards takes the original matrix and swaps checkerboards else if(matrix == "sim9") { trial.swap_checkerboards (co_matrix, ncols, nrows); + nullmatrix = co_matrix; } else { m->mothurOut("[ERROR]: No null model selected!\n\n"); m->control_pressed = true;