@@ -4,6 +4,7 @@ module DSFMT
4
4
5
5
import Base: copy, copy!, == , hash
6
6
using Base. GMP. MPZ
7
+ using dSFMT_jll
7
8
8
9
export DSFMT_state, dsfmt_get_min_array_size, dsfmt_get_idstring,
9
10
dsfmt_init_gen_rand, dsfmt_init_by_array, dsfmt_gv_init_by_array,
@@ -44,36 +45,36 @@ hash(s::DSFMT_state, h::UInt) = hash(s.val, h)
44
45
# # wrapper functions
45
46
46
47
function dsfmt_get_idstring ()
47
- idstring = ccall ((:dsfmt_get_idstring ,: libdSFMT ),
48
+ idstring = ccall ((:dsfmt_get_idstring ,libdSFMT),
48
49
Ptr{UInt8},
49
50
())
50
51
return unsafe_string (idstring)
51
52
end
52
53
53
54
function dsfmt_get_min_array_size ()
54
- min_array_size = ccall ((:dsfmt_get_min_array_size ,: libdSFMT ),
55
+ min_array_size = ccall ((:dsfmt_get_min_array_size ,libdSFMT),
55
56
Int32,
56
57
())
57
58
end
58
59
59
60
const dsfmt_min_array_size = dsfmt_get_min_array_size ()
60
61
61
62
function dsfmt_init_gen_rand (s:: DSFMT_state , seed:: UInt32 )
62
- ccall ((:dsfmt_init_gen_rand ,: libdSFMT ),
63
+ ccall ((:dsfmt_init_gen_rand ,libdSFMT),
63
64
Cvoid,
64
65
(Ptr{Cvoid}, UInt32,),
65
66
s. val, seed)
66
67
end
67
68
68
69
function dsfmt_init_by_array (s:: DSFMT_state , seed:: Vector{UInt32} )
69
- ccall ((:dsfmt_init_by_array ,: libdSFMT ),
70
+ ccall ((:dsfmt_init_by_array ,libdSFMT),
70
71
Cvoid,
71
72
(Ptr{Cvoid}, Ptr{UInt32}, Int32),
72
73
s. val, seed, length (seed))
73
74
end
74
75
75
76
function dsfmt_gv_init_by_array (seed:: Vector{UInt32} )
76
- ccall ((:dsfmt_gv_init_by_array ,: libdSFMT ),
77
+ ccall ((:dsfmt_gv_init_by_array ,libdSFMT),
77
78
Cvoid,
78
79
(Ptr{UInt32}, Int32),
79
80
seed, length (seed))
82
83
function dsfmt_fill_array_close1_open2! (s:: DSFMT_state , A:: Ptr{Float64} , n:: Int )
83
84
@assert Csize_t (A) % 16 == 0 # the underlying C array must be 16-byte aligned
84
85
@assert dsfmt_min_array_size <= n && iseven (n)
85
- ccall ((:dsfmt_fill_array_close1_open2 ,: libdSFMT ),
86
+ ccall ((:dsfmt_fill_array_close1_open2 ,libdSFMT),
86
87
Cvoid,
87
88
(Ptr{Cvoid}, Ptr{Float64}, Int),
88
89
s. val, A, n)
91
92
function dsfmt_fill_array_close_open! (s:: DSFMT_state , A:: Ptr{Float64} , n:: Int )
92
93
@assert Csize_t (A) % 16 == 0 # the underlying C array must be 16-byte aligned
93
94
@assert dsfmt_min_array_size <= n && iseven (n)
94
- ccall ((:dsfmt_fill_array_close_open ,: libdSFMT ),
95
+ ccall ((:dsfmt_fill_array_close_open ,libdSFMT),
95
96
Cvoid,
96
97
(Ptr{Cvoid}, Ptr{Float64}, Int),
97
98
s. val, A, n)
0 commit comments