Closed F-Feng closed 1 month ago
That's a long polynomial! Can you print the exact error message you get? What version of FLINT are you using?
It shouldn't error inside fmpz_mpoly_pfrac_init
. I suspect fmpz_mpoly_set_str_pretty
is wrong in that case.
Apologies for the lengthy polynomial. I encountered this issue during my research, which is why I have included the entire polynomial here.
I am using flint-3.1.3
, and the complete error message from the terminal appears as follows:
Flint exception (General error):
fmpz_mpoly_pfrac_init: internal errorAborted (core dumped)
PS: The function fmpz_mpoly_set_str_pretty
returns 0, indicating that fmpz_mpoly_set_str_pretty
may work in this case.
Not sure if we will be able to solve this quickly. If you are able to answer these questions, it could be helpful in investigating this:
fmpz_mpoly_set_str_pretty
yields the correct output? (The initialization should always work, but just to make sure that this indeed is the problematic representation of this polynomial for fmpz_mpoly_pfrac_init
)Thank you for your response. Please take your time. I hope the following information may be helpful.
fmpz_mpoly_set_str_pretty
, I verified the output with fmpz_mpoly_get_str_pretty
and obtained the correct result.By the way, here is the factorized output for the polynomial:
This one doesn't look too bad to fix. While I am installing 3.1.3, could you, @F-Feng, change the string in fmpz_mpoly_set_str_pretty to the more wieldy factored form you just displayed? It is highly unlikely the set_str function has a bug.
@tthsqe12 Thanks a lot, and here is the string in the factored form,
"-((-1+x3+x4)^2*(x3+x4)*(-x1+x1^2-x2+x1*x2+x2*x3+x2*x4)*(-(x1*x2*x3)+x1^2*x2*x3-x2^2*x3+x1*x2^2*x3-2*x2*x3^2+3*x1*x2*x3^2-x1^2*x2*x3^2+4*x2^2*x3^2-x1*x2^2*x3^2+2*x2*x3^3-2*x1*x2*x3^3-3*x2^2*x3^3+2*x1^2*x4-4*x1^3*x4+2*x1^4*x4+3*x1*x2*x4-7*x1^2*x2*x4+4*x1^3*x2*x4+x2^2*x4-3*x1*x2^2*x4+2*x1^2*x2^2*x4+x1*x3*x4-2*x1^2*x3*x4+x1^3*x3*x4-3*x2*x3*x4-x1*x2*x3*x4+4*x1^2*x2*x3*x4+3*x2^2*x3*x4+3*x1*x2^2*x3*x4+5*x2*x3^2*x4-5*x1*x2*x3^2*x4-6*x2^2*x3^2*x4+x1*x4^2-2*x1^2*x4^2+x1^3*x4^2-x2*x4^2-4*x1*x2*x4^2+5*x1^2*x2*x4^2-x2^2*x4^2+4*x1*x2^2*x4^2+4*x2*x3*x4^2-4*x1*x2*x3*x4^2-3*x2^2*x3*x4^2+x2*x4^3-x1*x2*x4^3)*x5^2)"
Dear flint developers,
I encountered an internal error when
calling fmpz_mpoly_factor
on a polynomial. Here is an example to reproduce it.PS: If I change the order of elements in the
vars
, no error occurs.Best regards, Feng