Skip to content

Commit 638545a

Browse files
committed
0.5 and 0.6 pass tests without errors/warnings!
1 parent 4274202 commit 638545a

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
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:

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ end
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/toeplitzhankel.jl

Lines changed: 2 additions & 2 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

test/fftBigFloattest.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ p = plan_dct(c)
1212
@test norm(dct(c) - p*c) == 0
1313

1414
pi = plan_idct!(c)
15-
@test norm(pi*dct(c) - c) < 400norm(c)*eps(BigFloat)
15+
@test norm(pi*dct(c) - c) < 500norm(c)*eps(BigFloat)
1616

1717
@test norm(dct(c)-dct(map(Float64,c)),Inf) < 10eps()
1818

19-
cc = cis(c)
19+
cc = cis.(c)
2020
@test norm(dct(cc)-dct(map(Complex{Float64},cc)),Inf) < 10eps()

test/runtests.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -190,17 +190,17 @@ include("fftBigFloattest.jl")
190190

191191
println("Testing equivalence of CXN and ASY methods")
192192

193-
for k in round(Int,logspace(1,4,20))
194-
r = randn(k)./(1:k) # Proven 𝒪(√(log N)) error for ASY method.
195-
@test_approx_eq leg2cheb(r) cjt(r,0.,0.)
193+
for k in round.([Int],logspace(1,4,20))
194+
r = randn(k)./().(1:k) # Proven 𝒪(√(log N)) error for ASY method.
195+
@test leg2cheb(r) cjt(r,0.,0.)
196196
end
197197

198-
@test_approx_eq leg2chebu([1.0,2,3,4,5]) [0.546875,0.5,0.5390625,1.25,1.3671875]
198+
@test leg2chebu([1.0,2,3,4,5]) [0.546875,0.5,0.5390625,1.25,1.3671875]
199199

200-
c = randn(1000)./(1:1000);
200+
c = randn(1000)./().(1:1000);
201201

202-
@test_approx_eq leg2cheb(cheb2leg(c)) c
203-
@test_approx_eq cheb2leg(leg2cheb(c)) c
202+
@test leg2cheb(cheb2leg(c)) c
203+
@test cheb2leg(leg2cheb(c)) c
204204

205205
@test norm(jac2jac(c,0.,2/2,-1/4,2/2)-jjt(c,0.,2/2,-1/4,2/2),Inf) < 10length(c)*eps()
206206

@@ -213,10 +213,10 @@ N=div((n+1)*(n+2),2)
213213
v=rand(N) #Length of v is the no. of Padua points
214214
Pl=plan_paduatransform!(v)
215215
IPl=plan_ipaduatransform!(v)
216-
@test_approx_eq Pl*(IPl*copy(v)) v
217-
@test_approx_eq IPl*(Pl*copy(v)) v
218-
@test_approx_eq Pl*copy(v) paduatransform(v)
219-
@test_approx_eq IPl*copy(v) ipaduatransform(v)
216+
@test Pl*(IPl*copy(v)) v
217+
@test IPl*(Pl*copy(v)) v
218+
@test Pl*copy(v) paduatransform(v)
219+
@test IPl*copy(v) ipaduatransform(v)
220220

221221
# check that the return vector is NOT reused
222222
Pl=plan_paduatransform!(v)
@@ -241,7 +241,7 @@ Interpolates a 2d function at a given point using 2d Chebyshev series.
241241
function paduaeval(f::Function,x::AbstractFloat,y::AbstractFloat,m::Integer,lex)
242242
T=promote_type(typeof(x),typeof(y))
243243
M=div((m+1)*(m+2),2)
244-
pvals=Array(T,M)
244+
pvals=Vector{T}(M)
245245
p=paduapoints(T,m)
246246
map!(f,pvals,p[:,1],p[:,2])
247247
coeffs=paduatransform(pvals,lex)
@@ -257,11 +257,11 @@ m=130
257257
l=80
258258
f_m=paduaeval(f_xy,x,y,m,Val{true})
259259
g_l=paduaeval(g_xy,x,y,l,Val{true})
260-
@test_approx_eq f_xy(x,y) f_m
261-
@test_approx_eq g_xy(x,y) g_l
260+
@test f_xy(x,y) f_m
261+
@test g_xy(x,y) g_l
262262

263263

264264
f_m=paduaeval(f_xy,x,y,m,Val{false})
265265
g_l=paduaeval(g_xy,x,y,l,Val{false})
266-
@test_approx_eq f_xy(x,y) f_m
267-
@test_approx_eq g_xy(x,y) g_l
266+
@test f_xy(x,y) f_m
267+
@test g_xy(x,y) g_l

0 commit comments

Comments
 (0)