Skip to content
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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

ederc
Copy link
Member

@ederc ederc commented Jun 13, 2024

Some tests have now problems with different parent rings, see discussion at #2455.

Maybe @bschroter can help fixing the tests?

@ederc ederc marked this pull request as draft June 13, 2024 08:30
@@ -918,7 +918,7 @@ q^3 - 7*q^2 + 14*q - 8
```
"""
function characteristic_polynomial(M::Matroid)
Copy link
Member

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)

Comment on lines +939 to 940
R, q = polynomial_ring(ZZ, 'q'; cached=false)
p = characteristic_polynomial(M)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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))
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants