* GCD for polynomials in prime field. */
/*
- * GiNaC Copyright (C) 1999-2009 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
// evaluation point is bad. Skip it.
continue;
}
+ if (img_gcd_deg == 0)
+ return cont_gcd;
// Image has the same degree as the previous one
// (or at least not higher than the limit)
const ex H_lcoeff = lcoeff_wrt(H, restvars);
if (H_lcoeff.is_equal(lc_gcd)) {
- if ((Hprev-H).expand().smod(pn).is_zero())
- continue;
ex C /* primitive part of H */, contH /* dummy */;
primpart_content(C, contH, H, vars, p);
// Normalize GCD so that leading coefficient is 1
if (divide_in_z_p(Aprim, C, dummy1, vars, p) &&
divide_in_z_p(Bprim, C, dummy2, vars, p))
return (cont_gcd*C).expand().smod(pn);
- else if (img_gcd_deg == 0)
- return cont_gcd;
// else continue building the candidate
}
} while(true);