53 nmod_poly_gcd (
F1,
F1, G1);
66 fmpz_poly_gcd (
F1,
F1, G1);
77 CanonicalForm f,
g, c,
cg,
cl, BB,
B,
M, q, Dp, newD,
D, newq;
94 cl = (
f.lc() /
cg ) *
g.lc();
106 while (
i >= 0 && q <
B )
110 while (
i >= 0 &&
mod(
cl,
p ) == 0 )
129 if ( Dp.
degree() ==
D.degree() )
135 else if ( Dp.
degree() <
D.degree() )
156 DEBOUTLN( cerr,
"another try ..." );
192 nmod_poly_t
F1, G1,
A,
B,
R;
198 nmod_poly_xgcd (
R,
A,
B,
F1, G1);
209#elif defined(HAVE_NTL)
239 fmpq_poly_xgcd (
R,
A,
B,
F1, G1);
243 fmpq_poly_clear (
F1);
244 fmpq_poly_clear (G1);
250#elif defined(HAVE_NTL)
264 XGCD(RR,
A,
B,
F1,G1,1);
276 XGCD (RR,
A,
B,
F1,G1,1);
284 XGCD(RR,
A,
B,
F1,G1,1);
295 XGCD (RR,
A,
B,
F1,G1,1);
311 while ( ! p1.isZero() )
321 a = f0 / ( contf * contp0 );
322 b = g0 / ( contg * contp0 );
CanonicalForm convertFmpq_poly_t2FacCF(const fmpq_poly_t p, const Variable &x)
conversion of a FLINT poly over Q to CanonicalForm
CanonicalForm convertnmod_poly_t2FacCF(const nmod_poly_t poly, const Variable &x)
conversion of a FLINT poly over Z/p to CanonicalForm
CanonicalForm convertFmpz_poly_t2FacCF(const fmpz_poly_t poly, const Variable &x)
conversion of a FLINT poly over Z to CanonicalForm
void convertFacCF2Fmpq_poly_t(fmpq_poly_t result, const CanonicalForm &f)
conversion of a factory univariate polynomials over Q to fmpq_poly_t
void convertFacCF2Fmpz_poly_t(fmpz_poly_t result, const CanonicalForm &f)
conversion of a factory univariate polynomial over Z to a fmpz_poly_t
This file defines functions for conversion to FLINT (www.flintlib.org) and back.
CanonicalForm convertZZ2CF(const ZZ &a)
NAME: convertZZ2CF.
ZZX convertFacCF2NTLZZX(const CanonicalForm &f)
CanonicalForm convertNTLzzpX2CF(const zz_pX &poly, const Variable &x)
CanonicalForm convertNTLZZX2CF(const ZZX &polynom, const Variable &x)
zz_pX convertFacCF2NTLzzpX(const CanonicalForm &f)
Conversion to and from NTL.
coprimality check and change of representation mod n
CanonicalForm gcd_univar_flint0(const CanonicalForm &F, const CanonicalForm &G)
CanonicalForm extgcd(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &a, CanonicalForm &b)
CanonicalForm extgcd ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & a,...
CanonicalForm gcd_univar_flintp(const CanonicalForm &F, const CanonicalForm &G)
univariate Gcd over finite fields and Z, extended GCD over finite fields and Q
CanonicalForm bCommonDen(const CanonicalForm &f)
CanonicalForm bCommonDen ( const CanonicalForm & f )
CanonicalForm maxNorm(const CanonicalForm &f)
CanonicalForm maxNorm ( const CanonicalForm & f )
bool fdivides(const CanonicalForm &f, const CanonicalForm &g)
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g )
declarations of higher level algorithms.
bool isPurePoly(const CanonicalForm &f)
void FACTORY_PUBLIC chineseRemainder(const CanonicalForm &x1, const CanonicalForm &q1, const CanonicalForm &x2, const CanonicalForm &q2, CanonicalForm &xnew, CanonicalForm &qnew)
void chineseRemainder ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2,...
#define GaloisFieldDomain
static CanonicalForm gcd_poly_univar0(const CanonicalForm &F, const CanonicalForm &G, bool primitive)
static CanonicalForm balance_p(const CanonicalForm &f, const CanonicalForm &q, const CanonicalForm &qh)
int cf_getNumSmallPrimes()
int cf_getSmallPrime(int i)
functions to print debug output
#define DEBOUTLN(stream, objects)
nmod_poly_init(FLINTmipo, getCharacteristic())
convertFacCF2nmod_poly_t(FLINTmipo, M)
nmod_poly_clear(FLINTmipo)
some useful template functions.
template CanonicalForm tmin(const CanonicalForm &, const CanonicalForm &)
int F1(int a1, int &r1)
F1.