38#define DEBOUTHPRINT(stream, msg, hg) \
39{std::stream << deb_level_msg << msg, std::stream.flush(); hprint( hg ); std::stream << std::endl;}
45 std::cerr <<
"( " << n <<
": ";
49 std::cerr <<
i <<
" ";
55#define DEBOUTHPRINT(stream, msg, hg)
63 for (
i = 1;
i < n;
i++ )
65 for (
j = 1;
j <=
i;
j++ )
67 for (
k =
i;
k < n;
k +=
j )
74 int i, n,
na = a[0],
nb =
b[0];
79 for (
i = 1;
i < n;
i++ )
102 for (
int j = 1;
j < n;
j++ ) a[
j] = 0;
103 for (
i = F;
i.hasItem();
i++ )
104 if ( (
k =
i.getItem().factor().degree()) < n )
107 STICKYWARN(
k == -1,
"there occured an error. factory was not able to factorize\n"
108 "correctly mod p. Please send the example which caused\n"
109 "this error to the authors. Nonetheless we will go on with the\n"
110 "calculations hoping the result will be correct. Thank you." );
120 int i, n = a[0],
m = F.size(),
k;
121 for (
i = 1;
i < n;
i++ ) a[
i] = 0;
122 for (
i = 1;
i <
m;
i++ )
127 STICKYWARN(
k == -1,
"there occured an error. factory was not able to factorize\n"
128 "correctly mod p. Please send the example which caused\n"
129 "this error to the authors. Nonetheless we will go on with the\n"
130 "calculations hoping the result will be correct. Thank you." );
225 return gcd(
f,
f.deriv() ).degree() == 0;
254 if (
mod(
lc(
f ), prime ) != 0 )
274 CanonicalForm a,
b,
aa,
bb, c,
g,
h,
g1,
h1, e, modulus,
tmp, q, r;
280 DEBOUTLN(
cerr,
"quadratic lift called with p = " <<
p <<
" and k = " <<
k );
302 while ( ! e.
isZero() &&
j > 0 ) {
316 a += ( ( 1 - a *
g1 ) * a ) %
h1;
317 b += ( ( 1 -
b *
h1 ) *
b ) %
g1;
330 if (
mod(
f -
g *
h, modulus ) != 0 ) {
351 CanonicalForm a,
b, c,
g,
h,
g1,
h1, e, modulus,
tmp, q, r;
385 ASSERT(
mod(
f -
g *
h, modulus ) == 0,
"error at lift stage" );
397 return (F-
gk*
hk).isZero();
428 for (
J =
H;
J.hasItem(); ++
J ) {
429 f =
J.getItem().factor();
430 if (
f.inCoeffDomain() )
continue;
431 n =
f.degree() / 2 + 1;
434 D =
new int [n];
D[0] = n;
435 Dh =
new int [n];
Dh[0] = n;
436 exp =
J.getItem().exp();
443 DEBOUTLN(
cerr,
"warning: no good prime found to factorize " <<
f );
444 STICKYWARN( ok,
"there occured an error. We went out of primes p\n"
445 "to factorize mod p. Please send the example which caused\n"
446 "this error to the authors. Nonetheless we will go on with the\n"
447 "calculations hoping the result will be correct. Thank you.");
500 while (
I.hasItem() ) {
501 DEBOUTLN(
cerr,
"factor to lift = " <<
I.getItem().factor() );
511 fp /=
I.getItem().factor();
546 for (
i = 1;
i <
D[0];
i++ )
This file defines functions for conversion to FLINT (www.flintlib.org) and back.
CanonicalForm extgcd(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &a, CanonicalForm &b)
CanonicalForm extgcd ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & a,...
univariate Gcd over finite fields and Z, extended GCD over finite fields and Q
CanonicalForm euclideanNorm(const CanonicalForm &f)
CanonicalForm euclideanNorm ( const CanonicalForm & f )
declarations of higher level algorithms.
CFFList FACTORY_PUBLIC sqrFree(const CanonicalForm &f, bool sort=false)
squarefree factorization
#define STICKYWARN(expression, message)
#define ASSERT(expression, message)
static const int SW_SYMMETRIC_FF
set to 1 for symmetric representation over F_q
static const int SW_FAC_QUADRATICLIFT
Iterators for CanonicalForm's.
void sort(int(*)(const T &, const T &))
factory's class for variables
class to do operations mod p^k for int's p and k
CanonicalForm getpk() const
functions to print debug output
#define DEBINCLEVEL(stream, msg)
#define DEBOUTLN(stream, objects)
#define DEBDECLEVEL(stream, msg)
CFFList FpFactorizeUnivariateCZ(const CanonicalForm &f, bool issqrfree, int numext, const Variable alpha, const Variable beta)
squarefree part and factorization over Q, Q(a)
CFFList sqrFreeFp(const CanonicalForm &f)
bool isSqrFree(const CanonicalForm &f)
CFFList ZFactorizeUnivariate(const CanonicalForm &ff, bool issqrfree=false)
CanonicalForm replaceLc(const CanonicalForm &f, const CanonicalForm &c)
operations mod p^k and some other useful functions for factorization
static int min(int a, int b)
static BOOLEAN length(leftv result, leftv arg)
gmp_float exp(const gmp_float &a)
static int SI_LOG2(int v)
#define TIMING_DEFINE_PRINT(t)
#define TIMING_END_AND_PRINT(t, msg)