@@ -2,7 +2,7 @@ using ApproxFun, MultivariateOrthogonalPolynomials, StaticArrays, FillArrays, Bl
2
2
import ApproxFunBase: checkpoints, plan_transform!, fromtensor
3
3
import MultivariateOrthogonalPolynomials: rectspace, totensor, duffy2legendreconic!, legendre2duffyconic!, c_plan_rottriangle, plan_transform,
4
4
c_execute_tri_hi2lo, c_execute_tri_lo2hi, duffy2legendrecone_column_J!, duffy2legendrecone!, legendre2duffycone!,
5
- duffy2legendreconic!, ConicTensorizer
5
+ duffy2legendreconic!, ConicTensorizer, pointsize
6
6
7
7
8
8
@testset " Conic" begin
126
126
@test checkpoints (rs) isa Vector{SVector{3 ,Float64}}
127
127
end
128
128
129
+ @testset " ConeTensorizer" begin
130
+ ts = MultivariateOrthogonalPolynomials. ConeTensorizer ()
131
+ @test totensor (ts,1 : 10 ) == [1 2 3 5 6 7 ; 4 8 9 0 0 0 ; 10 0 0 0 0 0 ]
132
+ end
133
+
129
134
@testset " DuffyCone" begin
130
135
p = points (DuffyCone (), 10 )
131
136
@test p isa Vector{SVector{3 ,Float64}}
@@ -205,27 +210,33 @@ end
205
210
@testset " LegendreConePlan" begin
206
211
for N = 1 : 10
207
212
n = N* sum (1 : N)
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
213
+ @test round (Int, 1 / 6 * ( 1 + 1 / (1 + 54 n + 6 sqrt (3 )sqrt (n + 27 n^ 2 )) ^ (1 / 3 ) + (1 + 54 n + 6 sqrt (3 )sqrt (n + 27 n^ 2 )) ^ (1 / 3 )), RoundUp)
209
214
end
210
215
p = points (LegendreCone (),10 )
211
- @test length (p) == 18 == 3 * sum ( 1 : 3 )
216
+ @test length (p) == 12 == 2 * 2 * 3
212
217
v = fill (1.0 ,length (p))
213
218
n = length (v)
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
219
+ M,N,O = pointsize (Cone (),n)
220
+
221
+
216
222
D = plan_transform! (rectspace (DuffyCone ()), reshape (v,N,M))
217
223
N,M = D. plan[1 ][2 ],D. plan[2 ][2 ]
218
224
V= reshape (v,N,M)
219
- @test D* copy (V) ≈ [[1 / sqrt (2 ) zeros (1 ,5 )]; zeros (2 ,6 )]
225
+ @test D* V ≈ [[1 / sqrt (2 ) zeros (1 ,5 )]; zeros (2 ,6 )]
220
226
T = Float64
221
227
P = c_plan_rottriangle (N, zero (T), zero (T), zero (T))
222
228
duffy2legendrecone! (P,V)
223
- @test V ≈ [[1 zeros (1 ,2 )]; zeros (1 , 3 )]
224
- @test fromtensor (DuffyConic (), V) ≈ [1 ; Zeros (5 )]
229
+ @test V ≈ [[1 / sqrt ( 2 ) zeros (1 ,5 )]; zeros (2 , 6 )]
230
+ @test fromtensor (LegendreCone (), V) ≈ [1 / sqrt ( 2 ) ; Zeros (55 )]
225
231
226
232
v = fill (1.0 ,length (p))
227
- @test plan_transform (LegendreConic (),v)* v ≈ [1 ; Zeros (3 )]
233
+ P = plan_transform (LegendreCone (),v)
234
+ @test P* v ≈ [1 / sqrt (2 ); Zeros (55 )]
228
235
@test v == fill (1.0 ,length (p))
236
+
237
+ p = points (LegendreCone (),20 )
238
+ v = fill (1.0 ,length (p))
239
+ P = plan_transform (LegendreCone (),v)
229
240
230
241
231
242
for (m,k,ℓ) in ((0 ,0 ,0 ), )
0 commit comments