Skip to content

Commit 13ea614

Browse files
authored
fix TH tests (#207)
* fix TH tests, only use TH for vectors since higher dimensions will not have a 100k per dimension * adjust tol * stick to TH for now with matrices since Lib doesn't have matrix interface * v0.15.1
1 parent 4e97792 commit 13ea614

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "FastTransforms"
22
uuid = "057dd010-8810-581a-b7be-e3fc3b93f78c"
3-
version = "0.15"
3+
version = "0.15.1"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/FastTransforms.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,17 @@ for f in (:jac2jac,
120120
:sph2fourier, :sphv2fourier, :disk2cxf, :ann2cxf,
121121
:rectdisk2cheb, :tri2cheb, :tet2cheb)
122122
lib_f = Symbol("lib_", f)
123-
@eval $f(x::AbstractArray, y...; z...) = $lib_f(x::AbstractArray, y...; z...)
123+
@eval $f(x::AbstractArray, y...; z...) = $lib_f(x, y...; z...)
124124
end
125125

126126
# following use Toeplitz-Hankel to avoid expensive plans
127127
for f in (:leg2cheb, :cheb2leg, :ultra2ultra)
128128
th_f = Symbol("th_", f)
129-
@eval $f(x::AbstractArray, y...; z...) = $th_f(x::AbstractArray, y...; z...)
129+
lib_f = Symbol("lib_", f)
130+
@eval begin
131+
$f(x::AbstractArray, y...; z...) = $th_f(x, y...; z...)
132+
# $f(x::AbstractArray, y...; z...) = $lib_f(x, y...; z...)
133+
end
130134
end
131135

132136

src/toeplitzhankel.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ function _cheb2legTH_TLC(::Type{S}, mn, d) where S
239239
t[1:2:end] = Λ.(0:one(S̃):div(n-2,2), -half(S̃), one(S̃))
240240
end
241241
h = Λ.(1:half(S̃):n-1, zero(S̃), 3half(S̃))
242-
D = 1:one(S):n-1
242+
D = 1:n-1
243243
DL = (3half(S̃):n-half(S̃)) ./ D
244244
DR = -(one(S̃):n-one(S̃)) ./ (4 .* D)
245245
C = hankel_partialchol(h, D)

test/toeplitzhankeltests.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ import FastTransforms: th_leg2cheb, th_cheb2leg, th_ultra2ultra,th_jac2jac, th_l
1616
@test all(th_cheb2leg(x) .=== cheb2leg(x))
1717

1818
@test th_cheb2leg(th_leg2cheb(x)) x atol=1E-9
19-
@test th_leg2leg(th_cheb2cheb(x)) x atol=1E-11
19+
@test th_leg2cheb(th_cheb2leg(x)) x atol=1E-10
2020
end
2121

2222
for X in (randn(5,4), randn(5,4) + im*randn(5,4))
23-
@test th_leg2cheb(X, 1) hcat([leg2cheb(X[:,j]) for j=1:size(X,2)]...)
24-
@test th_leg2cheb(X, 2) vcat([permutedims(leg2cheb(X[k,:])) for k=1:size(X,1)]...)
25-
@test th_leg2cheb(X) th_leg2cheb(th_leg2cheb(X, 1), 2)
23+
@test th_leg2cheb(X, 1) leg2cheb(X, 1) hcat([leg2cheb(X[:,j]) for j=1:size(X,2)]...)
24+
@test th_leg2cheb(X, 2) leg2cheb(X, 2) vcat([permutedims(leg2cheb(X[k,:])) for k=1:size(X,1)]...)
25+
@test th_leg2cheb(X) leg2cheb(X) th_leg2cheb(th_leg2cheb(X, 1), 2)
2626

27-
@test th_cheb2leg(X, 1) hcat([cheb2leg(X[:,j]) for j=1:size(X,2)]...)
28-
@test th_cheb2leg(X, 2) vcat([permutedims(cheb2leg(X[k,:])) for k=1:size(X,1)]...)
29-
@test th_cheb2leg(X) th_cheb2leg(th_cheb2leg(X, 1), 2)
27+
@test th_cheb2leg(X, 1) cheb2leg(X, 1) hcat([cheb2leg(X[:,j]) for j=1:size(X,2)]...)
28+
@test th_cheb2leg(X, 2) cheb2leg(X, 2) vcat([permutedims(cheb2leg(X[k,:])) for k=1:size(X,1)]...)
29+
@test th_cheb2leg(X) cheb2leg(X) th_cheb2leg(th_cheb2leg(X, 1), 2)
3030

3131
@test th_cheb2leg(X) == plan_th_cheb2leg!(X, 1:2)*copy(X)
3232
@test th_leg2cheb(X) == plan_th_leg2cheb!(X, 1:2)*copy(X)

0 commit comments

Comments
 (0)