@@ -170,46 +170,62 @@ spacescompatible(::LegendreCone, ::LegendreCone) = true
170
170
domain (:: DuffyCone ) = Cone ()
171
171
domain (:: LegendreCone ) = Cone ()
172
172
173
- tensorizer (K:: DuffyCone ) = BallTensorizer ()
174
- tensorizer (K:: LegendreCone ) = BallTensorizer ()
173
+ ConeTensorizer () = Tensorizer ((Ones {Int} (∞),Base. OneTo (∞)))
174
+
175
+ tensorizer (K:: DuffyCone ) = ConeTensorizer ()
176
+ tensorizer (K:: LegendreCone ) = ConeTensorizer ()
175
177
176
178
rectspace (:: DuffyCone ) = NormalizedJacobi (0 ,1 ,Segment (1 ,0 ))* ZernikeDisk ()
177
179
178
- function points (sp:: Cone ,n)
179
- pts= Array {float(eltype(domain(sp)))} (undef,0 )
180
- a,b = sp. spaces
181
- if isfinite (dimension (a)) && isfinite (dimension (b))
182
- N,M= dimension (a),dimension (b)
183
- elseif isfinite (dimension (a))
184
- N= dimension (a)
185
- M= n÷ N
186
- elseif isfinite (dimension (b))
187
- M= dimension (b)
188
- N= n÷ M
189
- else
190
- N= M= round (Int,sqrt (n))
191
- end
180
+ blocklengths (d:: DuffyCone ) = blocklengths (rectspace (d))
192
181
193
- for y in points (b,M), x in points (a,N)
182
+ function points (sp:: DuffyCone ,n)
183
+ N = ceil (Int, n^ (1 / 3 ))
184
+ pts= Array {float(eltype(domain(sp)))} (undef,0 )
185
+ a,b = rectspace (sp). spaces
186
+ for y in points (a,N), x in points (b,N^ 2 )
194
187
push! (pts,Vec (x... ,y... ))
195
188
end
196
- pts
189
+ conemap .( pts)
197
190
end
198
191
199
192
200
- points (:: Cone , n) = conemap .(points (rectspace (DuffyCone ()), n))
201
193
checkpoints (:: Cone ) = conemap .(checkpoints (rectspace (DuffyCone ())))
202
194
203
195
204
- function plan_transform (sp:: DuffyCone , n:: AbstractVector )
205
- rs = rectspace (S)
206
- P = TransformPlan (sp,((plan_transform (sp. spaces[1 ],T,N),N), (plan_transform (sp. spaces[2 ],T,M),M)), Val{false })
207
- TransformPlan (S, P, Val{false })
196
+ function plan_transform (sp:: DuffyCone , n:: AbstractVector{T} ) where T
197
+ rs = rectspace (sp)
198
+ N = ceil (Int, length (n)^ (1 / 3 ))
199
+ M = length (points (rs. spaces[2 ], N^ 2 ))
200
+ @assert N* M == length (n)
201
+ TransformPlan (sp,((plan_transform (rs. spaces[1 ],T,N),N), (plan_transform (rs. spaces[2 ],T,M),M)), Val{false })
208
202
end
209
203
plan_itransform (S:: DuffyCone , n:: AbstractVector ) =
210
204
ITransformPlan (S, plan_itransform (rectspace (S),n), Val{false })
211
205
212
- * (P:: TransformPlan{<:Any,<:DuffyCone} , v:: AbstractArray ) = P. plan* v
206
+ function * (T:: TransformPlan{<:Any,<:DuffyCone,true} , M:: AbstractMatrix )
207
+ n= size (M,1 )
208
+
209
+ for k= 1 : size (M,2 )
210
+ M[:,k]= T. plan[1 ][1 ]* M[:,k]
211
+ end
212
+ for k= 1 : n
213
+ M[k,:] = (T. plan[2 ][1 ]* M[k,:])[1 : size (M,2 )]
214
+ end
215
+ M
216
+ end
217
+
218
+ function * (T:: TransformPlan{<:Any,<:DuffyCone,true} ,v:: AbstractVector )
219
+ N,M = T. plan[1 ][2 ],T. plan[2 ][2 ]
220
+ V= reshape (v,N,M)
221
+ fromtensor (T. space,T* V)
222
+ end
223
+
224
+ function * (T:: TransformPlan{<:Any,SS,false} ,v:: AbstractVector ) where {SS<: DuffyCone }
225
+ P = TransformPlan (T. space,T. plan,Val{true })
226
+ P* AbstractVector {rangetype(SS)} (v)
227
+ end
228
+
213
229
* (P:: ITransformPlan{<:Any,<:DuffyCone} , v:: AbstractArray ) = P. plan* v
214
230
215
231
evaluate (cfs:: AbstractVector , S:: DuffyCone , txy) = evaluate (cfs, rectspace (S), ipolar (txy[Vec (2 ,3 )]))
0 commit comments