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
wrong sign in square-free decomposition of polynomials over ZZ #13053
Comments
comment:1
I CCed you since you seemed to have some interest in square-free factorization related issues. |
comment:2
The problem is that the FLINT/NTL return a different content:
If the content should just be a generator of the ideal generated by the coefficients, then both are correct. Personally, I think that NTL's behaviour is more intuitive though. |
comment:3
Could we change this to return -1 like NTL does? (not sure if that would break too many doctests) If not, is there some easy way to get the leading coefficient's sign in FLINT? [CCed spancratz since he apparently wrote fmpz_poly_content] |
comment:8
FWIW in Mathematica, "(1) The content of an integer polynomial P in Z[x], denoted cont(P), is the largest integer k>=1 such that P/k also has integer coefficients. (2) Gauss's lemma for contents states that if P and Q are two polynomials with integer coefficients, then cont(PQ)=cont(P)cont(Q) (Séroul 2000, p. 287)." Note that while the Mathematica output violates (1) it still satisfies (2). |
Author: Julian Rueth |
comment:10
I pushed a branch which fixes this. Here are some timings. Without my changes
With my changes
|
Branch: u/saraedum/ticket/13053 |
Changed keywords from sd40.5 FLINT NTL ZZ to sd40.5 FLINT NTL ZZ sd59 |
Commit: |
New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Reviewer: Miguel Marco |
Changed branch from u/saraedum/ticket/13053 to |
The NTL wrapper for
SquareFreeDecomp
gets the sign wrong for some FLINT polynomials:It works correctly for NTL:
CC: @zimmermann6 @sagetrac-spancratz @wbhart @jpflori
Component: factorization
Keywords: sd40.5 FLINT NTL ZZ sd59
Author: Julian Rueth
Branch/Commit:
e1c1976
Reviewer: Miguel Marco
Issue created by migration from https://trac.sagemath.org/ticket/13053
The text was updated successfully, but these errors were encountered: