@@ -12,21 +12,22 @@ import FastTransforms: th_leg2cheb, th_cheb2leg, th_ultra2ultra,th_jac2jac, th_l
1212 @test th_jac2jac (x,0.1 , 0.2 ,0.1 ,0.4 ) ≈ lib_jac2jac (x, 0.1 , 0.2 ,0.1 ,0.4 )
1313 @test th_jac2jac (x,0.1 , 0.2 ,0.3 ,0.2 ) ≈ lib_jac2jac (x, 0.1 , 0.2 ,0.3 ,0.2 )
1414
15- @test all (th_leg2cheb (x) .=== leg2cheb (x))
16- @test all (th_cheb2leg (x) .=== cheb2leg (x))
1715
1816 @test th_cheb2leg (th_leg2cheb (x)) ≈ x atol= 1E-9
1917 @test th_leg2cheb (th_cheb2leg (x)) ≈ x atol= 1E-10
2018 end
2119
2220 for X in (randn (5 ,4 ), randn (5 ,4 ) + im* randn (5 ,4 ))
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 )
21+ @test th_leg2cheb (X, 1 ) ≈ hcat ([leg2cheb (X[:,j]) for j= 1 : size (X,2 )]. .. )
22+ @test_broken th_leg2cheb (X, 1 ) ≈ leg2cheb (X, 1 )
23+ @test th_leg2cheb (X, 2 ) ≈ vcat ([permutedims (leg2cheb (X[k,:])) for k= 1 : size (X,1 )]. .. )
24+ @test_broken th_leg2cheb (X, 2 ) ≈ leg2cheb (X, 2 )
25+ @test th_leg2cheb (X) ≈ th_leg2cheb (th_leg2cheb (X, 1 ), 2 )
26+ @test_broken th_leg2cheb (X) ≈ leg2cheb (X)
2627
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 )
28+ @test th_cheb2leg (X, 1 ) ≈ hcat ([cheb2leg (X[:,j]) for j= 1 : size (X,2 )]. .. )
29+ @test th_cheb2leg (X, 2 ) ≈ vcat ([permutedims (cheb2leg (X[k,:])) for k= 1 : size (X,1 )]. .. )
30+ @test th_cheb2leg (X) ≈ th_cheb2leg (th_cheb2leg (X, 1 ), 2 )
3031
3132 @test th_cheb2leg (X) == plan_th_cheb2leg! (X, 1 : 2 )* copy (X)
3233 @test th_leg2cheb (X) == plan_th_leg2cheb! (X, 1 : 2 )* copy (X)
@@ -37,16 +38,16 @@ import FastTransforms: th_leg2cheb, th_cheb2leg, th_ultra2ultra,th_jac2jac, th_l
3738 @testset " BigFloat" begin
3839 n = 10
3940 x = big .(collect (1.0 : n))
40- @test leg2cheb (x) ≈ lib_leg2cheb (x)
41- @test cheb2leg (x) ≈ lib_cheb2leg (x)
41+ @test th_leg2cheb (x) ≈ lib_leg2cheb (x)
42+ @test th_cheb2leg (x) ≈ lib_cheb2leg (x)
4243 end
4344
4445 @testset " jishnub example" begin
4546 x = chebyshevpoints (4096 );
4647 f = x -> cospi (1000 x);
4748 y = f .(x);
48- v = cheb2leg (chebyshevtransform (y))
49- @test norm (v - cheb2leg ( leg2cheb (v)), Inf ) ≤ 1E-13
50- @test norm (v - cheb2leg ( leg2cheb (v)))/ norm (v) ≤ 1E-14
49+ v = th_cheb2leg (chebyshevtransform (y))
50+ @test norm (v - th_cheb2leg ( th_leg2cheb (v)), Inf ) ≤ 1E-13
51+ @test norm (v - th_cheb2leg ( th_leg2cheb (v)))/ norm (v) ≤ 1E-14
5152 end
5253end
0 commit comments