11# This file was formerly a part of Julia. License is MIT: https://julialang.org/license
22
3- using Compat
4- using Compat. LinearAlgebra
5- using Compat. LinearAlgebra: BlasReal
6- import Compat. LinearAlgebra: A_mul_B!, A_ldiv_B!
3+ using LinearAlgebra
4+ using LinearAlgebra: BlasReal
75import Base: show, summary, size, ndims, length, eltype,
86 * , inv, \
97
@@ -36,11 +34,11 @@ realfloat(x::AbstractArray{T}) where {T<:Real} = copy1(typeof(fftfloat(zero(T)))
3634
3735# copy to a 1-based array, using circular permutation
3836function copy1 (:: Type{T} , x) where T
39- y = Array {T} (uninitialized, map (length, Compat . axes (x)))
37+ y = Array {T} (uninitialized, map (length, axes (x)))
4038 Base. circcopy! (y, x)
4139end
4240
43- to1 (x:: AbstractArray ) = _to1 (Compat . axes (x), x)
41+ to1 (x:: AbstractArray ) = _to1 (axes (x), x)
4442_to1 (:: Tuple{Base.OneTo,Vararg{Base.OneTo}} , x) = x
4543_to1 (:: Tuple , x) = copy1 (eltype (x), x)
4644
@@ -96,11 +94,11 @@ contains all of the information needed to compute `fft(A, dims)` quickly.
9694To apply `P` to an array `A`, use `P * A`; in general, the syntax for applying plans is much
9795like that of matrices. (A plan can only be applied to arrays of the same size as the `A`
9896for which the plan was created.) You can also apply a plan with a preallocated output array `Â`
99- by calling `A_mul_B !(Â, plan, A)`. (For `A_mul_B !`, however, the input array `A` must
97+ by calling `mul !(Â, plan, A)`. (For `mul !`, however, the input array `A` must
10098be a complex floating-point array like the output `Â`.) You can compute the inverse-transform plan by `inv(P)`
10199and apply the inverse plan with `P \\ Â` (the inverse plan is cached and reused for
102100subsequent calls to `inv` or `\\ `), and apply the inverse plan to a pre-allocated output
103- array `A` with `A_ldiv_B !(A, P, Â)`.
101+ array `A` with `ldiv !(A, P, Â)`.
104102
105103The `flags` argument is a bitwise-or of FFTW planner flags, defaulting to `FFTW.ESTIMATE`.
106104e.g. passing `FFTW.MEASURE` or `FFTW.PATIENT` will instead spend several seconds (or more)
@@ -209,12 +207,12 @@ plan_rfft(x::AbstractArray, region; kws...) = plan_rfft(realfloat(x), region; kw
209207# only require implementation to provide *(::Plan{T}, ::Array{T})
210208* (p:: Plan{T} , x:: AbstractArray ) where {T} = p * copy1 (T, x)
211209
212- # Implementations should also implement A_mul_B !(Y, plan, X) so as to support
213- # pre-allocated output arrays. We don't define * in terms of A_mul_B !
210+ # Implementations should also implement mul !(Y, plan, X) so as to support
211+ # pre-allocated output arrays. We don't define * in terms of mul !
214212# generically here, however, because of subtleties for in-place and rfft plans.
215213
216214# #############################################################################
217- # To support inv, \, and A_ldiv_B !(y, p, x), we require Plan subtypes
215+ # To support inv, \, and ldiv !(y, p, x), we require Plan subtypes
218216# to have a pinv::Plan field, which caches the inverse plan, and which
219217# should be initially undefined. They should also implement
220218# plan_inv(p) to construct the inverse of a plan p.
@@ -227,7 +225,7 @@ pinv_type(p::Plan) = eltype(_pinv_type(p))
227225inv (p:: Plan ) =
228226 isdefined (p, :pinv ) ? p. pinv:: pinv_type (p) : (p. pinv = plan_inv (p))
229227\ (p:: Plan , x:: AbstractArray ) = inv (p) * x
230- A_ldiv_B ! (y:: AbstractArray , p:: Plan , x:: AbstractArray ) = A_mul_B ! (y, inv (p), x)
228+ LinearAlgebra . ldiv ! (y:: AbstractArray , p:: Plan , x:: AbstractArray ) = LinearAlgebra . mul ! (y, inv (p), x)
231229
232230# #############################################################################
233231# implementations only need to provide the unnormalized backwards FFT,
@@ -268,8 +266,8 @@ plan_ifft!(x::AbstractArray, region; kws...) =
268266
269267plan_inv (p:: ScaledPlan ) = ScaledPlan (plan_inv (p. p), inv (p. scale))
270268
271- A_mul_B ! (y:: AbstractArray , p:: ScaledPlan , x:: AbstractArray ) =
272- scale! (p. scale, A_mul_B ! (y, p. p, x))
269+ LinearAlgebra . mul ! (y:: AbstractArray , p:: ScaledPlan , x:: AbstractArray ) =
270+ scale! (p. scale, LinearAlgebra . mul ! (y, p. p, x))
273271
274272# #############################################################################
275273# Real-input DFTs are annoying because the output has a different size
0 commit comments