diff --git a/DESCRIPTION b/DESCRIPTION index fdf0084..330f2d9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: hypergea Type: Package Title: Hypergeometric tests -Version: 0.99.4 +Version: 0.99.5 Date: 2014-06-16 Author: Markus Boenn Maintainer: Markus Boenn @@ -10,7 +10,7 @@ License: GPL (>= 2) Depends: R (>= 3.0.0) Imports: SystemRequirements: OpenMP (>=3.0) -Packaged: 2014-06-20 11:06:13 UTC; boenn +Packaged: 2014-06-20 13:40:25 UTC; boenn NeedsCompilation: yes Repository: CRAN -Date/Publication: 2014-06-20 13:22:32 +Date/Publication: 2014-06-22 10:14:00 diff --git a/MD5 b/MD5 index c0671dc..11bb707 100644 --- a/MD5 +++ b/MD5 @@ -1,4 +1,4 @@ -aff1a2bb822168a3ea44b5ae2c62025f *DESCRIPTION +27dfa67ba0a722db5a354067e43bbd26 *DESCRIPTION 293f400a25b859fd72ab7cf29cecf504 *NAMESPACE 5688b42144d0c391b9c0fedf1ca84a42 *R/getExpectedValues.R 1cd7d02250140f5492957a47d6564d5f *R/getMargins.R @@ -12,6 +12,6 @@ e959fdd323943118f32bc5007abd9aa5 *man/getOddsRatio.Rd d2cec03a29d68371ab487aec59927f33 *man/hypergea-package.Rd e8c34e7f3a814a1a505656564a062702 *man/hypergeom.test.Rd bf7e140fc030043484ca8d2e096baba8 *src/Makevars -2d7662a79cce84359ac8fafc4803159e *src/hypergeom_2x2x2.cpp -4dc4c5a443cbb191131998165d0c9fd2 *src/hypergeom_IxJ.cpp -29bc6f5fdac97159877f9221d5b762ff *src/lfactorial.c +ed6975ddc461ab755fe08e689e4a453c *src/hypergeom_2x2x2.cpp +30ce54c8dc17faa0dc551a86515518db *src/hypergeom_IxJ.cpp +7bebcd374a03cda3e264aa333eee1f9c *src/lfactorial.c diff --git a/src/hypergeom_2x2x2.cpp b/src/hypergeom_2x2x2.cpp index 0220cde..13b1884 100644 --- a/src/hypergeom_2x2x2.cpp +++ b/src/hypergeom_2x2x2.cpp @@ -4,8 +4,6 @@ #include #include #include -#include /* for R_CheckUserInterrupt() */ -#include /* for R_CheckUserInterrupt() */ #ifdef _OPENMP #include @@ -13,16 +11,6 @@ #define ULONGLONG uint64_t -Rboolean R_ToplevelExec(void (*fun)(void *), void *data); - -static void chkIntFn(void *dummy) { - R_CheckUserInterrupt(); -} -// this will call the above in a top-level context so it won't longjmp-out of your context -int checkInterrupt() { - return((int)(R_ToplevelExec(chkIntFn, NULL) == FALSE)); -} - extern "C" void hypergeom_2x2x2(int *O000, int *N, int *marg, int *margins, double *p0, double *n0, double *Prob, double *Freq, double *Hist_n000, int *nthreads){ @@ -45,7 +33,6 @@ void hypergeom_2x2x2(int *O000, int *N, int *marg, int *margins, double *p0, dou //results double probTables[4]; - //unsigned long long countTables[4]; ULONGLONG countTables[4]; ULONGLONG nO000=0; //unsigned long long hist_n000[min_margin+1]; @@ -54,7 +41,7 @@ void hypergeom_2x2x2(int *O000, int *N, int *marg, int *margins, double *p0, dou preCalcFact[0]=0; for( h=1; h<= NN; h++){ - preCalcFact[h]=preCalcFact[h-1]+log(h); + preCalcFact[h]=preCalcFact[h-1]+log((double)h); } lfN=2.0*preCalcFact[NN]; lfmargins[0]=preCalcFact[ margins[0] ] + preCalcFact[ margins[1] ]; @@ -93,8 +80,6 @@ void hypergeom_2x2x2(int *O000, int *N, int *marg, int *margins, double *p0, dou #pragma omp for schedule(dynamic) for( i1=0; i1<=minAtFirstPosition; ++i1 ){ - if( FLAG_interrupt ){ continue; } - int x[2][2][2]; x[0][0][0]= -1; x[1][0][0]= -1; @@ -116,11 +101,6 @@ void hypergeom_2x2x2(int *O000, int *N, int *marg, int *margins, double *p0, dou int minSecondLoop=(marg[0] - x[0][0][0] ); for( i2=0; i2<=minSecondLoop; ++i2 ){ - if( FLAG_interrupt ){ break; } - if( (this_thread == 0) && (((++interrupt_counter) & 262143) == 0) && (checkInterrupt()==1) ){ //check if thread is master to check for user interrupt - FLAG_interrupt=1; break; - } - x[0][0][1]=i2; double lm2=preCalcFact[ x[0][0][1] ]; diff --git a/src/hypergeom_IxJ.cpp b/src/hypergeom_IxJ.cpp index 47efcd8..d0e548f 100644 --- a/src/hypergeom_IxJ.cpp +++ b/src/hypergeom_IxJ.cpp @@ -4,9 +4,6 @@ #include #include #include -//#include -#include /* for R_CheckUserInterrupt() */ -#include /* for R_CheckUserInterrupt() */ #ifdef _OPENMP #include @@ -14,23 +11,10 @@ #define ULONGLONG uint64_t -Rboolean R_ToplevelExec(void (*fun)(void *), void *data); -int checkInterrupt(void); -static void chkIntFn(void *); -int FLAG_interrupt=0; -ULONGLONG interrupt_counter=0; - extern "C" void rec(int **x, int *dim, int *pos, int *margins, ULONGLONG *local_countTables, double *local_probTables, ULONGLONG *local_nO000, double *preCalcFact, int *rowsums, int *colsums, double diff_lfmarginsTotal_lfN, int *O000, double *p0, int this_thread){ - if(FLAG_interrupt){return;} //2**18-1 - if( this_thread == 0 && (((++interrupt_counter) & 262143) == 0 ) && (checkInterrupt()==1)){ //check if thread is master to check for user interrupt - FLAG_interrupt=1; interrupt_counter=0; return; - } - if(interrupt_counter > 1000000000){interrupt_counter=0;} - - int some_columns_left=0; int current_row=pos[0]; int current_col=pos[1]; @@ -124,7 +108,7 @@ void hypergeom_IxJ(int *O000, int *N, int *margins, double *p0, double *n0, doub for( h=0; h<4; h++ ){ countTables[h]=0; probTables[h]=0.0; } preCalcFact[0]=0; - for( h=1; h<= NN; ++h ){ preCalcFact[h]=preCalcFact[h-1]+log(h); } + for( h=1; h<= NN; ++h ){ preCalcFact[h]=preCalcFact[h-1]+log((double)h); } lfN=preCalcFact[NN]; lfmargins[0]=0.0; for( h=0; h