Skip to content

Commit 01bd59f

Browse files
committed
• Fixes 0.6 deprecation warnings
• Drops 0.4 support
1 parent c7c505a commit 01bd59f

File tree

9 files changed

+35
-36
lines changed

9 files changed

+35
-36
lines changed

REQUIRE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
julia 0.4
1+
julia 0.5
22
ToeplitzMatrices 0.1
3-
Compat 0.8.4

src/ChebyshevJacobiPlan.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function ForwardChebyshevJacobiPlan{T}(c_jac::AbstractVector{T},α::T,β::T,M::I
134134
θ = N > 0 ? T[k/N for k=zero(T):N] : T[0]
135135

136136
# Initialize sines and cosines
137-
tempsin = sinpi/2)
137+
tempsin = sinpi.(θ./2)
138138
tempcos = reverse(tempsin)
139139
tempcosβsinα,tempmindices = zero(c_jac),zero(c_jac)
140140
@inbounds for i=1:N+1 tempcosβsinα[i] = tempcos[i]^+1/2)*tempsin[i]^+1/2) end
@@ -176,7 +176,7 @@ function BackwardChebyshevJacobiPlan{T}(c_cheb::AbstractVector{T},α::T,β::T,M:
176176
w = N > 0 ? clenshawcurtisweights(2N+1,α,β,p₁) : T[0]
177177

178178
# Initialize sines and cosines
179-
tempsin = sinpi/2)
179+
tempsin = sinpi.(θ./2)
180180
tempcos = reverse(tempsin)
181181
tempcosβsinα,tempmindices = zero(c_cheb2),zero(c_cheb2)
182182
@inbounds for i=1:2N+1 tempcosβsinα[i] = tempcos[i]^+1/2)*tempsin[i]^+1/2) end

src/ChebyshevUltrasphericalPlan.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ function ForwardChebyshevUltrasphericalPlan{T}(c_ultra::AbstractVector{T},λ::T,
131131
θ = N > 0 ? T[k/N for k=zero(T):N] : T[0]
132132

133133
# Initialize sines and cosines
134-
tempsin = sinpi(θ)
134+
tempsin = sinpi.(θ)
135135
@inbounds for i = 1:N÷2 tempsin[N+2-i] = tempsin[i] end
136-
tempsin2 = sinpi/2)
136+
tempsin2 = sinpi.(θ./2)
137137
tempsinλ,tempmindices = zero(c_ultra),zero(c_ultra)
138138
@inbounds for i=1:N+1 tempsinλ[i] = tempsin[i]^λ end
139139
tempsinλm = similar(tempsinλ)
@@ -172,9 +172,9 @@ function BackwardChebyshevUltrasphericalPlan{T}(c_ultra::AbstractVector{T},λ::T
172172
w = N > 0 ? clenshawcurtisweights(2N+1-half(λ),λ-half(λ),p₁) : T[0]
173173

174174
# Initialize sines and cosines
175-
tempsin = sinpi(θ)
175+
tempsin = sinpi.(θ)
176176
@inbounds for i = 1:N tempsin[2N+2-i] = tempsin[i] end
177-
tempsin2 = sinpi/2)
177+
tempsin2 = sinpi./2)
178178
tempsinλ,tempmindices = zero(c_cheb2),zero(c_cheb2)
179179
@inbounds for i=1:2N+1 tempsinλ[i] = tempsin[i]^λ end
180180
tempsinλm = similar(tempsinλ)

src/FastTransforms.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
__precompile__()
22
module FastTransforms
33

4-
using Base, ToeplitzMatrices, Compat
4+
using Base, ToeplitzMatrices
55

66
import Base: *
7-
import Compat: view
7+
import Base: view
88

99
export cjt, icjt, jjt, plan_cjt, plan_icjt
1010
export leg2cheb, cheb2leg, leg2chebu, ultra2ultra, jac2jac
@@ -53,5 +53,5 @@ include("gaunt.jl")
5353

5454
include("precompile.jl")
5555
_precompile_()
56-
56+
5757
end # module

src/cjt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ end
101101

102102
function *{D,T<:AbstractFloat}(p::FastTransformPlan{D,T},c::AbstractVector{Complex{T}})
103103
cr,ci = reim(c)
104-
complex(p*cr,p*ci)
104+
complex.(p*cr,p*ci)
105105
end
106106

107107
function *(p::FastTransformPlan,c::AbstractMatrix)

src/fftBigFloat.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function Base.fft{T<:BigFloats}(x::Vector{T})
1010
n = length(x)
1111
ispow2(n) && return fft_pow2(x)
1212
ks = linspace(zero(real(T)),n-one(real(T)),n)
13-
Wks = exp(-im*convert(T,π)*ks.^2/n)
13+
Wks = exp.((-im).*convert(T,π).*ks.^2./n)
1414
xq,wq = x.*Wks,conj([exp(-im*convert(T,π)*n);reverse(Wks);Wks[2:end]])
1515
return Wks.*conv(xq,wq)[n+1:2n]
1616
end
@@ -90,14 +90,14 @@ end
9090
function fft_pow2{T<:BigFloat}(x::Vector{Complex{T}})
9191
y = interlace(real(x),imag(x))
9292
fft_pow2!(y)
93-
return complex(y[1:2:end],y[2:2:end])
93+
return complex.(y[1:2:end],y[2:2:end])
9494
end
9595
fft_pow2{T<:BigFloat}(x::Vector{T}) = fft_pow2(complex(x))
9696

9797
function ifft_pow2{T<:BigFloat}(x::Vector{Complex{T}})
9898
y = interlace(real(x),-imag(x))
9999
fft_pow2!(y)
100-
return complex(y[1:2:end],-y[2:2:end])/length(x)
100+
return complex.(y[1:2:end],-y[2:2:end])/length(x)
101101
end
102102

103103

src/specialfunctions.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ two{T<:Number}(::Type{T}) = convert(T,2)
2424
The Kronecker δ function.
2525
"""
2626
δ(k::Integer,j::Integer) = k == j ? 1 : 0
27-
@vectorize_2arg Integer δ
27+
2828

2929
"""
3030
Pochhammer symbol (x)_n = Γ(x+n)/Γ(x) for the rising factorial.
@@ -96,7 +96,7 @@ function stirlingseries(z::Float64)
9696
end
9797
end
9898

99-
@vectorize_1arg Number stirlingseries
99+
100100

101101
stirlingremainder(z::Number,N::Int) = (1+zeta(N))*gamma(N)/((2π)^(N+1)*z^N)/stirlingseries(z)
102102
stirlingremainder{T<:Number}(z::AbstractVector{T},N::Int) = (1+zeta(N))*gamma(N)/(2π)^(N+1)./z.^N./stirlingseries(z)
@@ -152,7 +152,7 @@ function Λ(x::Float64)
152152
(x+1.0)*Λ(x+1.0)/(x+0.5)
153153
end
154154
end
155-
@vectorize_1arg Number Λ
155+
156156

157157
"""
158158
The Lambda function Λ(z,λ₁,λ₂) = Γ(z+λ₁)/Γ(z+λ₂) for the ratio of gamma functions.

test/fftBigFloattest.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ using FastTransforms
22
using Base.Test
33

44
c = collect(linspace(-big(1.0),1,16))
5-
@test norm(fft(c) - fft(map(Float64,c))) < 3Float64(norm(c))*eps()
6-
@test norm(ifft(c) - ifft(map(Float64,c))) < 3Float64(norm(c))*eps()
5+
@test norm(fft(c) - fft(Float64.(c))) < 3Float64(norm(c))*eps()
6+
@test norm(ifft(c) - ifft(Float64.(c))) < 3Float64(norm(c))*eps()
77

88
c = collect(linspace(-big(1.0),1.0,201))
99
@test norm(ifft(fft(c))-c) < 200norm(c)eps(BigFloat)

test/runtests.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ n = 0:1000_000
88
@time FastTransforms.Cnλ(n,λ);
99

1010
x = linspace(0,20,81);
11-
@test norm((FastTransforms.Λ(x)-FastTransforms.Λ(big(x)))./FastTransforms.Λ(big(x)),Inf) < 2eps()
11+
@test norm((FastTransforms.Λ.(x)-FastTransforms.Λ.(big.(x)))./FastTransforms.Λ.(big.(x)),Inf) < 2eps()
1212

1313
x = 0:0.5:10_000
1414
λ₁,λ₂ = 0.125,0.875
15-
@test norm((FastTransforms.Λ(x,λ₁,λ₂)-FastTransforms.Λ(big(x),big(λ₁),big(λ₂)))./FastTransforms.Λ(big(x),big(λ₁),big(λ₂)),Inf) < 4eps()
15+
@test norm((FastTransforms.Λ.(x,λ₁,λ₂).-FastTransforms.Λ.(big.(x),big(λ₁),big(λ₂)))./FastTransforms.Λ.(big.(x),big(λ₁),big(λ₂)),Inf) < 4eps()
1616
λ₁,λ₂ = 1//3,2//3
17-
@test norm((FastTransforms.Λ(x,Float64(λ₁),Float64(λ₂))-FastTransforms.Λ(big(x),big(λ₁),big(λ₂)))./FastTransforms.Λ(big(x),big(λ₁),big(λ₂)),Inf) < 4eps()
17+
@test norm((FastTransforms.Λ.(x,Float64(λ₁),Float64(λ₂))-FastTransforms.Λ.(big.(x),big(λ₁),big(λ₂)))./FastTransforms.Λ.(big.(x),big(λ₁),big(λ₂)),Inf) < 4eps()
1818

1919
n = 0:1000
2020
α = 0.125
@@ -31,11 +31,11 @@ N = 20
3131
f(x) = exp(x)
3232

3333
x,w = FastTransforms.fejer1(N,0.,0.)
34-
@test norm(dot(f(x),w)-2sinh(1)) 4eps()
34+
@test norm(dot(f.(x),w)-2sinh(1)) 4eps()
3535
x,w = FastTransforms.fejer2(N,0.,0.)
36-
@test norm(dot(f(x),w)-2sinh(1)) 4eps()
36+
@test norm(dot(f.(x),w)-2sinh(1)) 4eps()
3737
x,w = FastTransforms.clenshawcurtis(N,0.,0.)
38-
@test norm(dot(f(x),w)-2sinh(1)) 4eps()
38+
@test norm(dot(f.(x),w)-2sinh(1)) 4eps()
3939

4040
#=
4141
x = Fun(identity)
@@ -44,11 +44,11 @@ val = sum(g)
4444
=#
4545

4646
x,w = FastTransforms.fejer1(N,0.25,0.35)
47-
@test norm(dot(f(x),w)-2.0351088204147243) 4eps()
47+
@test norm(dot(f.(x),w)-2.0351088204147243) 4eps()
4848
x,w = FastTransforms.fejer2(N,0.25,0.35)
49-
@test norm(dot(f(x),w)-2.0351088204147243) 4eps()
49+
@test norm(dot(f.(x),w)-2.0351088204147243) 4eps()
5050
x,w = FastTransforms.clenshawcurtis(N,0.25,0.35)
51-
@test norm(dot(f(x),w)-2.0351088204147243) 4eps()
51+
@test norm(dot(f.(x),w)-2.0351088204147243) 4eps()
5252

5353
println("Testing the Chebyshev–Jacobi transform")
5454

@@ -57,7 +57,7 @@ v = zeros(Nr)
5757
Na,Nb = 5,5
5858
V = zeros(Na,Nb)
5959

60-
for N in round(Int,logspace(1,3,3))
60+
for N in round.(Int,logspace(1,3,3))
6161
println("")
6262
println("N = ",N)
6363
println("")
@@ -117,7 +117,7 @@ c_11 = [1.13031820798497,0.7239875720908708,0.21281687927358628,0.04004015866217
117117
@test norm(icjt(c_cheb,0.5,0.5)-c_11,Inf) < eps()
118118

119119

120-
c = exp(-collect(1:1000)./30)
120+
c = exp.(collect(1:1000)./(-30))
121121

122122
println("Testing increment/decrement operators for α,β ≤ -0.5")
123123

@@ -158,11 +158,11 @@ p1,p2 = plan_cjt(c,α,β),plan_icjt(c,α,β)
158158
println("Testing for complex coefficients")
159159

160160
α,β = 0.12,0.34
161-
c = complex(rand(100),rand(100))
161+
c = complex.(rand(100),rand(100))
162162

163-
@test cjt(c,α,β) == complex(cjt(real(c),α,β),cjt(imag(c),α,β))
164-
@test icjt(c,α,β) == complex(icjt(real(c),α,β),icjt(imag(c),α,β))
165-
@test jjt(c,α,β,α,β) == complex(jjt(real(c),α,β,α,β),jjt(imag(c),α,β,α,β))
163+
@test cjt(c,α,β) == complex.(cjt(real(c),α,β),cjt(imag(c),α,β))
164+
@test icjt(c,α,β) == complex.(icjt(real(c),α,β),icjt(imag(c),α,β))
165+
@test jjt(c,α,β,α,β) == complex.(jjt(real(c),α,β,α,β),jjt(imag(c),α,β,α,β))
166166
@test norm(jjt(c,α,β,α,β)-c,Inf) < 200eps()
167167

168168
println("Testing for Vector{Float32}")
@@ -178,7 +178,7 @@ cL32 = cjt(c32,0.f0,0.f0)
178178
println("Testing for Matrix of coefficients")
179179

180180
c = rand(100,100)
181-
@test maxabs(jjt(c,α,β,α,β)-c) < 10000eps()
181+
@test maximum(abs,jjt(c,α,β,α,β)-c) < 10000eps()
182182

183183
println("Testing Gaunt coefficients")
184184

0 commit comments

Comments
 (0)