Skip to content

Commit b16154b

Browse files
committed
Update the library to work with the recent changes to BigInt
1 parent 7620278 commit b16154b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/Catalan.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function doublefactorial(n::Integer)
6464
end
6565
z = BigInt()
6666
ccall((:__gmpz_2fac_ui, :libgmp), Void,
67-
(Ptr{Void}, Uint), z.mpz, uint(n))
67+
(Ptr{BigInt}, Uint), &z, uint(n))
6868
return z
6969
end
7070

@@ -74,7 +74,7 @@ function fibonacci(n::Integer)
7474
end
7575
z = BigInt()
7676
ccall((:__gmpz_fib_ui, :libgmp), Void,
77-
(Ptr{Void}, Uint), z.mpz, uint(n))
77+
(Ptr{BigInt}, Uint), &z, uint(n))
7878
return z
7979
end
8080

@@ -85,7 +85,7 @@ function jacobisymbol(a::Integer, b::Integer)
8585
ba = BigInt(a)
8686
bb = BigInt(b)
8787
return ccall((:__gmpz_jacobi, :libgmp), Int,
88-
(Ptr{Void}, Ptr{Void}), ba.mpz, bb.mpz)
88+
(Ptr{BigInt}, Ptr{BigInt}), &ba, &bb)
8989
end
9090

9191
#Computes Lassalle's sequence
@@ -102,7 +102,7 @@ function legendresymbol(a::Integer, b::Integer)
102102
ba = BigInt(a)
103103
bb = BigInt(b)
104104
return ccall((:__gmpz_legendre, :libgmp), Int,
105-
(Ptr{Void}, Ptr{Void}), ba.mpz, bb.mpz)
105+
(Ptr{BigInt}, Ptr{BigInt}), &ba, &bb)
106106
end
107107

108108
function lucas(n::Integer)
@@ -111,7 +111,7 @@ function lucas(n::Integer)
111111
end
112112
z = BigInt()
113113
ccall((:__gmpz_lucnum_ui, :libgmp), Void,
114-
(Ptr{Void}, Uint), z.mpz, uint(n))
114+
(Ptr{BigInt}, Uint), &z, uint(n))
115115
return z
116116
end
117117

@@ -121,7 +121,7 @@ function multifactorial(n::Integer, m::Integer)
121121
end
122122
z = BigInt()
123123
ccall((:__gmpz_mfac_uiui, :libgmp), Void,
124-
(Ptr{Void}, Uint, Uint), z.mpz, uint(n), uint(m))
124+
(Ptr{BigInt}, Uint, Uint), &z, uint(n), uint(m))
125125
return z
126126
end
127127

@@ -142,7 +142,7 @@ function primorial(n::Integer)
142142
end
143143
z = BigInt()
144144
ccall((:__gmpz_primorial_ui, :libgmp), Void,
145-
(Ptr{Void}, Uint), z.mpz, uint(n))
145+
(Ptr{BigInt}, Uint), &z, uint(n))
146146
return z
147147
end
148148

@@ -161,15 +161,15 @@ function integer_partitions(n::Integer)
161161
elseif n == 1
162162
return Vector{Int}[[1]]
163163
end
164-
164+
165165
list = Vector{Int}[]
166-
166+
167167
for p in integer_partitions(n-1)
168168
push!(list, [p, 1])
169169
if length(p) == 1 || p[end] < p[end-1]
170170
push!(list, [p[1:end-1], p[end]+1])
171171
end
172-
end
172+
end
173173

174174
list
175175
end

src/youngdiagrams.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function MN1inner(R::Vector{Int64}, T::Dict, μ::Partition, t::Integer)
134134
if isrimhook(R[i], R[i+μ[t]])
135135
R[i], R[i+μ[t]] = R[i+μ[t]], R[i]
136136
rhohat = R[i:i+μ[t]]
137-
if !has(T, rhohat) #Cache result in lookup table
137+
if !haskey(T, rhohat) #Cache result in lookup table
138138
T[rhohat] = MN1inner(R, T, μ, t+1)
139139
end
140140
χ += σ * T[rhohat]

0 commit comments

Comments
 (0)