]> www.ginac.de Git - ginac.git/commit
[BUGFIX] Fix corner cases of factor_multivariate().
authorRichard Kreckel <kreckel@ginac.de>
Mon, 19 Dec 2022 17:14:32 +0000 (18:14 +0100)
committerRichard Kreckel <kreckel@ginac.de>
Mon, 19 Dec 2022 17:29:17 +0000 (18:29 +0100)
commit1f14fb79bacd8de080c73a930bf9f8a5d514cbe0
tree52a566332662506b768a4db664762a5b9184f329
parent7ddcbce353f5811a8967297eece3fdff7ae04f50
[BUGFIX] Fix corner cases of factor_multivariate().

In some rare cases, factor() failed with what looks like an endless
loop trying evaluation homomorphisms with ever increasing moduli (or
maybe it just took eons to complete).

Whether this happened depended on which symbol was left unevaluated
for univariate factorization. As a workaround for this problem, we now
apply the evaluation homomorphism for each symbol in a round-robin
mode until one of them succeeds.

This somewhat speeds up factorization of multivariate polynomials
even in those cases where the old implementation terminated in time.

Thanks to Vitaly Magerya <vmagerya@gmail.com> for reporting this.
check/exam_factor.cpp
ginac/factor.cpp