1- using FastTransforms, Test
1+ using FastTransforms, Test, Random
22import FastTransforms: th_leg2cheb, th_cheb2leg, th_leg2chebu, th_ultra2ultra,th_jac2jac, th_leg2chebu,
33 lib_leg2cheb, lib_cheb2leg, lib_ultra2ultra, lib_jac2jac,
4- plan_th_cheb2leg!, plan_th_leg2chebu!, plan_th_leg2cheb!, plan_th_ultra2ultra!, plan_th_jac2jac!
4+ plan_th_cheb2leg!, plan_th_leg2chebu!, plan_th_leg2cheb!, plan_th_ultra2ultra!, plan_th_jac2jac!,
5+ th_cheb2jac, th_jac2cheb
6+
7+ Random. seed! (0 )
58
69@testset " ToeplitzHankel" begin
710 for x in ([1.0 ], [1.0 ,2 ,3 ,4 ,5 ], [1.0 + im,2 - 3im ,3 + 4im ,4 - 5im ,5 + 10im ], collect (1.0 : 1000 ))
@@ -26,11 +29,14 @@ import FastTransforms: th_leg2cheb, th_cheb2leg, th_leg2chebu, th_ultra2ultra,th
2629 @test th_jac2jac (x, - 1 / 2 ,- 1 / 2 ,1 / 2 ,0 ) ≈ lib_jac2jac (x, - 1 / 2 ,- 1 / 2 ,1 / 2 ,0 )
2730 @test th_jac2jac (x, - 1 / 2 ,- 1 / 2 ,0 ,1 / 2 ) ≈ lib_jac2jac (x, - 1 / 2 ,- 1 / 2 ,0 ,1 / 2 )
2831 @test th_jac2jac (x, - 3 / 4 ,- 3 / 4 ,0 ,3 / 4 ) ≈ lib_jac2jac (x, - 3 / 4 ,- 3 / 4 ,0 ,3 / 4 )
29- @test th_jac2jac (x,0 , 0 , 5 , 5 ) ≈ lib_jac2jac (x, 0 , 0 , 5 , 5 )
3032 if length (x) < 10
33+ @test th_jac2jac (x,0 , 0 , 5 , 5 ) ≈ lib_jac2jac (x, 0 , 0 , 5 , 5 )
3134 @test th_jac2jac (x, 5 , 5 , 0 , 0 ) ≈ lib_jac2jac (x, 5 , 5 , 0 , 0 )
3235 end
3336
37+ @test th_cheb2jac (x, 0.2 , 0.3 ) ≈ cheb2jac (x, 0.2 , 0.3 )
38+ @test th_jac2cheb (x, 0.2 , 0.3 ) ≈ jac2cheb (x, 0.2 , 0.3 )
39+
3440 @test th_cheb2leg (th_leg2cheb (x)) ≈ x
3541 @test th_leg2cheb (th_cheb2leg (x)) ≈ x
3642 @test th_ultra2ultra (th_ultra2ultra (x, 0.1 , 0.6 ), 0.6 , 0.1 ) ≈ x
@@ -93,6 +99,18 @@ import FastTransforms: th_leg2cheb, th_cheb2leg, th_leg2chebu, th_ultra2ultra,th
9399 @test th_jac2jac (X, 0.1 , 0.6 , 3.1 , 2.8 , 1 ) ≈ hcat ([jac2jac (X[:,j], 0.1 , 0.6 , 3.1 , 2.8 ) for j= 1 : size (X,2 )]. .. )
94100 @test th_jac2jac (X, 0.1 , 0.6 , 3.1 , 2.8 , 2 ) ≈ vcat ([permutedims (jac2jac (X[k,:], 0.1 , 0.6 , 3.1 , 2.8 )) for k= 1 : size (X,1 )]. .. )
95101 @test th_jac2jac (X, 0.1 , 0.6 , 3.1 , 2.8 ) ≈ th_jac2jac (th_jac2jac (X, 0.1 , 0.6 , 3.1 , 2.8 , 1 ), 0.1 , 0.6 , 3.1 , 2.8 , 2 )
102+
103+ @test th_jac2jac (X, - 0.5 , - 0.5 , 3.1 , 2.8 , 1 ) ≈ hcat ([jac2jac (X[:,j], - 0.5 , - 0.5 , 3.1 , 2.8 ) for j= 1 : size (X,2 )]. .. )
104+ @test th_jac2jac (X, - 0.5 , - 0.5 , 3.1 , 2.8 , 2 ) ≈ vcat ([permutedims (jac2jac (X[k,:], - 0.5 , - 0.5 , 3.1 , 2.8 )) for k= 1 : size (X,1 )]. .. )
105+ @test th_jac2jac (X, - 0.5 , - 0.5 , 3.1 , 2.8 ) ≈ th_jac2jac (th_jac2jac (X, - 0.5 , - 0.5 , 3.1 , 2.8 , 1 ), - 0.5 , - 0.5 , 3.1 , 2.8 , 2 )
106+
107+ @test th_cheb2jac (X, 3.1 , 2.8 , 1 ) ≈ hcat ([cheb2jac (X[:,j], 3.1 , 2.8 ) for j= 1 : size (X,2 )]. .. )
108+ @test th_cheb2jac (X, 3.1 , 2.8 , 2 ) ≈ vcat ([permutedims (cheb2jac (X[k,:], 3.1 , 2.8 )) for k= 1 : size (X,1 )]. .. )
109+ @test th_cheb2jac (X, 3.1 , 2.8 ) ≈ th_cheb2jac (th_cheb2jac (X, 3.1 , 2.8 , 1 ), 3.1 , 2.8 , 2 )
110+
111+ @test th_jac2cheb (X, 3.1 , 2.8 , 1 ) ≈ hcat ([jac2cheb (X[:,j], 3.1 , 2.8 ) for j= 1 : size (X,2 )]. .. )
112+ @test th_jac2cheb (X, 3.1 , 2.8 , 2 ) ≈ vcat ([permutedims (jac2cheb (X[k,:], 3.1 , 2.8 )) for k= 1 : size (X,1 )]. .. )
113+ @test th_jac2cheb (X, 3.1 , 2.8 ) ≈ th_jac2cheb (th_jac2cheb (X, 3.1 , 2.8 , 1 ), 3.1 , 2.8 , 2 )
96114 end
97115
98116 @testset " BigFloat" begin
0 commit comments