@@ -234,6 +234,8 @@ plan_rfft(x::AbstractArray, region; kws...) = plan_rfft(realfloat(x), region; kw
234234_pinv_type (p:: Plan ) = typeof ([plan_inv (x) for x in typeof (p)[]])
235235pinv_type (p:: Plan ) = eltype (_pinv_type (p))
236236
237+ function plan_inv end
238+
237239inv (p:: Plan ) =
238240 isdefined (p, :pinv ) ? p. pinv:: pinv_type (p) : (p. pinv = plan_inv (p))
239241\ (p:: Plan , x:: AbstractArray ) = inv (p) * x
@@ -243,10 +245,9 @@ LinearAlgebra.ldiv!(y::AbstractArray, p::Plan, x::AbstractArray) = LinearAlgebra
243245# implementations only need to provide the unnormalized backwards FFT,
244246# similar to FFTW, and we do the scaling generically to get the ifft:
245247
246- mutable struct ScaledPlan{T,P,N} <: Plan{T}
248+ struct ScaledPlan{T,P,N} <: Plan{T}
247249 p:: P
248250 scale:: N # not T, to avoid unnecessary promotion to Complex
249- pinv:: Plan
250251 ScaledPlan {T,P,N} (p, scale) where {T,P,N} = new (p, scale)
251252end
252253ScaledPlan {T} (p:: P , scale:: N ) where {T,P,N} = ScaledPlan {T,P,N} (p, scale)
@@ -278,7 +279,7 @@ plan_ifft(x::AbstractArray, region; kws...) =
278279plan_ifft! (x:: AbstractArray , region; kws... ) =
279280 ScaledPlan (plan_bfft! (x, region; kws... ), normalization (x, region))
280281
281- plan_inv (p:: ScaledPlan ) = ScaledPlan (inv (p. p), inv (p. scale))
282+ inv (p:: ScaledPlan ) = ScaledPlan (inv (p. p), inv (p. scale))
282283
283284LinearAlgebra. mul! (y:: AbstractArray , p:: ScaledPlan , x:: AbstractArray ) =
284285 LinearAlgebra. lmul! (p. scale, LinearAlgebra. mul! (y, p. p, x))
0 commit comments