Skip to content

Commit 6081670

Browse files
authored
Merge pull request #13 from MikaelSlevinsky/support-0.6
WIP: Support 0.6
2 parents c7c505a + 638545a commit 6081670

12 files changed

+64
-65
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ os:
44
- linux
55
- osx
66
julia:
7-
- 0.4
87
- 0.5
98
- nightly
109
notifications:

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/PaduaTransform.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ Returns coordinates of the (n+1)(n+2)/2 Padua points.
194194
"""
195195
function paduapoints{T}(::Type{T},n::Integer)
196196
N=div((n+1)*(n+2),2)
197-
MM=Array(T,N,2)
197+
MM=Matrix{T}(N,2)
198198
m=0
199199
delta=0
200200
NN=fld(n+2,2)

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: 8 additions & 7 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,21 +90,22 @@ 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

104104
function Base.dct(a::AbstractArray{Complex{BigFloat}})
105105
N = big(length(a))
106106
c = fft([a; flipdim(a,1)])
107-
d = c[1:N] .* exp(-im*big(pi)*(0:N-1)/(2*N))
107+
d = c[1:N]
108+
d .*= exp.((-im*big(pi)).*(0:N-1)./(2*N))
108109
d[1] = d[1] / sqrt(big(2))
109110
scale!(inv(sqrt(2N)), d)
110111
end
@@ -115,7 +116,7 @@ function Base.idct(a::AbstractArray{Complex{BigFloat}})
115116
N = big(length(a))
116117
b = a * sqrt(2*N)
117118
b[1] = b[1] * sqrt(big(2))
118-
b = b .* exp(im*big(pi)*(0:N-1)/(2*N))
119+
b .*= exp.((im*big(pi)).*(0:N-1)./(2*N))
119120
b = [b; 0; conj(flipdim(b[2:end],1))]
120121
c = ifft(b)
121122
c[1:N]
@@ -151,8 +152,8 @@ for (Plan,ff,ff!) in ((:DummyFFTPlan,:fft,:fft!),
151152
(:DummyDCTPlan,:dct,:dct!),
152153
(:DummyiDCTPlan,:idct,:idct!))
153154
@eval begin
154-
*{T,N}(p::$Plan{T,true}, x::StridedArray{T,N})=$ff!(x)
155-
*{T,N}(p::$Plan{T,false}, x::StridedArray{T,N})=$ff(x)
155+
*{T,N}(p::$Plan{T,true}, x::StridedArray{T,N}) = $ff!(x)
156+
*{T,N}(p::$Plan{T,false}, x::StridedArray{T,N}) = $ff(x)
156157
function Base.A_mul_B!(C::StridedVector,p::$Plan,x::StridedVector)
157158
C[:]=$ff(x)
158159
C

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.

src/toeplitzhankel.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function partialchol(H::Hankel)
3434
v=[H[:,1];vec(H[end,2:end])]
3535
d=diag(H)
3636
@assert length(v) 2n-1
37-
reltol=maxabs(d)*eps(eltype(H))*log(n)
37+
reltol=maximum(abs,d)*eps(eltype(H))*log(n)
3838
for k=1:n
3939
mx,idx=findmax(d)
4040
if mx reltol break end
@@ -61,7 +61,7 @@ function partialchol(H::Hankel,D::AbstractVector)
6161
v=[H[:,1];vec(H[end,2:end])]
6262
d=diag(H).*D.^2
6363
@assert length(v) 2n-1
64-
reltol=maxabs(d)*eps(T)*log(n)
64+
reltol=maximum(abs,d)*eps(T)*log(n)
6565
for k=1:n
6666
mx,idx=findmax(d)
6767
if mx reltol break end
@@ -99,7 +99,7 @@ end
9999
# Diagonally-scaled Toeplitz∘Hankel polynomial transforms
100100

101101
function leg2chebTH{S}(::Type{S},n)
102-
λ = Λ(0:half(S):n-1)
102+
λ = Λ.(0:half(S):n-1)
103103
t = zeros(S,n)
104104
t[1:2:end] = λ[1:2:n]
105105
T = TriangularToeplitz(2t/π,:U)
@@ -122,9 +122,9 @@ function cheb2legTH{S}(::Type{S},n)
122122
end
123123

124124
function leg2chebuTH{S}(::Type{S},n)
125-
λ = Λ(0:half(S):n-1)
125+
λ = Λ.(0:half(S):n-1)
126126
t = zeros(S,n)
127-
t[1:2:end] = λ[1:2:n]./(((1:2:n)-2))
127+
t[1:2:end] = λ[1:2:n]./(((1:2:n).-2))
128128
T = TriangularToeplitz(-2t/π,:U)
129129
H = Hankel(λ[1:n]./((1:n)+1),λ[n:end]./((n:2n-1)+1))
130130
T,H

0 commit comments

Comments
 (0)