Skip to content

Commit 7cb569b

Browse files
committed
Use lmul!/rmul! instead of scale! on newer Julia
1 parent 2ee6063 commit 7cb569b

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/definitions.jl

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,13 @@ size(p::ScaledPlan) = size(p.p)
246246
show(io::IO, p::ScaledPlan) = print(io, p.scale, " * ", p.p)
247247
summary(p::ScaledPlan) = string(p.scale, " * ", summary(p.p))
248248

249-
*(p::ScaledPlan, x::AbstractArray) = scale!(p.p * x, p.scale)
249+
if VERSION >= v"0.7.0-DEV.3665"
250+
*(p::ScaledPlan, x::AbstractArray) = LinearAlgebra.rmul!(p.p * x, p.scale)
251+
elseif VERSION >= v"0.7.0-DEV.3563"
252+
*(p::ScaledPlan, x::AbstractArray) = LinearAlgebra.mul1!(p.p * x, p.scale)
253+
else
254+
*(p::ScaledPlan, x::AbstractArray) = scale!(p.p * x, p.scale)
255+
end
250256

251257
*::Number, p::Plan) = ScaledPlan(p, α)
252258
*(p::Plan, α::Number) = ScaledPlan(p, α)
@@ -266,8 +272,16 @@ plan_ifft!(x::AbstractArray, region; kws...) =
266272

267273
plan_inv(p::ScaledPlan) = ScaledPlan(plan_inv(p.p), inv(p.scale))
268274

269-
LinearAlgebra.mul!(y::AbstractArray, p::ScaledPlan, x::AbstractArray) =
270-
scale!(p.scale, LinearAlgebra.mul!(y, p.p, x))
275+
if VERSION >= v"0.7.0-DEV.3665"
276+
LinearAlgebra.mul!(y::AbstractArray, p::ScaledPlan, x::AbstractArray) =
277+
LinearAlgebra.lmul!(p.scale, LinearAlgebra.mul!(y, p.p, x))
278+
elseif VERSION >= v"0.7.0-DEV.3563"
279+
LinearAlgebra.mul!(y::AbstractArray, p::ScaledPlan, x::AbstractArray) =
280+
LinearAlgebra.mul2!(p.scale, LinearAlgebra.mul!(y, p.p, x))
281+
else
282+
LinearAlgebra.mul!(y::AbstractArray, p::ScaledPlan, x::AbstractArray) =
283+
scale!(p.scale, LinearAlgebra.mul!(y, p.p, x))
284+
end
271285

272286
##############################################################################
273287
# Real-input DFTs are annoying because the output has a different size

0 commit comments

Comments
 (0)