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--)
714 for (
i.lastItem();
i.hasItem();
i--)
725 for (
i= L;
i.hasItem();
i++)
727 if (
i.getItem().isUnivariate() &&
i.getItem().level() == 1)
737 for (;
i.hasItem();
i++)
765 tmp=
j.getItem().factor();
813 if (factors.
getFirst().factor().inCoeffDomain())
815 for (
j= factors;
j.hasItem();
j++ )
831 for (
int i=1;
i<= n;
i++)
835 for (
j= StoredFactors.
FS1;
j.hasItem();
j++)
843 for (
j= StoredFactors.
FS2;
j.hasItem();
j++)
846 if (
j.getItem() != r)
854 removedFactors=
Union (removedFactors,
CFList (
j.getItem()));
860 for (
j= testlist;
j.hasItem() && !r.
isOne();
j++)
863 if (
j.getItem() != r)
871 removedFactors=
Union (removedFactors,
CFList (
j.getItem()));
881 if ((!
i.hasItem()) || (PS.
getFirst().level() == 0 ))
887 for (;
i.hasItem();
i++)
908 for (
i= cs1;
i.hasItem();
i++)
910 if (
Prem (
i.getItem(), cs2) != 0)
916 for (
i= is;
i.hasItem();
i++)
918 if (
Prem (
i.getItem(), cs2) == 0)
939 if (!
find (mem, iitem))
943 for (;
j.hasItem();
j++)
946 if (!
find (mem, jitem))
int status int void size_t count
void sortCFListByLevel(CFList &list)
sort in descending order of level of elements
void removeFactors(CanonicalForm &r, StoreFactors &StoredFactors, CFList &removedFactors)
const CanonicalForm int const CFList const Variable & y
ListCFList adjoin(const CFList &is, const CFList &qs, const ListCFList &qh)
Variable get_max_var(const CFList &PS)
bool contractsub(const CFList &cs1, const CFList &cs2)
void rem(unsigned long *a, unsigned long *q, unsigned long p, int °a, int degq)
CFList FS1
factors that were removed
void inplaceUnion(const ListCFList &a, ListCFList &b)
Union of a and b stored in b.
Varlist reorderb(const Varlist &difference, const CFList &PS, const int highest_level)
CanonicalForm normalize(const CanonicalForm &F)
normalize a poly, i.e. in char 0 clear denominators, remove integer content in char p divide by leadi...
CFList factorsOfInitials(const CFList &L)
static int min(int a, int b)
void sortListCFList(ListCFList &list)
sort in descending order of length of elements
factory's class for variables
class to store factors that get removed during char set computation
CFList uniGcd(const CFList &L)
int degpsmax(const CFList &PS, const Variable &x, Intarray &A, Intarray &C)
static CanonicalForm * retvalue
int minLevel(const CFList &L)
bool isSubset(const CFList &PS, const CFList &Cset)
is PS a subset of Cset ?
void removeContent(CanonicalForm &F, CanonicalForm &cF)
void initArray(const int highest_level, Intarray &A, Intarray &B, Intarray &C, Intarray &D, Intarray &E, Intarray &F, Intarray &G)
template bool find(const List< CanonicalForm > &, const CanonicalForm &)
template List< Variable > Union(const List< Variable > &, const List< Variable > &)
This file provides utility functions to compute characteristic sets.
CFFList factorize(const CanonicalForm &f, bool issqrfree=false)
factorization over or
CFList factorPSet(const CFList &PS)
bool lowerRank(const CanonicalForm &F, const CanonicalForm &G, int &ind)
ListCFList adjoinb(const CFList &is, const CFList &qs, const ListCFList &qh, const CFList &cs)
int nr_of_poly(const CFList &PS, const Variable &x, Intarray &G)
CFList initials(const CFList &L)
static int max(int a, int b)
CFList get_Terms(const CanonicalForm &f)
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)
int status int void * buf
CFList FS2
candidate factors that might get removed
void select(const ListCFList &ppi, int length, ListCFList &ppi1, ListCFList &ppi2)
int degpsmin(const CFList &PS, const Variable &x, Intarray &A, Intarray &B, Intarray &C, Intarray &D)
ListCFList contract(const ListCFList &cs)
static const int SW_RATIONAL
set to 1 for computations over Q
declarations of higher level algorithms.
CanonicalForm bCommonDen(const CanonicalForm &f)
CanonicalForm bCommonDen ( const CanonicalForm & f )
CanonicalForm lowestRank(const CFList &L)
bool fdivides(const CanonicalForm &f, const CanonicalForm &g)
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g )
const Variable & v
< [in] a sqrfree bivariate poly
CFList only_in_one(const CFList &PS, const Variable &x)
int Tdeg(const CFList &PS, const Variable &x, Intarray &A, Intarray &B, Intarray &C, Intarray &D, Intarray &E, Intarray &F)
REvaluation E(1, terms.length(), IntRandom(25))
static BOOLEAN length(leftv result, leftv arg)
CanonicalForm Premb(const CanonicalForm &f, const CFList &L)
pseudo remainder of f by L with faster test for remainder being zero
CanonicalForm Prem(const CanonicalForm &F, const CanonicalForm &G)
pseudo remainder of F by G with certain factors of LC (g) cancelled
CFList swapvar(const CFList &PS, const Variable &x, const Variable &y)
swapvar a whole list of CanonicalForms
template List< Variable > Difference(const List< Variable > &, const List< Variable > &)