43 ASSERT (F.isUnivariate(),
"univariate input expected");
56 mipo= mipo (x, alpha);
60 int degmipo=
degree (mipo);
64 if (degg >= 8 || degmipo >= 8)
80 mipo= mipo (x, alpha);
84 int degmipo=
degree (mipo);
88 if (degg >= 8 || degmipo >= 8)
107 g= F (y - i*alpha, y);
111 if (degg >= 8 || degmipo >= 8)
120 g= F (y + i*alpha, y);
124 if (degg >= 8 || degmipo >= 8)
153 int shift= 0,
k= 0,
count= 0;
160 bool shiftBuf=
false;
166 for (iter= tmp; iter.
hasItem(); iter++)
173 f= oldF (y - shift*alpha, y);
177 norm=
Norm (f, alpha);
179 ASSERT (
degree (norm, alpha) <= 0,
"wrong norm computed");
188 if (normFactors.
getFirst().factor().inCoeffDomain())
190 if (normFactors.
length() < 2 && normFactors.
getLast().exp() == 1)
198 if (!(normFactors.
length() == 2 &&
229 factor=
factor (y + shift*alpha, y);
243 if (normFactors.
getLast().exp() == 1)
244 factors.
append (buf (y + shift*alpha, y));
246 tmp2.
append (buf (y + shift*alpha, y));
250 if (normFactors.
getLast().exp() == 1)
388 if (
i.getItem().factor().inCoeffDomain())
continue;
392 "time to factor sqrf factors in Q(a)[x]: ");
393 for (j= factorsSqrf; j.
hasItem(); j++)
int status int void size_t count
const CanonicalForm int const CFList const Variable & y
functions to print debug output
#define TIMING_END_AND_PRINT(t, msg)
Univariate factorization over algebraic extension of Q using Trager's algorithm.
CFFList sqrFreeZ(const CanonicalForm &a)
factory's class for variables
CanonicalForm sqrfNorm(const CanonicalForm &F, const Variable &alpha, int &i)
TIMING_DEFINE_PRINT(fac_alg_resultant) TIMING_DEFINE_PRINT(fac_alg_norm) TIMING_DEFINE_PRINT(fac_alg_factor_norm) TIMING_DEFINE_PRINT(fac_alg_gcd) TIMING_DEFINE_PRINT(fac_alg_sqrf) TIMING_DEFINE_PRINT(fac_alg_factor_sqrf) TIMING_DEFINE_PRINT(fac_alg_time_shift) CanonicalForm uniSqrfPart(const CanonicalForm &F)
static const int SW_USE_NTL_SORT
set to 1 to sort factors in a factorization
CFList AlgExtSqrfFactorize(const CanonicalForm &F, const Variable &alpha)
factorize a univariate squarefree polynomial over algebraic extension of Q
CFFList factorize(const CanonicalForm &f, bool issqrfree=false)
factorization over or
CFFList AlgExtFactorize(const CanonicalForm &F, const Variable &alpha)
factorize a univariate polynomial over algebraic extension of Q
int status int void * buf
static const int SW_RATIONAL
set to 1 for computations over Q
generate random integers, random elements of finite fields
declarations of higher level algorithms.
CanonicalForm bCommonDen(const CanonicalForm &f)
CanonicalForm bCommonDen ( const CanonicalForm & f )
CanonicalForm resultantZ(const CanonicalForm &A, const CanonicalForm &B, const Variable &x, bool prob)
modular resultant algorihtm over Z
This file provides utility functions for bivariate factorization.
modular resultant algorithm as described by G.
static CFFList norm(const CanonicalForm &f, const CanonicalForm &PPalpha, CFGenerator &myrandom, CanonicalForm &s, CanonicalForm &g, CanonicalForm &R, bool proof)
compute the norm R of f over PPalpha, g= f (x-s*alpha) if proof==true, R is squarefree and if in addi...
#define ASSERT(expression, message)
CanonicalForm getMipo(const Variable &alpha, const Variable &x)
CanonicalForm Norm(const CanonicalForm &F, const Variable &alpha)
CanonicalForm resultant(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ) ...
squarefree part and factorization over Q, Q(a)