48 if (
f.inBaseDomain() )
94 bool fc_isUnivariate=
f.isUnivariate();
95 bool gc_isUnivariate=
g.isUnivariate();
96 bool fc_and_gc_Univariate=fc_isUnivariate && gc_isUnivariate;
120 else if (!fc_and_gc_Univariate)
152 if (
f.inPolyDomain() || (
f.inExtension() && !
getReduce(
f.mvar() ) ) )
156 while (
i.hasTerms() && !
result.isOne() )
177 if (
f.inPolyDomain() || (
f.inExtension() && !
getReduce(
f.mvar() ) ) )
182 while (
i.hasTerms() && !
result.isOne() )
203 if (
f.inBaseDomain())
return f;
204 ASSERT(
x.
level() > 0,
"cannot calculate content with respect to algebraic variable" );
227 ASSERT(
x.
level() > 0,
"cannot calculate vcontent with respect to algebraic variable" );
234 for (
i =
f;
i.hasTerms() && ! d.
isOne();
i++ )
260 if (
b ||
g.isZero() )
267 if (
f.inPolyDomain() ||
g.inPolyDomain() )
269 if (
f.mvar() !=
g.mvar() )
271 if (
f.mvar() >
g.mvar() )
322 if (
f.inBaseDomain() &&
g.inBaseDomain() )
340 if (
f.isZero() ||
g.isZero() )
343 return (
f /
gcd(
f,
g ) ) *
g;
Rational abs(const Rational &a)
Conversion to and from NTL.
CanonicalForm EZGCD_P(const CanonicalForm &FF, const CanonicalForm &GG)
Extended Zassenhaus GCD for finite fields. In case things become too dense we switch to a modular alg...
static CanonicalForm ezgcd(const CanonicalForm &FF, const CanonicalForm &GG, REvaluation &b, bool internal)
real implementation of EZGCD over Z
Extended Zassenhaus GCD over finite fields and Z.
CanonicalForm QGCD(const CanonicalForm &F, const CanonicalForm &G)
gcd over Q(a)
CanonicalForm modGCDFq(const CanonicalForm &F, const CanonicalForm &G, CanonicalForm &coF, CanonicalForm &coG, Variable &alpha, CFList &l, bool &topLevel)
GCD of F and G over , l and topLevel are only used internally, output is monic based on Alg....
CanonicalForm modGCDFp(const CanonicalForm &F, const CanonicalForm &G, CanonicalForm &coF, CanonicalForm &coG, bool &topLevel, CFList &l)
CanonicalForm modGCDGF(const CanonicalForm &F, const CanonicalForm &G, CanonicalForm &coF, CanonicalForm &coG, CFList &l, bool &topLevel)
GCD of F and G over GF, based on Alg. 7.2. as described in "Algorithms for Computer Algebra" by Gedde...
modular and sparse modular GCD algorithms over finite fields and Z.
CanonicalForm modGCDZ(const CanonicalForm &FF, const CanonicalForm &GG)
modular GCD over Z
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
CanonicalForm subResGCD_0(const CanonicalForm &f, const CanonicalForm &g)
subresultant GCD over Z.
subresultant pseudo remainder sequence GCD over finite fields and Z
CanonicalForm bCommonDen(const CanonicalForm &f)
CanonicalForm bCommonDen ( const CanonicalForm & f )
bool fdivides(const CanonicalForm &f, const CanonicalForm &g)
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g )
declarations of higher level algorithms.
#define ASSERT(expression, message)
static const int SW_USE_QGCD
set to 1 to use Encarnacion GCD over Q(a)
static const int SW_USE_CHINREM_GCD
set to 1 to use modular gcd over Z
static const int SW_USE_EZGCD_P
set to 1 to use EZGCD over F_q
static const int SW_RATIONAL
set to 1 for computations over Q
static const int SW_USE_FF_MOD_GCD
set to 1 to use modular GCD over F_q
static const int SW_USE_EZGCD
set to 1 to use EZGCD over Z
#define GaloisFieldDomain
static CanonicalForm cf_content(const CanonicalForm &f, const CanonicalForm &g)
static CanonicalForm cf_content ( const CanonicalForm & f, const CanonicalForm & g )
CanonicalForm content(const CanonicalForm &f)
CanonicalForm content ( const CanonicalForm & f )
CanonicalForm gcd_poly(const CanonicalForm &f, const CanonicalForm &g)
CanonicalForm gcd_poly ( const CanonicalForm & f, const CanonicalForm & g )
bool isPurePoly(const CanonicalForm &)
CanonicalForm vcontent(const CanonicalForm &f, const Variable &x)
CanonicalForm vcontent ( const CanonicalForm & f, const Variable & x )
void out_cf(const char *s1, const CanonicalForm &f, const char *s2)
cf_algorithm.cc - simple mathematical algorithms.
CanonicalForm gcd(const CanonicalForm &f, const CanonicalForm &g)
static CanonicalForm icontent(const CanonicalForm &f, const CanonicalForm &c)
static CanonicalForm icontent ( const CanonicalForm & f, const CanonicalForm & c )
CanonicalForm pp(const CanonicalForm &f)
CanonicalForm pp ( const CanonicalForm & f )
CanonicalForm lcm(const CanonicalForm &f, const CanonicalForm &g)
CanonicalForm lcm ( const CanonicalForm & f, const CanonicalForm & g )
Iterators for CanonicalForm's.
generate random evaluation points
class to iterate through CanonicalForm's
factory's class for variables
functions to print debug output
const CanonicalForm int const CFList const Variable & y
bool getReduce(const Variable &alpha)