41#if defined(HAVE_NTL) || defined(HAVE_FLINT)
53 for (
int i = 0;
i <= n;
i++)
71 for (
int i= 1;
i <= n;
i++)
102 for (
int i= 1;
i <= n;
i++)
129 for (
int i= 1;
i <= n;
i++)
172 for (
int j=
i + 1;
j <=
m;
j++)
220 for (
int i= 1;
i <= n;
i++)
277#elif defined(HAVE_NTL)
399 if (!
algExt && (
p < (1 << 28)))
403 int deg= ceil (29.0*((
double)
log (2)/
log (
p)))+1;
408 for (
int i= 0;
i <
p;
i++)
418 int deg= ceil (29.0*((
double)
log (2)/
log (
p)));
474 for (
int i= 0;
i <
p;
i++)
514 if ((*gen).hasItems())
533 for (
i =
f;
i.hasTerms();
i++ ) {
534 c =
mod(
i.coeff(), q );
548 if (
f.isUnivariate() ||
f.inCoeffDomain())
638 while (
i >= 0 &&
mod(
l,
p ) == 0)
This file defines functions for conversion to FLINT (www.flintlib.org) and back.
Rational abs(const Rational &a)
zz_pEX convertFacCF2NTLzz_pEX(const CanonicalForm &f, const zz_pX &mipo)
CanonicalForm convertNTLzzpE2CF(const zz_pE &coefficient, const Variable &x)
zz_pX convertFacCF2NTLzzpX(const CanonicalForm &f)
Conversion to and from NTL.
int myCompress(const CanonicalForm &F, const CanonicalForm &G, CFMap &M, CFMap &N, bool topLevel)
compressing two polynomials F and G, M is used for compressing, N to reverse the compression
const CanonicalForm CFMap CFMap & N
static CanonicalForm oneNorm(const CanonicalForm &F)
const CanonicalForm CFMap CFMap const Variable & x
static CanonicalForm symmetricRemainder(const CanonicalForm &f, const CanonicalForm &q)
CanonicalForm resultantFp(const CanonicalForm &A, const CanonicalForm &B, const Variable &x, bool prob)
modular resultant algorihtm over Fp
static CanonicalForm uniResultant(const CanonicalForm &F, const CanonicalForm &G)
static void evalPoint(const CanonicalForm &F, const CanonicalForm &G, CanonicalForm &FEval, CanonicalForm &GEval, CFGenerator &evalPoint)
CanonicalForm resultantZ(const CanonicalForm &A, const CanonicalForm &B, const Variable &x, bool prob)
modular resultant algorihtm over Z
const CanonicalForm CFMap & M
static CanonicalForm newtonInterp(const CanonicalForm &alpha, const CanonicalForm &u, const CanonicalForm &newtonPoly, const CanonicalForm &oldInterPoly, const Variable &x)
static CanonicalForm balanceUni(const CanonicalForm &f, const CanonicalForm &q)
modular resultant algorithm as described by G.
CanonicalForm bCommonDen(const CanonicalForm &f)
CanonicalForm bCommonDen ( const CanonicalForm & f )
declarations of higher level algorithms.
void FACTORY_PUBLIC chineseRemainder(const CanonicalForm &x1, const CanonicalForm &q1, const CanonicalForm &x2, const CanonicalForm &q2, CanonicalForm &xnew, CanonicalForm &qnew)
void chineseRemainder ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2,...
CanonicalForm FACTORY_PUBLIC resultant(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x )
#define STICKYASSERT(expression, message)
#define ASSERT(expression, message)
static const int SW_RATIONAL
set to 1 for computations over Q
generate integers, elements of finite fields
CanonicalForm randomIrredpoly(int i, const Variable &x)
computes a random monic irreducible univariate polynomial in x over Fp of degree i via NTL/FLINT
generate random irreducible univariate polynomials
Iterators for CanonicalForm's.
static CanonicalForm bound(const CFMatrix &M)
CanonicalForm mapPrimElem(const CanonicalForm &primElem, const Variable &alpha, const Variable &beta)
compute the image of a primitive element of in . We assume .
CanonicalForm primitiveElement(const Variable &alpha, Variable &beta, bool &fail)
determine a primitive element of , is a primitive element of a field which is isomorphic to
static CanonicalForm mapDown(const CanonicalForm &F, const Variable &alpha, const CanonicalForm &G, CFList &source, CFList &dest)
the CanonicalForm G is the output of map_up, returns F considered as an element over ,...
static CanonicalForm mapUp(const Variable &alpha, const Variable &beta)
and is a primitive element, returns the image of
This file implements functions to map between extensions of finite fields.
int cf_getBigPrime(int i)
generate random integers, random elements of finite fields
generate all elements in F_p(alpha) starting from 0
virtual class for generators
class to iterate through CanonicalForm's
generate all elements in F_p starting from 0
factory's class for variables
const CanonicalForm int const CFList const Variable & y
const Variable & v
< [in] a sqrfree bivariate poly
bool isInExtension(const CanonicalForm &F, const CanonicalForm &gamma, const int k, const CanonicalForm &delta, CFList &source, CFList &dest)
tests if F is not contained in a subfield defined by gamma (Fq case) or k (GF case)
This file provides utility functions for bivariate factorization.
convertFacCF2nmod_poly_t(FLINTmipo, M)
nmod_poly_clear(FLINTmipo)
Variable FACTORY_PUBLIC rootOf(const CanonicalForm &, char name='@')
returns a symbolic root of polynomial with name name Use it to define algebraic variables
CanonicalForm getMipo(const Variable &alpha, const Variable &x)
void FACTORY_PUBLIC prune(Variable &alpha)
some useful template functions.
template CanonicalForm tmax(const CanonicalForm &, const CanonicalForm &)
gmp_float log(const gmp_float &a)
int status int void size_t count
int status int void * buf
#define TIMING_DEFINE_PRINT(t)
#define TIMING_END_AND_PRINT(t, msg)