]> www.ginac.de Git - ginac.git/commit
pgcd(), chinrem_gcd(): use appropriate definition of the degree.
authorAlexei Sheplyakov <alexei.sheplyakov@gmail.com>
Mon, 17 May 2010 22:23:03 +0000 (00:23 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Mon, 17 May 2010 22:44:52 +0000 (00:44 +0200)
commitedf1ae46a926d0a718063c149b78c1b9a7ec2043
tree049c6777384a452cf256c9eb7e6642bc0cc8db96
parent6201dc3c6562e0b8c174129af382fd5745de048f
pgcd(), chinrem_gcd(): use appropriate definition of the degree.

Effect: fixes (rare) GCD miscalculation.

pgcd() treats polynomials Z_p[x_0, ..., x_n] as R[x_0, ..., x_{n - 1}], where
R = Z_p[x_n]. Therefore one should use correct definition of the degree
(i.e. compute it w.r.t. x_0, ..., x_{n-1}, but NOT w.r.t. x_n!).

One should use appropriate definition of degree (that is, w.r.t.  x_0, ..., x_n)
in chinrem_gcd() too.

Thanks to Aless Lasaruk for a bug report.
check/pgcd_infinite_loop.cpp
ginac/polynomial/mgcd.cpp
ginac/polynomial/pgcd.cpp