-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turn zzModRing & ZZModRing into ResidueRing subtypes #1819
base: master
Are you sure you want to change the base?
Conversation
I'm sorry! Obviously, I didn't check this carefully enough yesterday evening. |
Since the element types of these ring types are subtypes of ResElem, the rings should be subtypes of ResidueRing. Otherwise some generic code gets confused (notably check_parent for ResElem). This lead to a wrong error in the OSCAR book's introduction notebook.
97866cf
to
61cc89c
Compare
Hrm, this changes messes up the |
@@ -410,7 +410,7 @@ The ring $\mathbb Z/n\mathbb Z$ for some $n$. See [`residue_ring`](@ref). | |||
Implementation for the modulus being a machine integer [`Int`](@ref). | |||
For the modulus being a [`ZZRingElem`](@ref) see [`ZZModRing`](@ref). | |||
""" | |||
@attributes mutable struct zzModRing <: Ring | |||
@attributes mutable struct zzModRing <: ResidueRing{UInt} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue that this should also be ResidueRing{ZZRingElem}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well we have
julia> supertypes(zzModRingElem)
(zzModRingElem, ResElem{UInt64}, RingElem, NCRingElem, SetElem, Any)
and these should match, I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, unfortunately
Since the element types of these ring types are subtypes of ResElem, the
rings should be subtypes of ResidueRing. Otherwise some generic code
gets confused (notably check_parent for ResElem).
This lead to a wrong error in the OSCAR book's introduction notebook.