@@ -12,21 +12,22 @@ import FastTransforms: th_leg2cheb, th_cheb2leg, th_ultra2ultra,th_jac2jac, th_l
12
12
@test th_jac2jac (x,0.1 , 0.2 ,0.1 ,0.4 ) ≈ lib_jac2jac (x, 0.1 , 0.2 ,0.1 ,0.4 )
13
13
@test th_jac2jac (x,0.1 , 0.2 ,0.3 ,0.2 ) ≈ lib_jac2jac (x, 0.1 , 0.2 ,0.3 ,0.2 )
14
14
15
- @test all (th_leg2cheb (x) .=== leg2cheb (x))
16
- @test all (th_cheb2leg (x) .=== cheb2leg (x))
17
15
18
16
@test th_cheb2leg (th_leg2cheb (x)) ≈ x atol= 1E-9
19
17
@test th_leg2cheb (th_cheb2leg (x)) ≈ x atol= 1E-10
20
18
end
21
19
22
20
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)
26
27
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 )
30
31
31
32
@test th_cheb2leg (X) == plan_th_cheb2leg! (X, 1 : 2 )* copy (X)
32
33
@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
37
38
@testset " BigFloat" begin
38
39
n = 10
39
40
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)
42
43
end
43
44
44
45
@testset " jishnub example" begin
45
46
x = chebyshevpoints (4096 );
46
47
f = x -> cospi (1000 x);
47
48
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
51
52
end
52
53
end
0 commit comments