From 4545a2f620673a0dc2186fdbe2157e39b037cbd0 Mon Sep 17 00:00:00 2001 From: Kathryn Iverson Date: Mon, 30 Apr 2012 17:42:39 -0400 Subject: [PATCH] fixed sim4 --- cooccurrencecommand.cpp | 8 ++++---- trialSwap2.cpp | 4 ++-- trialswap2.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cooccurrencecommand.cpp b/cooccurrencecommand.cpp index e1d60b7..f0a46aa 100644 --- a/cooccurrencecommand.cpp +++ b/cooccurrencecommand.cpp @@ -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 i=0;i(ncols, 0)); @@ -450,9 +450,9 @@ int CooccurrenceCommand::getCooccurrence(vector& thisLookUp else if(matrix == "sim4") { for(int i=0;i& 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; diff --git a/trialSwap2.cpp b/trialSwap2.cpp index c51a5b7..a0c3210 100644 --- a/trialSwap2.cpp +++ b/trialSwap2.cpp @@ -192,10 +192,10 @@ int TrialSwap2::calc_combo (int nrows, int ncols, vector > &nullmatr } } /**************************************************************************************************/ -int TrialSwap2::swap_checkerboards (vector > &co_matrix, vector rowtotal, vector columntotal, int ncols, int nrows) +int TrialSwap2::swap_checkerboards (vector > &co_matrix, int ncols, int nrows) { try { - int ncols = co_matrix[0].size(); int nrows = co_matrix.size(); + //int ncols = co_matrix[0].size(); int nrows = co_matrix.size(); int i, j, k, l; i = m->getRandomIndex(nrows-1); while((j = m->getRandomIndex(nrows-1) ) == i ) {;if (m->control_pressed) { return 0; }} diff --git a/trialswap2.h b/trialswap2.h index 2bd6939..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); - void 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