 |
My Project
debian-1:4.1.1-p2+ds-4build3
|
#include "config.h"
#include "cf_assert.h"
#include "canonicalform.h"
#include "facAlgFuncUtil.h"
#include "cfCharSetsUtil.h"
#include "cf_random.h"
#include "cf_irred.h"
#include "cf_algorithm.h"
#include "cf_util.h"
#include "cf_iter.h"
Go to the source code of this file.
|
CFFList | append (const CFFList &Inputlist, const CFFactor &TheFactor) |
|
CFFList | merge (const CFFList &Inputlist1, const CFFList &Inputlist2) |
|
Varlist | varsInAs (const Varlist &uord, const CFList &Astar) |
|
CanonicalForm | generateMipo (int degOfExt) |
|
CanonicalForm | alg_lc (const CanonicalForm &f) |
|
CanonicalForm | alg_LC (const CanonicalForm &f, int lev) |
|
CanonicalForm | subst (const CanonicalForm &f, const CFList &a, const CFList &b, const CanonicalForm &Rstar, bool isFunctionField) |
|
CanonicalForm | backSubst (const CanonicalForm &F, const CFList &a, const CFList &b) |
|
void | deflateDegree (const CanonicalForm &F, int &pExp, int n) |
|
CanonicalForm | deflatePoly (const CanonicalForm &F, int exp) |
|
CanonicalForm | deflatePoly (const CanonicalForm &F, int exps, int n) |
|
CanonicalForm | inflatePoly (const CanonicalForm &F, int exp) |
|
CanonicalForm | inflatePoly (const CanonicalForm &F, int exps, int n) |
|
void | multiplicity (CFFList &factors, const CanonicalForm &F, const CFList &as) |
|
int | hasAlgVar (const CanonicalForm &f, const Variable &v) |
|
int | hasVar (const CanonicalForm &f, const Variable &v) |
|
int | hasAlgVar (const CanonicalForm &f) |
|
void | psqr (const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &q, CanonicalForm &r, CanonicalForm &multiplier, const Variable &x) |
| pseudo division of f and g wrt. x s.t. multiplier*f=q*g+r More...
|
|
CanonicalForm | Sprem (const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &m, CanonicalForm &q) |
|
CanonicalForm | divide (const CanonicalForm &ff, const CanonicalForm &f, const CFList &as) |
|
bool | isInseparable (const CFList &Astar) |
|
int | getDegOfExt (IntList °reelist, int n) |
|
CanonicalForm | QuasiInverse (const CanonicalForm &f, const CanonicalForm &g, const Variable &x) |
|
CanonicalForm | evaluate (const CanonicalForm &f, const CanonicalForm &g, const CanonicalForm &h, const CanonicalForm &powH) |
|
CanonicalForm | evaluate (const CanonicalForm &f, const CanonicalForm &g, const CanonicalForm &h, const CanonicalForm &powH, const Variable &v) |
| evaluate f at g/h at v such that powH*f is integral i.e. powH is assumed to be h^degree(f,v) More...
|
|
This file provides utility functions to factorize polynomials over alg. function fields
- Note
- some of the code is code from libfac or derived from code from libfac. Libfac is written by M. Messollen. See also COPYING for license information and README for general information on characteristic sets.
- Author
- Martin Lee
Definition in file facAlgFuncUtil.cc.
◆ alg_lc()
◆ alg_LC()
◆ append()
◆ backSubst()
◆ deflateDegree()
Definition at line 195 of file facAlgFuncUtil.cc.
197 if (n == 0 || n > F.
level())
207 for (;
i.hasTerms();
i++)
212 while ((
g >=
p) && (
g != 0) && (
g %
p == 0))
225 for (;
i.hasTerms();
i++)
230 else if (tmp != -1 && pExp != -1)
231 pExp= (pExp < tmp) ? pExp : tmp;
◆ deflatePoly() [1/2]
◆ deflatePoly() [2/2]
◆ divide()
◆ evaluate() [1/2]
Definition at line 640 of file facAlgFuncUtil.cc.
643 if (
f.inCoeffDomain())
646 int lastExp =
i.exp();
652 if ((lastExp - i_exp) == 1)
◆ evaluate() [2/2]
evaluate f at g/h at v such that powH*f is integral i.e. powH is assumed to be h^degree(f,v)
Definition at line 677 of file facAlgFuncUtil.cc.
681 if (
f.inCoeffDomain())
◆ generateMipo()
◆ getDegOfExt()
int getDegOfExt |
( |
IntList & |
degreelist, |
|
|
int |
n |
|
) |
| |
Definition at line 543 of file facAlgFuncUtil.cc.
550 for (
i= degreelist;
i.hasItem();
i++)
553 while (q <= ((n*
m)*(n*
m)/2))
561 for (
i= degreelist;
i.hasItem();
i++)
564 if (
igcd (
k,
i.getItem()) == 1)
◆ hasAlgVar() [1/2]
Definition at line 370 of file facAlgFuncUtil.cc.
372 if (
f.inBaseDomain())
374 if (
f.inCoeffDomain())
380 if (
f.inPolyDomain())
◆ hasAlgVar() [2/2]
Definition at line 322 of file facAlgFuncUtil.cc.
324 if (
f.inBaseDomain())
326 if (
f.inCoeffDomain())
332 if (
f.inPolyDomain())
◆ hasVar()
Definition at line 345 of file facAlgFuncUtil.cc.
347 if (
f.inBaseDomain())
349 if (
f.inCoeffDomain())
355 if (
f.inPolyDomain())
◆ inflatePoly() [1/2]
◆ inflatePoly() [2/2]
◆ isInseparable()
◆ merge()
Definition at line 52 of file facAlgFuncUtil.cc.
57 for (
i= Inputlist1;
i.hasItem();
i++)
58 Outputlist=
append (Outputlist,
i.getItem());
59 for (
i= Inputlist2;
i.hasItem() ;
i++)
60 Outputlist=
append (Outputlist,
i.getItem());
◆ multiplicity()
◆ psqr()
pseudo division of f and g wrt. x s.t. multiplier*f=q*g+r
Definition at line 395 of file facAlgFuncUtil.cc.
398 ASSERT(
x.
level() > 0,
"type error: polynomial variable expected" );
399 ASSERT( !
g.isZero(),
"math error: division by zero" );
404 if (
f.level() >
g.level())
415 int fDegree=
degree (F, X);
417 if (fDegree < 0 || fDegree < gDegree)
425 multiplier=
power (LCG, fDegree - gDegree + 1);
426 divrem (multiplier*F,
G, q, r);
◆ QuasiInverse()
◆ Sprem()
Definition at line 433 of file facAlgFuncUtil.cc.
441 if ((vf =
f.mvar()) < (vg =
g.mvar()))
473 while ((dg <= df) && (!ff.
isZero()))
492 q= (
m*
f - retvalue)/
g;
◆ subst()
Definition at line 120 of file facAlgFuncUtil.cc.
124 ASSERT ((a.
length() - 1)*4 ==
b.length() || (a.
length() == 1 &&
b.length() == 2),
"wrong length of lists");
126 ASSERT ((a.
length() - 1)*2 ==
b.length() || (a.
length() == 1 &&
b.length() == 1),
"lists of equal length expected");
134 for (;
i.hasItem() &&
j.hasItem();
i++,
j++)
136 if (!isFunctionField)
◆ varsInAs()
static const int SW_RATIONAL
set to 1 for computations over Q
void psqr(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &q, CanonicalForm &r, CanonicalForm &multiplier, const Variable &x)
pseudo division of f and g wrt. x s.t. multiplier*f=q*g+r
generate random elements in F_p
class to iterate through CanonicalForm's
CanonicalForm Prem(const CanonicalForm &F, const CanonicalForm &G)
pseudo remainder of F by G with certain factors of LC (g) cancelled
CanonicalForm alg_lc(const CanonicalForm &f)
CanonicalForm evaluate(const CanonicalForm &f, const CanonicalForm &g, const CanonicalForm &h, const CanonicalForm &powH)
static BOOLEAN length(leftv result, leftv arg)
CanonicalForm randomIrredpoly(int i, const Variable &x)
computes a random monic irreducible univariate polynomial in x over Fp of degree i via NTL
bool delta(X x, Y y, D d)
#define ASSERT(expression, message)
CanonicalForm Sprem(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &m, CanonicalForm &q)
CanonicalForm find_irreducible(int deg, CFRandom &gen, const Variable &x)
generate a random irreducible polynomial in x of degree deg
CFFList append(const CFFList &Inputlist, const CFFactor &TheFactor)
void deflateDegree(const CanonicalForm &F, int &pExp, int n)
int ipower(int b, int m)
int ipower ( int b, int m )
bool fdivides(const CanonicalForm &f, const CanonicalForm &g)
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g )
gmp_float exp(const gmp_float &a)
CanonicalForm bCommonDen(const CanonicalForm &f)
CanonicalForm bCommonDen ( const CanonicalForm & f )
CanonicalForm inflatePoly(const CanonicalForm &F, int exp)
factory's class for variables
CanonicalForm deflatePoly(const CanonicalForm &F, int exp)
int hasAlgVar(const CanonicalForm &f, const Variable &v)
const Variable & v
< [in] a sqrfree bivariate poly
int status int void size_t count
CFArray copy(const CFList &list)
write elements of list into an array
int hasVar(const CanonicalForm &f, const Variable &v)