-
Notifications
You must be signed in to change notification settings - Fork 27
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
factorisation in nmod_poly does not gracefully handle errors #73
Comments
In general I think that python-flint should avoid segfaults and aborts (except perhaps if it exposes a very low-level API). There are some cases like this though where it is tricky because how can we know ahead of time that this will operation will or will not succeed? In [3]: nmod_poly([1, 1], 10).factor()
Out[3]: (1, [(x + 1, 1)]) If the modulus is prime it should always succeed. The Flint docs don't give any clue as to when this is expected to work or under what circumstances it might crash. At least python-flint should warn in its docs whether a particular function might abort because aborts are considered unfriendly in Python-land. |
In SageMath a common trick is with the |
What check could be done besides just warning if the modulus is not prime? |
Oh for the
If the modulus is prime, then every element is invertible, a softer check is just ensuring that there's no non-trivial gcd before an inversion is called? However |
Perhaps there could be an argument like |
The text was updated successfully, but these errors were encountered: