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
Copy file name to clipboardExpand all lines: src/fft.jl
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -78,8 +78,11 @@ mutable struct MtlFFTPlan{T <: FFTNumber, S <: FFTNumber, backward, inplace, N,
78
78
79
79
function MtlFFTPlan{T, S, backward, inplace, N, R}(input_size::NTuple{N, Int}, output_size::NTuple{N, Int}, region::NTuple{R, Int}) where {T <:FFTNumber, S <:FFTNumber, backward, inplace, N, R}
80
80
# Validate region
81
-
for r in region
82
-
1<= r <= N || throw(ArgumentError("Invalid FFT dimension $r for array with $N dimensions"))
81
+
if any(diff(collect(region)) .<1)
82
+
throw(ArgumentError("region must be an increasing sequence"))
83
+
end
84
+
if any(region .<1.|| region .> N)
85
+
throw(ArgumentError("region can only refer to valid dimensions"))
83
86
end
84
87
backward isa Bool || throw(ArgumentError("FFT backward argument must be a Bool"))
85
88
inplace isa Bool || throw(ArgumentError("FFT inplace argument must be a Bool"))
0 commit comments