@@ -23,7 +23,7 @@ FastTransforms.ft_set_num_threads(ceil(Int, Base.Sys.CPU_THREADS/2))
23
23
@test f ≈ fd
24
24
end
25
25
26
- α, β, γ, δ, λ, μ = 0.1 , 0.2 , 0.3 , 0.4 , 0.5 , 0.6
26
+ α, β, γ, δ, λ, μ, ρ = 0.1 , 0.2 , 0.3 , 0.4 , 0.5 , 0.6 , 0.7
27
27
function test_1d_plans (p1, p2, x)
28
28
y = p1* x
29
29
z = p2* y
@@ -104,29 +104,31 @@ FastTransforms.ft_set_num_threads(ceil(Int, Base.Sys.CPU_THREADS/2))
104
104
105
105
@testset " Modified classical orthonormal polynomial transforms" begin
106
106
(n, α, β) = (16 , 0 , 0 )
107
- P1 = plan_modifiedjac2jac (Float64, n, α, β, [0.9428090415820636 , - 0.32659863237109055 , - 0.42163702135578396 , 0.2138089935299396 ]) # u1(x) = (1-x)^2*(1+x)
108
- P2 = plan_modifiedjac2jac (Float64, n, α, β, [0.9428090415820636 , - 0.32659863237109055 , - 0.42163702135578396 , 0.2138089935299396 ], [1.4142135623730951 ]) # u2(x) = (1-x)^2*(1+x)
109
- P3 = plan_modifiedjac2jac (Float64, n, α, β, [- 0.9428090415820636 , 0.32659863237109055 , 0.42163702135578396 , - 0.2138089935299396 ], [- 5.185449728701348 , 0.0 , 0.42163702135578374 ]) # u3(x) = -(1-x)^2*(1+x), v3(x) = -(2-x)*(2+x)
110
- P4 = plan_modifiedjac2jac (Float64, n, α+ 2 , β+ 1 , [1.1547005383792517 ], [4.387862045841156 , 0.1319657758147716 , - 0.20865621238292037 ]) # v4(x) = (2-x)*(2+x)
111
-
112
- @test P1* I ≈ P2* I
113
- @test P1\ I ≈ P2\ I
114
- @test P3* I ≈ P2* (P4* I)
115
- @test P3\ I ≈ P4\ (P2\ I)
116
-
117
- P5 = plan_modifiedlag2lag (Float64, n, α, [2.0 , - 4.0 , 2.0 ]) # u5(x) = x^2
118
- P6 = plan_modifiedlag2lag (Float64, n, α, [2.0 , - 4.0 , 2.0 ], [1.0 ]) # u6(x) = x^2
119
- P7 = plan_modifiedlag2lag (Float64, n, α, [2.0 , - 4.0 , 2.0 ], [7.0 , - 7.0 , 2.0 ]) # u7(x) = x^2, v7(x) = (1+x)*(2+x)
120
- P8 = plan_modifiedlag2lag (Float64, n, α+ 2 , [sqrt (2.0 )], [sqrt (1058.0 ), - sqrt (726.0 ), sqrt (48.0 )]) # v8(x) = (1+x)*(2+x)
121
-
122
- @test P5* I ≈ P6* I
123
- @test P5\ I ≈ P6\ I
124
- @test P7* I ≈ P6* (P8* I)
125
- @test P7\ I ≈ P8\ (P6\ I)
126
-
127
- P9 = plan_modifiedherm2herm (Float64, n, [2.995504568550877 , 0.0 , 3.7655850551068593 , 0.0 , 1.6305461589167827 ], [2.995504568550877 , 0.0 , 3.7655850551068593 , 0.0 , 1.6305461589167827 ]) # u9(x) = 1+x^2+x^4, v9(x) = 1+x^2+x^4
128
-
129
- @test P9* I ≈ P9\ I
107
+ for T in (Float32, Float64)
108
+ P1 = plan_modifiedjac2jac (T, n, α, β, T[0.9428090415820636 , - 0.32659863237109055 , - 0.42163702135578396 , 0.2138089935299396 ]) # u1(x) = (1-x)^2*(1+x)
109
+ P2 = plan_modifiedjac2jac (T, n, α, β, T[0.9428090415820636 , - 0.32659863237109055 , - 0.42163702135578396 , 0.2138089935299396 ], T[1.4142135623730951 ]) # u2(x) = (1-x)^2*(1+x)
110
+ P3 = plan_modifiedjac2jac (T, n, α, β, T[- 0.9428090415820636 , 0.32659863237109055 , 0.42163702135578396 , - 0.2138089935299396 ], T[- 5.185449728701348 , 0.0 , 0.42163702135578374 ]) # u3(x) = -(1-x)^2*(1+x), v3(x) = -(2-x)*(2+x)
111
+ P4 = plan_modifiedjac2jac (T, n, α+ 2 , β+ 1 , T[1.1547005383792517 ], T[4.387862045841156 , 0.1319657758147716 , - 0.20865621238292037 ]) # v4(x) = (2-x)*(2+x)
112
+
113
+ @test P1* I ≈ P2* I
114
+ @test P1\ I ≈ P2\ I
115
+ @test P3* I ≈ P2* (P4* I)
116
+ @test P3\ I ≈ P4\ (P2\ I)
117
+
118
+ P5 = plan_modifiedlag2lag (T, n, α, T[2.0 , - 4.0 , 2.0 ]) # u5(x) = x^2
119
+ P6 = plan_modifiedlag2lag (T, n, α, T[2.0 , - 4.0 , 2.0 ], T[1.0 ]) # u6(x) = x^2
120
+ P7 = plan_modifiedlag2lag (T, n, α, T[2.0 , - 4.0 , 2.0 ], T[7.0 , - 7.0 , 2.0 ]) # u7(x) = x^2, v7(x) = (1+x)*(2+x)
121
+ P8 = plan_modifiedlag2lag (T, n, α+ 2 , T[sqrt (2.0 )], T[sqrt (1058.0 ), - sqrt (726.0 ), sqrt (48.0 )]) # v8(x) = (1+x)*(2+x)
122
+
123
+ @test P5* I ≈ P6* I
124
+ @test P5\ I ≈ P6\ I
125
+ @test isapprox (P7* I, P6* (P8* I); rtol = eps (T)^ (1 / 4 ))
126
+ @test isapprox (P7\ I, P8\ (P6\ I); rtol = eps (T)^ (1 / 4 ))
127
+
128
+ P9 = plan_modifiedherm2herm (T, n, T[2.995504568550877 , 0.0 , 3.7655850551068593 , 0.0 , 1.6305461589167827 ], T[2.995504568550877 , 0.0 , 3.7655850551068593 , 0.0 , 1.6305461589167827 ]) # u9(x) = 1+x^2+x^4, v9(x) = 1+x^2+x^4
129
+
130
+ @test P9* I ≈ P9\ I
131
+ end
130
132
end
131
133
132
134
function test_nd_plans (p, ps, pa, A)
@@ -175,6 +177,17 @@ FastTransforms.ft_set_num_threads(ceil(Int, Base.Sys.CPU_THREADS/2))
175
177
pa = plan_disk_analysis (A)
176
178
test_nd_plans (p, ps, pa, A)
177
179
180
+ A = diskones (Float64, n, 4 n- 3 )
181
+ p = plan_ann2cxf (A, α, β, 0 , ρ)
182
+ ps = plan_annulus_synthesis (A, ρ)
183
+ pa = plan_annulus_analysis (A, ρ)
184
+ test_nd_plans (p, ps, pa, A)
185
+ A = diskones (Float64, n, 4 n- 3 ) + im* diskones (Float64, n, 4 n- 3 )
186
+ p = plan_ann2cxf (A, α, β, 0 , ρ)
187
+ ps = plan_annulus_synthesis (A, ρ)
188
+ pa = plan_annulus_analysis (A, ρ)
189
+ test_nd_plans (p, ps, pa, A)
190
+
178
191
A = rectdiskones (Float64, n, n)
179
192
p = plan_rectdisk2cheb (A, β)
180
193
ps = plan_rectdisk_synthesis (A)
0 commit comments