-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
Change wrapping of FLINT Z/nZ polynomial gcd failure #38719
base: develop
Are you sure you want to change the base?
Change wrapping of FLINT Z/nZ polynomial gcd failure #38719
Conversation
Documentation preview for this PR (built with commit b7ae8b0; changes) is ready! 🎉 |
a67bebe
to
24fc9a2
Compare
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.
Two very minor things. Otherwise LGTM.
Co-authored-by: Travis Scrimshaw <[email protected]>
Co-authored-by: Travis Scrimshaw <[email protected]>
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.
Thank you. Positive review.
Sometimes FLINT fails to calculate GCDs in polynomial rings over Z/nZ. Since FLINT has no interface to report the failure, the GCD calculation needs to be wrapped and an error thrown. The present method of wrapping does not properly reactivate signals if an error happens, because the exception causes
sig_off()
to never be reached. This patch rectifies that. It also adds a doctest which triggers this code path; the example is designed so that the GCD exists but FLINT fails.The error message is also adjusted, since the failure condition is more complicated than just encountering non-invertible elements (e.g., in Z/6,
gcd(2*x, x)
will work).