]> 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:23:03 +0000 (00:23 +0200)
commite75c7a32a0ea156635aeec535b9cdf7d4bf3f9b9
tree25d6ad6b15308689cb309a0c7754a20f4741fef2
parentb2ea74ecbae56d737aacf2cbb418d7c9998718a4
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