Skip to content

Commit

Permalink
Make UnivPoly unsafe ops more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Oct 7, 2024
1 parent b6896ac commit 34e5088
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/generic/UnivPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 1033 in src/generic/UnivPoly.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/UnivPoly.jl#L1031-L1033

Added lines #L1031 - L1033 were not covered by tests
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)

Check warning on line 1036 in src/generic/UnivPoly.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/UnivPoly.jl#L1036

Added line #L1036 was not covered by tests

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

Check warning on line 1045 in src/generic/UnivPoly.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/UnivPoly.jl#L1043-L1045

Added lines #L1043 - L1045 were not covered by tests
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

Check warning on line 1050 in src/generic/UnivPoly.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/UnivPoly.jl#L1048-L1050

Added lines #L1048 - L1050 were not covered by tests
end
Expand All @@ -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)

Check warning on line 1059 in src/generic/UnivPoly.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/UnivPoly.jl#L1058-L1059

Added lines #L1058 - L1059 were not covered by tests
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)

Check warning on line 1063 in src/generic/UnivPoly.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/UnivPoly.jl#L1063

Added line #L1063 was not covered by tests

###############################################################################
#
Expand Down

0 comments on commit 34e5088

Please sign in to comment.