From 34e50884d6df6a9b7d118e6447e28fbb3ee7b284 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 7 Oct 2024 22:03:04 +0200 Subject: [PATCH] Make UnivPoly unsafe ops more generic --- src/generic/UnivPoly.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/generic/UnivPoly.jl b/src/generic/UnivPoly.jl index 4cd75d7d58..4a1b6a0924 100644 --- a/src/generic/UnivPoly.jl +++ b/src/generic/UnivPoly.jl @@ -1028,24 +1028,24 @@ function add!(a::UnivPoly{T}, b::UnivPoly{T}, c::UnivPoly{T}) where {T <: RingEl return a end -function add!(a::UnivPoly{T}, b::UnivPoly{T}, c::Integer) where {T <: RingElement} +function add!(a::UnivPoly{T}, b::UnivPoly{T}, c::RingElement) where {T <: RingElement} a.p = add!(a.p, b.p, c) return a end -add!(a::UnivPoly{T}, b::Integer, c::UnivPoly{T}) where {T <: RingElement} = add!(a, c, b) +add!(a::UnivPoly{T}, b::RingElement, c::UnivPoly{T}) where {T <: RingElement} = add!(a, c, b) function sub!(a::UnivPoly{T}, b::UnivPoly{T}, c::UnivPoly{T}) where {T <: RingElement} a.p = sub!(a.p, b.p, c.p) return a end -function sub!(a::UnivPoly{T}, b::UnivPoly{T}, c::Integer) where {T <: RingElement} +function sub!(a::UnivPoly{T}, b::UnivPoly{T}, c::RingElement) where {T <: RingElement} a.p = sub!(a.p, b.p, c) return a end -function sub!(a::UnivPoly{T}, b::Integer, c::UnivPoly{T}) where {T <: RingElement} +function sub!(a::UnivPoly{T}, b::RingElement, c::UnivPoly{T}) where {T <: RingElement} a.p = sub!(a.p, b, c.p) return a end @@ -1055,12 +1055,12 @@ function mul!(a::UnivPoly{T}, b::UnivPoly{T}, c::UnivPoly{T}) where {T <: RingEl return a end -function mul!(a::UnivPoly{T}, b::UnivPoly{T}, c::Integer) where {T <: RingElement} +function mul!(a::UnivPoly{T}, b::UnivPoly{T}, c::RingElement) where {T <: RingElement} a.p = mul!(a.p, b.p, c) return a end -mul!(a::UnivPoly{T}, b::Integer, c::UnivPoly{T}) where {T <: RingElement} = mul!(a, c, b) +mul!(a::UnivPoly{T}, b::RingElement, c::UnivPoly{T}) where {T <: RingElement} = mul!(a, c, b) ############################################################################### #