Skip to content

Commit

Permalink
Make all UnivPoly compatible with AbstractAlgebra 0.42 (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoongNoonien authored Sep 30, 2024
1 parent ac49d9a commit f929069
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/GenericCyclotomics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import Base: show, +, -, *, ^, ==, inv, isone, iszero, one, zero, rand, deepcopy
import Compat

if Compat.pkgversion(Oscar.AbstractAlgebra) >= v"0.42.0"
const ZZUPoly = Generic.UnivPoly{ZZRingElem}
const UPoly = Generic.UnivPoly{QQFieldElem}
const UPolyRing = Generic.UniversalPolyRing{QQFieldElem}
else
const ZZUPoly = Generic.UnivPoly{ZZRingElem, Generic.MPoly{ZZRingElem}}
const UPoly = Generic.UnivPoly{QQFieldElem, Generic.MPoly{QQFieldElem}}
const UPolyRing = Generic.UniversalPolyRing{QQFieldElem, Generic.MPoly{QQFieldElem}}
end
Expand Down Expand Up @@ -73,7 +75,7 @@ julia> kempner(12)
kempner(m::Int64) = kempner_with_data(m)[1]

@doc raw"""
normal_form(f::AbstractAlgebra.Generic.UnivPoly{ZZRingElem, AbstractAlgebra.Generic.MPoly{ZZRingElem}}, m::Int64)
normal_form(f::ZZUPoly, m::Int64)
Return a normal form of `f` modulo `m`, such that `normal_form(f,m)` is equal
to `normal_form(g,m)` if and only if `f` and `g` are congruent modulo `m`.
Expand All @@ -98,7 +100,7 @@ julia> normal_form(4*x^9+x^7-(x^3+4*x),12)
```
"""
function normal_form(f::AbstractAlgebra.Generic.UnivPoly{ZZRingElem, AbstractAlgebra.Generic.MPoly{ZZRingElem}}, m::Int64)
function normal_form(f::ZZUPoly, m::Int64)
if m < 1
throw(DomainError(m, "A normal form for non-positive moduli is not defined!"))
end
Expand Down

0 comments on commit f929069

Please sign in to comment.