|
42 | 42 | export dwilcox,pwilcox,qwilcox,rwilcox # Wilcox's Rank Sum statistic (m, n)
|
43 | 43 | export ptukey, qtukey # Studentized Range Distribution - p and q only
|
44 | 44 |
|
45 |
| -function __init__() |
46 |
| - # initialize RNG hooks |
47 |
| - unsafe_store!(cglobal((:unif_rand_ptr,libRmath),Ptr{Cvoid}), |
48 |
| - cfunction(rand,Float64,Tuple{})) |
49 |
| - unsafe_store!(cglobal((:norm_rand_ptr,libRmath),Ptr{Cvoid}), |
50 |
| - cfunction(randn,Float64,Tuple{})) |
51 |
| - unsafe_store!(cglobal((:exp_rand_ptr,libRmath),Ptr{Cvoid}), |
52 |
| - cfunction(Random.randexp,Float64,Tuple{})) |
| 45 | +@static if VERSION ≥ v"0.7.0-DEV.4749" |
| 46 | + function __init__() |
| 47 | + # initialize RNG hooks |
| 48 | + unsafe_store!(cglobal((:unif_rand_ptr,libRmath),Ptr{Cvoid}), |
| 49 | + @cfunction(rand,Float64,())) |
| 50 | + unsafe_store!(cglobal((:norm_rand_ptr,libRmath),Ptr{Cvoid}), |
| 51 | + @cfunction(randn,Float64,())) |
| 52 | + unsafe_store!(cglobal((:exp_rand_ptr,libRmath),Ptr{Cvoid}), |
| 53 | + @cfunction(Random.randexp,Float64,())) |
| 54 | + end |
| 55 | +else |
| 56 | + function __init__() |
| 57 | + # initialize RNG hooks |
| 58 | + unsafe_store!(cglobal((:unif_rand_ptr,libRmath),Ptr{Cvoid}), |
| 59 | + cfunction(rand,Float64,Tuple{})) |
| 60 | + unsafe_store!(cglobal((:norm_rand_ptr,libRmath),Ptr{Cvoid}), |
| 61 | + cfunction(randn,Float64,Tuple{})) |
| 62 | + unsafe_store!(cglobal((:exp_rand_ptr,libRmath),Ptr{Cvoid}), |
| 63 | + cfunction(Random.randexp,Float64,Tuple{})) |
| 64 | + end |
53 | 65 | end
|
54 | 66 |
|
55 | 67 | ## Macro for deferring freeing data until GC for wilcox and signrank
|
|
0 commit comments