-
Notifications
You must be signed in to change notification settings - Fork 113
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
polynomial_ring cached=false for combinatorics #3856
base: master
Are you sure you want to change the base?
Conversation
@@ -918,7 +918,7 @@ q^3 - 7*q^2 + 14*q - 8 | |||
``` | |||
""" | |||
function characteristic_polynomial(M::Matroid) |
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.
These functions touched here should all at some point be changed allow passing in the polynomial ring, as discussed here in our dev docs
(To be clear, that's not a request to change this PR)
R, q = polynomial_ring(ZZ, 'q'; cached=false) | ||
p = characteristic_polynomial(M) |
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.
R, q = polynomial_ring(ZZ, 'q'; cached=false) | |
p = characteristic_polynomial(M) | |
p = characteristic_polynomial(M) | |
R = parent(p) |
@@ -936,7 +936,7 @@ q^2 - 6*q + 8 | |||
``` | |||
""" | |||
function reduced_characteristic_polynomial(M::Matroid) | |||
R, q = polynomial_ring(ZZ, 'q') | |||
R, q = polynomial_ring(ZZ, 'q'; cached=false) | |||
p = characteristic_polynomial(M) | |||
c = Vector{Int}(undef,degree(p)) |
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.
Huh... that seems risky, couldn't one have examples where an Int
would over- or underflow?
Some tests have now problems with different parent rings, see discussion at #2455.
Maybe @bschroter can help fixing the tests?