@@ -88,7 +88,7 @@ import MultivariateOrthogonalPolynomials: rectspace, totensor, duffy2legendrecon
88
88
P = c_plan_rottriangle (N, zero (T), zero (T), zero (T))
89
89
duffy2legendreconic! (P,V)
90
90
@test V ≈ [[1 zeros (1 ,2 )]; zeros (1 ,3 )]
91
- @test fromtensor (DuffyConic (), V) ≈ [1 ; Zeros (5 )]
91
+ @test_broken fromtensor (DuffyConic (), V) ≈ [1 ; Zeros (5 )]
92
92
93
93
v = fill (1.0 ,length (p))
94
94
@test plan_transform (LegendreConic (),v)* v ≈ [1 ; Zeros (3 )]
@@ -131,10 +131,10 @@ end
131
131
@test p isa Vector{SVector{3 ,Float64}}
132
132
P = plan_transform (DuffyCone (), Vector {Float64} (undef, length (p)))
133
133
134
- @test P * fill (1.0 , length (p)) ≈ [1.2533141373154997 ; Zeros (164 )] ≈ [Fun ((x,y) -> 1 , ZernikeDisk ()). coefficients; Zeros (164 )]
134
+ @test P * fill (1.0 , length (p)) ≈ [1 / sqrt ( 2 ) ; Zeros (55 )] ≈ [Fun ((x,y) -> 1 , ZernikeDisk ()). coefficients; Zeros (55 )]
135
135
136
136
f = Fun ((t,x,y) -> 1 , DuffyCone (), 10 )
137
- @test f. coefficients ≈ [1.2533141373154997 ; Zeros (164 )]
137
+ @test f. coefficients ≈ [1 / sqrt ( 2 ) ; Zeros (55 )]
138
138
@test f (0.3 ,0.1 ,0.2 ) ≈ 1
139
139
140
140
f = Fun ((t,x,y) -> t, DuffyCone (), 10 )
@@ -208,18 +208,18 @@ end
208
208
@test round (Int,1 / 3 * (- 1 + 1 / (- 1 + 27 n + 3 sqrt (3 )sqrt (n* (- 2 + 27 n)))^ (1 / 3 ) + (- 1 + 27 n + 3 sqrt (3 )sqrt (n* (- 2 + 27 n)))^ (1 / 3 )),RoundUp) ≈ N
209
209
end
210
210
p = points (LegendreCone (),10 )
211
- @test length (p) == 12 == 3 * sum (1 : 3 )
211
+ @test length (p) == 18 == 3 * sum (1 : 3 )
212
212
v = fill (1.0 ,length (p))
213
213
n = length (v)
214
- N = ( 1 + isqrt ( 1 + 8 n)) ÷ 4
215
- M = 2 N - 1
216
- D = plan_transform! (rectspace (DuffyConic ()), reshape (v,N,M))
214
+ N = round (Int, 1 / 3 * ( - 1 + 1 / ( - 1 + 27 n + 3 sqrt ( 3 ) sqrt (n * ( - 2 + 27 n))) ^ ( 1 / 3 ) + ( - 1 + 27 n + 3 sqrt ( 3 ) sqrt (n * ( - 2 + 27 n))) ^ ( 1 / 3 )),RoundUp)
215
+ M = N * (N + 1 ) ÷ 2
216
+ D = plan_transform! (rectspace (DuffyCone ()), reshape (v,N,M))
217
217
N,M = D. plan[1 ][2 ],D. plan[2 ][2 ]
218
218
V= reshape (v,N,M)
219
- @test D* V ≈ [[1 zeros (1 ,2 )]; zeros (1 , 3 )]
219
+ @test D* copy (V) ≈ [[1 / sqrt ( 2 ) zeros (1 ,5 )]; zeros (2 , 6 )]
220
220
T = Float64
221
221
P = c_plan_rottriangle (N, zero (T), zero (T), zero (T))
222
- duffy2legendreconic ! (P,V)
222
+ duffy2legendrecone ! (P,V)
223
223
@test V ≈ [[1 zeros (1 ,2 )]; zeros (1 ,3 )]
224
224
@test fromtensor (DuffyConic (), V) ≈ [1 ; Zeros (5 )]
225
225
@@ -238,17 +238,21 @@ end
238
238
end
239
239
240
240
@testset " LegendreCone" begin
241
- f = Fun ((t,x,y) -> 1 , LegendreConic (), 10 )
241
+ f = Fun ((t,x,y) -> 1 , LegendreCone (), 10 )
242
242
@test f. coefficients ≈ [1 ; zeros (ncoefficients (f)- 1 )]
243
- @test f (sqrt (0.1 ^ 2 + 0.2 ^ 2 ),0.1 ,0.2 ) ≈ 1
244
-
245
- f = Fun ((t,x,y) -> t, LegendreConic (), 10 )
246
- @test f (sqrt (0.1 ^ 2 + 0.2 ^ 2 ),0.1 ,0.2 ) ≈ sqrt (0.1 ^ 2 + 0.2 ^ 2 )
247
- f = Fun ((t,x,y) -> 1 + t+ x+ y, LegendreConic (), 10 )
248
- @test f (sqrt (0.1 ^ 2 + 0.2 ^ 2 ),0.1 ,0.2 ) ≈ 1 + sqrt (0.1 ^ 2 + 0.2 ^ 2 )+ 0.1 + 0.2
249
-
243
+ @test f (0.3 ,0.1 ,0.2 ) ≈ 1
250
244
251
- @time Fun ((t,x,y) -> 1 + t+ x+ y, LegendreConic (), 1000 )
245
+ f = Fun ((t,x,y) -> t, LegendreCone (), 10 )
246
+ @test f (0.3 ,0.1 ,0.2 ) ≈ 0.3
247
+ f = Fun ((t,x,y) -> x, LegendreCone (), 10 )
248
+ @test f (0.3 ,0.1 ,0.2 ) ≈ 0.1
249
+ f = Fun ((t,x,y) -> y, LegendreCone (), 10 )
250
+ @test f (0.3 ,0.1 ,0.2 ) ≈ 0.2
251
+ f = Fun ((t,x,y) -> 1 + t+ x+ y, LegendreCone (), 10 )
252
+ @test f (0.3 ,0.1 ,0.2 ) ≈ 1 + 0.3 + 0.1 + 0.2
253
+ f = Fun ((t,x,y) -> 1 + t+ x+ y, LegendreConic (), 1000 )
254
+ @test f (0.3 ,0.1 ,0.2 ) ≈ 1 + 0.3 + 0.1 + 0.2
255
+ @test ncoefficients (f) == 1771
252
256
end
253
257
end
254
258
0 commit comments