23#define __ARRAY_INIT__ -1
73 if (temp <
min && temp != 0)
110 for (
i= PS;
i.hasItem();
i++)
117 if (LCdegList.
length() > 0)
120 int newmin, newnopslc;
124 nopslc= TermList.
length();
125 for (
i= LCdegList;
i.hasItem();
i++)
130 newnopslc= TermList.
length();
133 if (newnopslc < nopslc)
170 else if (C[ylevel] < C[xlevel])
return 1;
171 else if (C[xlevel] < C[ylevel])
return 0;
172 else if (
degpsmin(PS,
x,
A,
B,C,
D) <
degpsmin(PS,
y,
A,
B,C,
D))
return 1;
173 else if (
degpsmin(PS,
y,
A,
B,C,
D) <
degpsmin(PS,
x,
A,
B,C,
D))
return 0;
174 else if (
D[ylevel] <
D[xlevel])
return 1;
175 else if (
D[xlevel] <
D[ylevel])
return 0;
176 else if (
Tdeg(PS,
y,
A,
B,C,
D,
E,F) <
Tdeg(PS,
x,
A,
B,C,
D,
E,F))
return 1;
177 else if (
Tdeg(PS,
x,
A,
B,C,
D,
E,F) <
Tdeg(PS,
y,
A,
B,C,
D,
E,F))
return 0;
178 else if (F[ylevel] < F[xlevel])
return 1;
179 else if (F[xlevel] < F[ylevel])
return 0;
201 y=
i.getItem().mvar();
231 for (
int i=1 ;
i <= highest_level;
i ++)
257#define __INIT_GAP__ 3
260 const int highest_level)
262 Intarray A(1, highest_level),
B(1, highest_level), C(1, highest_level),
263 D(1, highest_level),
E(1, highest_level), F(1, highest_level),
271 for (J= difference; J.
hasItem(); J++ )
283 for (
i= gap;
i <= n - 1;
i++)
286 for (
j=
i - gap;
j >=0 ;
j -= gap)
297 for (
i= 0;
i <= n - 1;
i++)
327 int degF, degG, levelF, levelG;
333 if (
G.inCoeffDomain())
337 else if (
G.inCoeffDomain())
339 else if (levelF < levelG)
341 else if (levelF == levelG)
347 else if (degF == degG)
408 if ((
j.getItem().length() <
m.getItem().length()) ||
409 (
j.getItem().length() ==
m.getItem().length() &&
413 m.getItem()=
j.getItem();
416 j.getItem()=
m.getItem();
440 if ((
size (
j.getItem()) <
size (
m.getItem())) ||
442 && (
j.getItem().level() <
m.getItem().level())))
445 m.getItem()=
j.getItem();
448 j.getItem()=
m.getItem();
465 if (!
find (Cset,
i.getItem()))
486 for (
i= a;
i.hasItem();
i++)
503 for (
i= is;
i.hasItem();
i++)
505 if (
i.getItem().level() > 0)
514 for (
i= iscopy;
i.hasItem();
i++)
520 for (
j= qhi;
j.hasItem();
j++)
542 for (
i= is ;
i.hasItem();
i++)
544 if (
i.getItem().level() > 0)
551 for (
i= iscopy;
i.hasItem();
i++)
557 for (
j= qhi;
j.hasItem();
j++)
619 int degF, degG, levelF, levelG;
623 if ( (levelF= F.
level()) < (levelG=
G.level()))
627 if ( levelF == levelG )
650 while ((degG <= degF) && (!
f.isZero()))
655 t=
g*lv*
power (
v, degF - degG);
684 for (
i.lastItem();
i.hasItem();
i--)
691 if (ch == 0 && !isRat)
695 if (ch == 0 && !isRat)
700 if (ch == 0 && !isRat)
715 for (
i.lastItem();
i.hasItem();
i--)
726 for (
i= L;
i.hasItem();
i++)
728 if (
i.getItem().isUnivariate() &&
i.getItem().level() == 1)
738 for (;
i.hasItem();
i++)
766 tmp=
j.getItem().factor();
814 if (factors.
getFirst().factor().inCoeffDomain())
816 for (
j= factors;
j.hasItem();
j++ )
832 for (
int i=1;
i<= n;
i++)
836 for (
j= StoredFactors.
FS1;
j.hasItem();
j++)
844 for (
j= StoredFactors.
FS2;
j.hasItem();
j++)
847 if (
j.getItem() != r)
855 removedFactors=
Union (removedFactors,
CFList (
j.getItem()));
861 for (
j= testlist;
j.hasItem() && !r.
isOne();
j++)
864 if (
j.getItem() != r)
872 removedFactors=
Union (removedFactors,
CFList (
j.getItem()));
888 for (;
i.hasItem();
i++)
909 for (
i= cs1;
i.hasItem();
i++)
911 if (
Prem (
i.getItem(), cs2) != 0)
917 for (
i= is;
i.hasItem();
i++)
919 if (
Prem (
i.getItem(), cs2) == 0)
940 if (!
find (mem, iitem))
944 for (;
j.hasItem();
j++)
947 if (!
find (mem, jitem))
void inplaceUnion(const ListCFList &a, ListCFList &b)
Union of a and b stored in b.
CFList uniGcd(const CFList &L)
void removeFactors(CanonicalForm &r, StoreFactors &StoredFactors, CFList &removedFactors)
CFList initials(const CFList &L)
int degord(const Variable &x, const Variable &y, const CFList &PS, Intarray &A, Intarray &B, Intarray &C, Intarray &D, Intarray &E, Intarray &F, Intarray &G)
CFList swapvar(const CFList &PS, const Variable &x, const Variable &y)
swapvar a whole list of CanonicalForms
CanonicalForm Prem(const CanonicalForm &F, const CanonicalForm &G)
pseudo remainder of F by G with certain factors of LC (g) cancelled
int nr_of_poly(const CFList &PS, const Variable &x, Intarray &G)
CanonicalForm Premb(const CanonicalForm &f, const CFList &L)
pseudo remainder of f by L with faster test for remainder being zero
CFList only_in_one(const CFList &PS, const Variable &x)
int minLevel(const CFList &L)
CFList factorsOfInitials(const CFList &L)
int Tdeg(const CFList &PS, const Variable &x, Intarray &A, Intarray &B, Intarray &C, Intarray &D, Intarray &E, Intarray &F)
int degpsmin(const CFList &PS, const Variable &x, Intarray &A, Intarray &B, Intarray &C, Intarray &D)
void initArray(const int highest_level, Intarray &A, Intarray &B, Intarray &C, Intarray &D, Intarray &E, Intarray &F, Intarray &G)
void removeContent(CanonicalForm &F, CanonicalForm &cF)
bool contractsub(const CFList &cs1, const CFList &cs2)
void select(const ListCFList &ppi, int length, ListCFList &ppi1, ListCFList &ppi2)
bool isSubset(const CFList &PS, const CFList &Cset)
is PS a subset of Cset ?
Variable get_max_var(const CFList &PS)
void sortListCFList(ListCFList &list)
sort in descending order of length of elements
ListCFList adjoinb(const CFList &is, const CFList &qs, const ListCFList &qh, const CFList &cs)
int degpsmax(const CFList &PS, const Variable &x, Intarray &A, Intarray &C)
void sortCFListByLevel(CFList &list)
sort in descending order of level of elements
ListCFList contract(const ListCFList &cs)
CFList factorPSet(const CFList &PS)
bool lowerRank(const CanonicalForm &F, const CanonicalForm &G, int &ind)
Varlist reorderb(const Varlist &difference, const CFList &PS, const int highest_level)
ListCFList adjoin(const CFList &is, const CFList &qs, const ListCFList &qh)
CanonicalForm lowestRank(const CFList &L)
CanonicalForm normalize(const CanonicalForm &F)
normalize a poly, i.e. in char 0 clear denominators, remove integer content in char p divide by leadi...
This file provides utility functions to compute characteristic sets.
CanonicalForm bCommonDen(const CanonicalForm &f)
CanonicalForm bCommonDen ( const CanonicalForm & f )
bool fdivides(const CanonicalForm &f, const CanonicalForm &g)
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g )
declarations of higher level algorithms.
CFList get_Terms(const CanonicalForm &f)
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
class to store factors that get removed during char set computation
CFList FS2
candidate factors that might get removed
CFList FS1
factors that were removed
factory's class for variables
const CanonicalForm int const CFList const Variable & y
REvaluation E(1, terms.length(), IntRandom(25))
const Variable & v
< [in] a sqrfree bivariate poly
static int min(int a, int b)
static int max(int a, int b)
template List< Variable > Union(const List< Variable > &, const List< Variable > &)
template List< Variable > Difference(const List< Variable > &, const List< Variable > &)
template bool find(const List< CanonicalForm > &, const CanonicalForm &)
static BOOLEAN length(leftv result, leftv arg)
void rem(unsigned long *a, unsigned long *q, unsigned long p, int °a, int degq)
int status int void size_t count
int status int void * buf