1 /** 2 * @file cfGcdAlgExt.h 3 * 4 * GCD over Q(a) 5 * 6 * ABSTRACT: Implementation of Encarnacion's GCD algorithm over number fields, 7 * see M.J. Encarnacion "Computing GCDs of polynomials over number fields", 8 * extended to the multivariate case. 9 * 10 * @sa cfNTLzzpEXGCD.h 11 **/ 12 13 #ifndef CF_GCD_ALGEXT_H 14 #define CF_GCD_ALGEXT_H 15 16 // #include "config.h" 17 18 #include "canonicalform.h" 19 #include "variable.h" 20 21 /// gcd over Q(a) 22 CanonicalForm QGCD( const CanonicalForm &, const CanonicalForm & ); 23 24 #ifndef HAVE_NTL 25 void tryDivrem (const CanonicalForm&, const CanonicalForm&, CanonicalForm&, 26 CanonicalForm&, CanonicalForm&, const CanonicalForm&, 27 bool&); 28 void tryEuclid( const CanonicalForm &, const CanonicalForm &, const CanonicalForm &, CanonicalForm &, bool & ); 29 void tryExtgcd( const CanonicalForm & F, const CanonicalForm & G, const CanonicalForm& M, CanonicalForm & result, CanonicalForm & s, CanonicalForm & t, bool & fail ); 30 #endif 31 void tryInvert( const CanonicalForm &, const CanonicalForm &, CanonicalForm &, bool & ); 32 33 /// modular gcd over F_p[x]/(M) for not necessarily irreducible M. 34 /// If a zero divisor is encountered fail is set to true. 35 void tryBrownGCD( const CanonicalForm & F, const CanonicalForm & G, const CanonicalForm & M, CanonicalForm & result, bool & fail, bool topLevel= true ); 36 37 int * leadDeg(const CanonicalForm & f, int *degs); 38 bool isLess(int *a, int *b, int lower, int upper); 39 bool isEqual(int *a, int *b, int lower, int upper); 40 CanonicalForm firstLC(const CanonicalForm & f); 41 42 #endif 43 44