Skip to content

Commit ca9d03f

Browse files
committed
Remove Rmath sampling methods
1 parent 5115bd6 commit ca9d03f

File tree

3 files changed

+3
-26
lines changed

3 files changed

+3
-26
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "StatsFuns"
22
uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
3-
version = "1.5.0"
3+
version = "2.0.0"
44

55
[deps]
66
HypergeometricFunctions = "34004b35-14d8-5ef3-9330-4cdb6864b03a"

src/rmath.jl

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,9 @@ function _import_rmath(rname::Symbol, jname::Symbol, pargs)
3434
invlogcdf = Symbol(jname, "invlogcdf")
3535
invlogccdf = Symbol(jname, "invlogccdf")
3636

37-
is_tukey = rname == :tukey
38-
39-
rand = Symbol(jname, "rand")
40-
has_rand = true
41-
if rname == :nbeta || rname == :nf || rname == :nt || is_tukey
42-
has_rand = false
43-
end
44-
4537
# arguments & argument types
4638
_pts = fill(:Cdouble, length(pargs))
47-
39+
is_tukey = rname == :tukey
4840
if is_tukey
4941
dtypes = Expr(:tuple, :Cdouble, :Cdouble, _pts..., :Cint)
5042
ptypes = Expr(:tuple, :Cdouble, :Cdouble, _pts..., :Cint, :Cint)
@@ -117,11 +109,6 @@ function _import_rmath(rname::Symbol, jname::Symbol, pargs)
117109
T = float(Base.promote_typeof($(pargs...), lq))
118110
return convert(T, ccall(($qfun, libRmath), Float64, $qtypes, lq, $(pargs...), 0, 1))
119111
end
120-
121-
if $has_rand
122-
$rand($(pdecls...)) =
123-
ccall(($rfun, libRmath), Float64, $rtypes, $(pargs...))
124-
end
125112
end
126113
end
127114

test/rmath.jl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ function rmathcomp(basename, params, X::AbstractArray, rtol = _default_rtol(para
8585
rmath_invlogccdf = get_rmathfun(invlogccdf)
8686
end
8787

88-
# tackle rand specially
89-
has_rand = true
90-
if basename == "nbeta" || basename == "nfdist" || basename == "ntdist" || basename == "srdist"
91-
has_rand = false
92-
end
93-
rmath_rand = has_rand ? get_rmathfun(rand) : nothing
94-
9588
if has_pdf
9689
@testset "pdf with x=$x" for x in X
9790
check_rmath(
@@ -163,10 +156,7 @@ function rmathcomp(basename, params, X::AbstractArray, rtol = _default_rtol(para
163156
end
164157
end
165158

166-
# make sure that rand works
167-
return if has_rand
168-
rmath_rand(params...)
169-
end
159+
return nothing
170160
end
171161

172162
function rmathcomp_tests(basename, configs)

0 commit comments

Comments
 (0)