27 pi =
g; pi1 =
f; delta = -
delta;
72 return gcd_univar_ntlp(pi, pi1 ) * C;
77 Hi =
power(
LC( pi1, v ), delta );
82 if (
size (Hi)*
size (pi)/(maxNumVars*3) > 500)
96 while (
degree( pi1, v ) > 0 )
100 if (
size (pi)/maxNumVars > 500 ||
size (pi1)/maxNumVars > 500)
103 C *=
gcd (oldPi, oldPi1);
108 pi2 =
psr( pi, pi1, v );
115 C *=
gcd (oldPi, oldPi1);
119 if (
degree( pi1, v ) > 0 )
122 powHi=
power (Hi, delta-1);
124 bi =
LC( pi, v ) * powHi*Hi;
126 bi = -
LC( pi, v ) * powHi*Hi;
127 Hi =
power(
LC( pi1, v ), delta ) / powHi;
130 if (
size (Hi)*
size (pi)/(maxNumVars*3) > 1500)
133 C *=
gcd (oldPi, oldPi1);
140 if (
degree( pi1, v ) == 0 )
150 Ci=
gcd (
LC (oldPi,v),
LC (oldPi1,v));
177 pi =
g; pi1 =
f; delta = -
delta;
180 pi1 = pi1 / Ci1; pi = pi / Ci;
191 return gcd_univar_ntl0(pi, pi1 ) * C;
195 return gcd_poly_univar0( pi, pi1,
true ) * C;
201 Hi =
power(
LC( pi1, v ), delta );
206 while (
degree( pi1, v ) > 0 )
208 pi2 =
psr( pi, pi1, v );
211 if (
degree( pi1, v ) > 0 )
215 bi =
LC( pi, v ) *
power( Hi, delta );
217 bi = -
LC( pi, v ) *
power( Hi, delta );
218 Hi =
power(
LC( pi1, v ), delta ) /
power( Hi, delta-1 );
221 if (
degree( pi1, v ) == 0 )
some useful template functions.
template CanonicalForm tmax(const CanonicalForm &, const CanonicalForm &)
static const int SW_USE_FF_MOD_GCD
set to 1 to use modular GCD over F_q
factory's class for variables
static const int SW_USE_EZGCD_P
set to 1 to use EZGCD over F_q
coprimality check and change of representation mod n
Extended Zassenhaus GCD over finite fields and Z.
bool delta(X x, Y y, D d)
Rational abs(const Rational &a)
CanonicalForm subResGCD_p(const CanonicalForm &f, const CanonicalForm &g)
subresultant GCD over finite fields. In case things become too dense we switch to a modular algorithm...
bool gcd_test_one(const CanonicalForm &f, const CanonicalForm &g, bool swap, int &d)
Coprimality Check. f and g are assumed to have the same level. If swap is true, the main variables of...
univariate Gcd over finite fields and Z, extended GCD over finite fields and Q
Interface to generate InternalCF's over various domains from intrinsic types or mpz_t's.
CanonicalForm gcd_univar_flintp(const CanonicalForm &F, const CanonicalForm &G)
bool isPurePoly(const CanonicalForm &f)
declarations of higher level algorithms.
const Variable & v
< [in] a sqrfree bivariate poly
CanonicalForm psr(const CanonicalForm &rr, const CanonicalForm &vv, const Variable &x)
CanonicalForm psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ) ...
CanonicalForm gcd_univar_flint0(const CanonicalForm &F, const CanonicalForm &G)
#define GaloisFieldDomain
CanonicalForm subResGCD_0(const CanonicalForm &f, const CanonicalForm &g)
subresultant GCD over Z.