35conv_to_factor_array(
const CFFList & L )
43 else if ( I.
getItem().factor().inBaseDomain() ) {
44 negate = I.
getItem().factor().sign() < 0;
60 for (
j = 1;
j <=
k;
j++ ) {
75 int M = 0,
i,
k =
f.level();
76 for (
i = 1;
i <=
k;
i++ )
135 DEBOUTLN( cerr,
"content( U0 ) = " << delta );
136 for ( I = F,
j = 1; I.
hasItem(); I++,
j++ )
152static int prime_number=0;
155 if (!
f.inBaseDomain() )
162 find_good_prime(
i.coeff(),start);
223 DEBOUTLN( cerr,
"-----------------------------------------------------" );
224 DEBOUTLN( cerr,
"trying to factorize U = " << U );
225 DEBOUTLN( cerr,
"U is a polynomial of level = " << arg.
level() );
226 DEBOUTLN( cerr,
"U will be factorized with respect to variable " <<
Variable(1) );
227 DEBOUTLN( cerr,
"the leading coefficient of U with respect to that variable is " << V );
228 DEBOUTLN( cerr,
"which is factorized as " << F );
231 for (
i = 2;
i <= t;
i++ )
234 if (
j > maxdeg ) maxdeg =
j;
237 if ( F.
getFirst().factor().inCoeffDomain() )
251 bool goodeval =
false;
260 findEvaluation( U, V, omega, F,
A, U0, delta,
D, r );
262 DEBOUTLN( cerr,
"the evaluation point to reduce to an univariate problem is " <<
A );
263 DEBOUTLN( cerr,
"corresponding delta = " << delta );
264 DEBOUTLN( cerr,
" omega = " << omega );
266 DEBOUTLN( cerr,
"now factorize the univariate polynomial " << U0 );
267 G = conv_to_factor_array(
factorize( U0,
false ) );
268 DEBOUTLN( cerr,
"which factorizes into " <<
G );
271 find_good_prime(arg,
i);
272 find_good_prime(U0,
i);
273 find_good_prime(U,
i);
280 return conv_to_factor_array(
CFFactor(arg,1));
283 else if (((
i==0)||(
i!=prime_number)))
285 b = coeffBound_old( U,
p );
290 modpk bb=coeffBound_old(U0,
p);
291 if (bb.
getk() >
b.getk() )
b=bb;
292 bb=coeffBound_old(arg,
p);
293 if (bb.
getk() >
b.getk() )
b=bb;
298 DEBOUTLN( cerr,
"the coefficient bound of the factors of U is " <<
b.getpk() );
303 DEBOUTLN( cerr,
"now trying to distribute the leading coefficients ..." );
310 DEBOUTLN( cerr,
"the univariate factors after distribution are " <<
G );
311 DEBOUTLN( cerr,
"the distributed leading coeffs are " << lcG );
312 DEBOUTLN( cerr,
"U may have changed and is now " << UU );
317 DEBOUTLN( cerr,
"!!! distribution was not correct !!!" );
318 DEBOUTLN( cerr,
"product of leading coeffs is " <<
prod( lcG ) );
319 DEBOUTLN( cerr,
"product of univariate factors is " <<
prod(
G ) );
320 DEBOUTLN( cerr,
"the new U is evaluated as " <<
A(UU) );
323 DEBOUTLN( cerr,
"leading coeffs correct" );
327 DEBOUTLN( cerr,
"we have found a bad evaluation point" );
337 for (
i = 1;
i <= r;
i++ )
366 for (
i = F;
i.hasItem();
i++ )
368 if (
i.getItem().factor().inCoeffDomain() )
370 if ( !
i.getItem().factor().isOne() )
371 R.append(
CFFactor(
i.getItem().factor(),
i.getItem().exp() ) );
382 cont =
swapvar( cont, v1, vm );
383 n =
i.getItem().exp();
385 DEBOUTLN( cerr,
"now after content ..." );
386 if (
g.isUnivariate() )
389 for (
j =
G;
j.hasItem();
j++ )
390 if ( !
j.getItem().factor().isOne() )
391 R.append(
CFFactor(
M(
j.getItem().factor() ), n ) );
395 GG = ZFactorizeMulti(
g );
397 for (
k =
GG.min();
k <=
m;
k++ )
398 if ( !
GG[
k].isOne() )
402 for (
j =
G;
j.hasItem();
j++ )
403 if ( !
j.getItem().factor().isOne() )
404 R.append(
CFFactor(
M(
j.getItem().factor() ), n ) );
static int Hensel(const CanonicalForm &UU, CFArray &G, const Evaluation &AA, const CFArray &LeadCoeffs)
CanonicalForm maxNorm(const CanonicalForm &f)
CanonicalForm maxNorm ( const CanonicalForm & f )
declarations of higher level algorithms.
CFFList FACTORY_PUBLIC sqrFree(const CanonicalForm &f, bool sort=false)
squarefree factorization
CFFList FACTORY_PUBLIC factorize(const CanonicalForm &f, bool issqrfree=false)
factorization over or
static const int SW_RATIONAL
set to 1 for computations over Q
Iterators for CanonicalForm's.
CanonicalForm compress(const CanonicalForm &f, CFMap &m)
CanonicalForm compress ( const CanonicalForm & f, CFMap & m )
int cf_getNumSmallPrimes()
int cf_getSmallPrime(int i)
generate random evaluation points
void out_cf(const char *s1, const CanonicalForm &f, const char *s2)
class to iterate through CanonicalForm's
class to evaluate a polynomial at points
class to generate random evaluation points
factory's class for variables
class to do operations mod p^k for int's p and k
functions to print debug output
#define DEBINCLEVEL(stream, msg)
#define DEBOUTLN(stream, objects)
#define DEBDECLEVEL(stream, msg)
bivariate factorization over Q(a)
bool nonDivisors(CanonicalForm omega, CanonicalForm delta, const CFArray &F, CFArray &d)
bool distributeLeadingCoeffs(CanonicalForm &U, CFArray &G, CFArray &lcG, const CFFList &F, const CFArray &D, CanonicalForm &delta, CanonicalForm &omega, const Evaluation &A, int r)
CFFList ZFactorizeMultivariate(const CanonicalForm &f, bool issqrfree)
bool isSqrFree(const CanonicalForm &f)
operations mod p^k and some other useful functions for factorization
bool delta(X x, Y y, D d)
#define TIMING_DEFINE_PRINT(t)