You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -262,37 +256,43 @@ function Base.:*(p::FFTAPlan_re{T,1}, x::AbstractArray{T,N}) where {T<:Complex,
262
256
throw(ArgumentError("only FFT_BACKWARD supported for complex arrays"))
263
257
end
264
258
265
-
#### 2D plan 2D array
259
+
#### 2D plan ND array
266
260
##### Forward
267
-
function Base.:*(p::FFTAPlan_re{Complex{T},2}, x::AbstractArray{T,2}) where {T<:Real}
261
+
function Base.:*(p::FFTAPlan_re{Complex{T},2}, x::AbstractArray{T,N}) where {T<:Real, N}
268
262
Base.require_one_based_indexing(x)
269
263
if p.dir === FFT_FORWARD
270
264
half_1 =1:(p.flen ÷2+1)
271
265
x_c =similar(x, Complex{T})
272
266
copy!(x_c, x)
273
267
y =similar(x_c)
274
268
LinearAlgebra.mul!(y, complex(p), x_c)
275
-
returny[half_1, :]
269
+
returncopy(selectdim(y, p.region[1], half_1))
276
270
end
277
271
throw(ArgumentError("only FFT_FORWARD supported for real arrays"))
278
272
end
279
273
280
274
##### Backward
281
-
function Base.:*(p::FFTAPlan_re{T,2}, x::AbstractArray{T,2}) where {T<:Complex}
275
+
function Base.:*(p::FFTAPlan_re{T,2}, x::AbstractArray{T,N}) where {T<:Complex, N}
282
276
Base.require_one_based_indexing(x)
283
-
ifsize(p, 1) ÷2+1!=size(x, 1)
284
-
throw(DimensionMismatch("real 2D plan has size $(size(p)). First dimension of input array should have size ($(size(p, 1) ÷2+1)), but has size $(size(x, 1))"))
277
+
ifsize(p, 1) ÷2+1!=size(x, p.region[1])
278
+
throw(DimensionMismatch("real 2D plan has size $(size(p)). First transform dimension of input array should have size ($(size(p, 1) ÷2+1)), but has size $(size(x, p.region[1]))"))
0 commit comments