@@ -30,6 +30,9 @@ broadcastlayout(::Type{typeof(*)}, ::WeightLayout, ::Basis) where Basis<:Abstrac
3030sublayout (:: WeightLayout , _) = WeightLayout ()
3131sublayout (:: AbstractBasisLayout , :: Type{<:Tuple{Map,AbstractVector}} ) = MappedBasisLayout ()
3232
33+ # copy with an Inclusion can not be materialized
34+ copy (V:: SubQuasiArray{<:Any,N,<:Basis,<:Tuple{Inclusion,Vararg{Any}}, trfl} ) where {N,trfl} = V
35+
3336
3437# # Weighted basis interface
3538unweighted (P:: BroadcastQuasiMatrix{<:Any,typeof(*),<:Tuple{AbstractQuasiVector,AbstractQuasiMatrix}} ) = last (P. args)
@@ -148,12 +151,26 @@ copy(L::Ldiv{<:MappedBasisLayouts,BroadcastLayout{typeof(*)},<:Any,<:AbstractQua
148151
149152
150153# expansion
151- _grid (_, P) = error (" Overload Grid" )
154+ _grid (_, P, n... ) = error (" Overload Grid" )
155+
156+ _grid (:: MappedBasisLayout , P, n... ) = invmap (parentindices (P)[1 ])[grid (demap (P), n... )]
157+ _grid (:: SubBasisLayout , P:: AbstractQuasiMatrix , n) = grid (parent (P), maximum (parentindices (P)[2 ][n]))
158+ _grid (:: SubBasisLayout , P:: AbstractQuasiMatrix ) = grid (parent (P), maximum (parentindices (P)[2 ]))
159+ _grid (:: WeightedBasisLayouts , P, n... ) = grid (unweighted (P), n... )
152160
153- _grid (:: MappedBasisLayout , P) = invmap (parentindices (P)[1 ])[grid (demap (P))]
154- _grid (:: SubBasisLayout , P) = grid (parent (P))
155- _grid (:: WeightedBasisLayouts , P) = grid (unweighted (P))
156- grid (P) = _grid (MemoryLayout (P), P)
161+
162+ """
163+ grid(P, n...)
164+
165+ Creates a grid of points. if `n` is unspecified it will
166+ be sufficient number of points to determine `size(P,2)`
167+ coefficients. Otherwise its enough points to determine `n`
168+ coefficients.
169+ """
170+ grid (P, n... ) = _grid (MemoryLayout (P), P, n... )
171+
172+
173+ # values(f) =
157174
158175
159176struct TransformFactorization{T,Grid,Plan} <: Factorization{T}
@@ -239,15 +256,18 @@ function *(P::InvPlan, X::AbstractArray)
239256end
240257
241258
242- function plan_grid_transform (L, arr, dims= 1 : ndims (arr))
259+ function plan_grid_transform (L, szs :: NTuple{N,Int} , dims= 1 : N) where N
243260 p = grid (L)
244261 p, InvPlan (factorize (L[p,:]), dims)
245262end
246263
247- plan_transform (P, arr, dims... ) = plan_grid_transform (P, arr, dims... )[2 ]
264+ plan_grid_transform (L, arr:: AbstractArray{<:Any,N} , dims= 1 : N) where N =
265+ plan_grid_transform (L, size (arr), dims)
266+
267+ plan_transform (P, szs, dims... ) = plan_grid_transform (P, szs, dims... )[2 ]
248268
249269_factorize (:: AbstractBasisLayout , L, dims... ; kws... ) =
250- TransformFactorization (plan_grid_transform (L, Array {eltype(L)} (undef, size (L,2 ), dims... ), 1 )... )
270+ TransformFactorization (plan_grid_transform (L, ( size (L,2 ), dims... ), 1 )... )
251271
252272
253273
@@ -273,7 +293,7 @@ _sub_factorize(::Tuple{Any,Int}, (kr,jr)::Tuple{Any,OneTo}, L, dims...; kws...)
273293
274294# ∞-dimensional parents need to use transforms. For now we assume the size of the transform is equal to the size of the truncation
275295_sub_factorize (:: Tuple{Any,Any} , (kr,jr):: Tuple{Any,OneTo} , L, dims... ; kws... ) =
276- TransformFactorization (plan_grid_transform (parent (L), Array {eltype(L)} (undef, last (jr), dims... ), 1 )... )
296+ TransformFactorization (plan_grid_transform (parent (L), ( last (jr), dims... ), 1 )... )
277297
278298# If jr is not OneTo we project
279299_sub_factorize (:: Tuple{Any,Any} , (kr,jr), L, dims... ; kws... ) =
@@ -377,6 +397,7 @@ applylayout(::Type{typeof(*)}, ::Lay, ::Union{PaddedLayout,AbstractStridedLayout
377397
378398basis (v:: ApplyQuasiArray{<:Any,N,typeof(*)} ) where N = v. args[1 ]
379399coefficients (v:: ApplyQuasiArray{<:Any,N,typeof(*),<:Tuple{Any,Any}} ) where N = v. args[2 ]
400+ coefficients (v:: ApplyQuasiArray{<:Any,N,typeof(*),<:Tuple{Any,Any,Vararg{Any}}} ) where N = ApplyArray (* , tail (v. args)... )
380401
381402
382403function unweighted (lay:: ExpansionLayout , a)
0 commit comments