Skip to content

Commit dee4f32

Browse files
committed
0.6 updates
1 parent e2137d9 commit dee4f32

File tree

4 files changed

+43
-17
lines changed

4 files changed

+43
-17
lines changed

src/FastTransforms.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import HierarchicalMatrices: mul!, At_mul_B!, Ac_mul_B!
3333
import HierarchicalMatrices: ThreadSafeVector, threadsafezeros
3434
import LowRankApprox: ColPerm
3535
import AbstractFFTs: Plan
36-
36+
import Compat: range
3737

3838
export cjt, icjt, jjt, plan_cjt, plan_icjt
3939
export leg2cheb, cheb2leg, leg2chebu, ultra2ultra, jac2jac

test/basictests.jl

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,48 @@ end
7676
@test norm(sum(w./(x .- 3)) - π^2/12) 4eps()
7777
end
7878

79-
@testset "Allocation-free ID matrix-vector products" begin
80-
for T in (Float64, ComplexF64)
81-
r = rand(T)
82-
A = idfact([r/(i+j-1) for i in 1:200, j = 1:50])
83-
P = A[:P]
84-
k, n = size(A)
79+
if VERSION < v"0.7-"
80+
@testset "Allocation-free ID matrix-vector products" begin
81+
for T in (Float64, ComplexF64)
82+
r = rand(T)
83+
A = idfact([r/(i+j-1) for i in 1:200, j = 1:50])
84+
P = A[:P]
85+
k, n = size(A)
8586

86-
x = rand(T, n)
87-
y = zeros(T, k)
87+
x = rand(T, n)
88+
y = zeros(T, k)
8889

89-
@test norm(FastTransforms.mul!(y, A, P, x, 1, 1) - A*x) < 10eps()*norm(A*x)
90+
@test norm(FastTransforms.mul!(y, A, P, x, 1, 1) - A*x) < 10eps()*norm(A*x)
9091

91-
x = rand(T, k)
92-
y = zeros(T, n)
92+
x = rand(T, k)
93+
y = zeros(T, n)
9394

94-
@test norm(FastTransforms.At_mul_B!(y, A, P, x, 1, 1) - transpose(A)*x, Inf) < 10eps()
95+
@test norm(FastTransforms.At_mul_B!(y, A, P, x, 1, 1) - At_mul_B(A,x), Inf) < 10eps()
9596

96-
fill!(y, zero(T))
97-
@test norm(FastTransforms.Ac_mul_B!(y, A, P, x, 1, 1) - A'x, Inf) < 10eps()
97+
fill!(y, zero(T))
98+
@test norm(FastTransforms.Ac_mul_B!(y, A, P, x, 1, 1) - A'x, Inf) < 10eps()
99+
end
100+
end
101+
else
102+
@testset "Allocation-free ID matrix-vector products" begin
103+
for T in (Float64, ComplexF64)
104+
r = rand(T)
105+
A = idfact([r/(i+j-1) for i in 1:200, j = 1:50])
106+
P = A[:P]
107+
k, n = size(A)
108+
109+
x = rand(T, n)
110+
y = zeros(T, k)
111+
112+
@test norm(FastTransforms.mul!(y, A, P, x, 1, 1) - A*x) < 10eps()*norm(A*x)
113+
114+
x = rand(T, k)
115+
y = zeros(T, n)
116+
117+
@test norm(FastTransforms.At_mul_B!(y, A, P, x, 1, 1) - transpose(A)*x, Inf) < 10eps()
118+
119+
fill!(y, zero(T))
120+
@test norm(FastTransforms.Ac_mul_B!(y, A, P, x, 1, 1) - A'x, Inf) < 10eps()
121+
end
98122
end
99123
end

test/butterflytests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ using Compat.Test, Compat.LinearAlgebra
33

44
if VERSION < v"0.7-"
55
const mul! = Base.A_mul_B!
6+
const lmul! = Base.scale!
7+
const rmul! = Base.scale!
68
else
79
Ac_mul_B!(C, A, B) = mul!(C, A', B)
810
At_mul_B!(C, A, B) = mul!(C, transpose(A), B)

test/nuffttests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ end
8080
x = ω/n
8181
fftc = fft(c)
8282
if Base.Sys.WORD_SIZE == 64
83-
@test_broken norm(nufft1(c, ω, ϵ) - fftc) == 0
83+
@test_skip norm(nufft1(c, ω, ϵ) - fftc) == 0 # skip because fftw3 seems to change this
8484
@test norm(nufft2(c, x, ϵ) - fftc) == 0
85-
@test_broken norm(nufft3(c, x, ω, ϵ) - fftc) == 0
85+
@test_skip norm(nufft3(c, x, ω, ϵ) - fftc) == 0 # skip because fftw3 seems to change this
8686
end
8787
err_bnd = 500*eps(Float64)*norm(c)
8888
@test norm(nufft1(c, ω, ϵ) - fftc) < err_bnd

0 commit comments

Comments
 (0)