From 696633b3cf5f0b6928216069a780fccc87a69f0b Mon Sep 17 00:00:00 2001 From: Sarah Westcott Date: Tue, 1 May 2012 08:20:19 -0400 Subject: [PATCH 1/1] changes while testing --- cooccurrencecommand.cpp | 4 ++-- trialswap2.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cooccurrencecommand.cpp b/cooccurrencecommand.cpp index cfde0a9..8c763e2 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; diff --git a/trialswap2.h b/trialswap2.h index 4c03278..924938b 100644 --- a/trialswap2.h +++ b/trialswap2.h @@ -21,7 +21,7 @@ public: double calc_pvalue_lessthan (vector, double); double calc_pvalue_greaterthan (vector, double); - int swap_checkerboards (vector > &, vector, vector, int, int); + int swap_checkerboards (vector > &, int, int); int calc_combo (int, int, vector > &); double calc_vratio (int, int, vector, vector); int calc_checker (vector > &, vector, int, int); -- 2.39.2