 |
My Project
debian-1:4.1.1-p2+ds-4build3
|
#include "config.h"
#include "canonicalform.h"
#include "cf_algorithm.h"
#include "cfCharSetsUtil.h"
Go to the source code of this file.
|
int | degpsmax (const CFList &PS, const Variable &x, Intarray &A, Intarray &C) |
|
int | degpsmin (const CFList &PS, const Variable &x, Intarray &A, Intarray &B, Intarray &C, Intarray &D) |
|
int | Tdeg (const CFList &PS, const Variable &x, Intarray &A, Intarray &B, Intarray &C, Intarray &D, Intarray &E, Intarray &F) |
|
int | nr_of_poly (const CFList &PS, const Variable &x, Intarray &G) |
|
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) |
|
Variable | get_max_var (const CFList &PS) |
|
CFList | only_in_one (const CFList &PS, const Variable &x) |
|
void | initArray (const int highest_level, Intarray &A, Intarray &B, Intarray &C, Intarray &D, Intarray &E, Intarray &F, Intarray &G) |
|
Varlist | reorderb (const Varlist &difference, const CFList &PS, const int highest_level) |
|
CFList | swapvar (const CFList &PS, const Variable &x, const Variable &y) |
| swapvar a whole list of CanonicalForms More...
|
|
CFFList | swapvar (const CFFList &PS, const Variable &x, const Variable &y) |
|
bool | lowerRank (const CanonicalForm &F, const CanonicalForm &G, int &ind) |
|
CanonicalForm | lowestRank (const CFList &L) |
|
int | minLevel (const CFList &L) |
|
void | sortListCFList (ListCFList &list) |
| sort in descending order of length of elements More...
|
|
void | sortCFListByLevel (CFList &list) |
| sort in descending order of level of elements More...
|
|
bool | isSubset (const CFList &PS, const CFList &Cset) |
| is PS a subset of Cset ? More...
|
|
void | inplaceUnion (const ListCFList &a, ListCFList &b) |
| Union of a and b stored in b. More...
|
|
ListCFList | adjoin (const CFList &is, const CFList &qs, const ListCFList &qh) |
|
ListCFList | adjoinb (const CFList &is, const CFList &qs, const ListCFList &qh, const CFList &cs) |
|
void | select (const ListCFList &ppi, int length, ListCFList &ppi1, ListCFList &ppi2) |
|
CanonicalForm | normalize (const CanonicalForm &F) |
| normalize a poly, i.e. in char 0 clear denominators, remove integer content in char p divide by leading coeff More...
|
|
CanonicalForm | Prem (const CanonicalForm &F, const CanonicalForm &G) |
| pseudo remainder of F by G with certain factors of LC (g) cancelled More...
|
|
CanonicalForm | Premb (const CanonicalForm &f, const CFList &L) |
| pseudo remainder of f by L with faster test for remainder being zero More...
|
|
CanonicalForm | Prem (const CanonicalForm &f, const CFList &L) |
| pseudo remainder of f by L More...
|
|
CFList | uniGcd (const CFList &L) |
|
CFList | initials (const CFList &L) |
|
CFList | factorsOfInitials (const CFList &L) |
|
void | removeContent (CanonicalForm &F, CanonicalForm &cF) |
|
CFList | factorPSet (const CFList &PS) |
|
void | removeFactors (CanonicalForm &r, StoreFactors &StoredFactors, CFList &removedFactors) |
|
CFList | removeContent (const CFList &PS, StoreFactors &StoredFactors) |
|
bool | contractsub (const CFList &cs1, const CFList &cs2) |
|
ListCFList | contract (const ListCFList &cs) |
|
This file provides utility functions to compute characteristic sets
- 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.
- Authors
- Martin Lee
Definition in file cfCharSetsUtil.cc.
◆ __ARRAY_INIT__
#define __ARRAY_INIT__ -1 |
◆ __INIT_GAP__
◆ adjoin()
Definition at line 495 of file cfCharSetsUtil.cc.
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++)
◆ adjoinb()
Definition at line 533 of file cfCharSetsUtil.cc.
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++)
◆ contract()
◆ contractsub()
Definition at line 903 of file cfCharSetsUtil.cc.
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)
◆ degord()
Definition at line 162 of file cfCharSetsUtil.cc.
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;
◆ degpsmax()
◆ degpsmin()
◆ factorPSet()
◆ factorsOfInitials()
◆ get_max_var()
◆ initArray()
◆ initials()
◆ inplaceUnion()
◆ isSubset()
◆ lowerRank()
Definition at line 325 of file cfCharSetsUtil.cc.
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)
◆ lowestRank()
◆ minLevel()
◆ normalize()
normalize a poly, i.e. in char 0 clear denominators, remove integer content in char p divide by leading coeff
Definition at line 590 of file cfCharSetsUtil.cc.
◆ nr_of_poly()
◆ only_in_one()
◆ Prem() [1/2]
pseudo remainder of F by G with certain factors of LC (g) cancelled
Definition at line 616 of file cfCharSetsUtil.cc.
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);
◆ Prem() [2/2]
pseudo remainder of f by L
Definition at line 709 of file cfCharSetsUtil.cc.
714 for (
i.lastItem();
i.hasItem();
i--)
◆ Premb()
pseudo remainder of f by L with faster test for remainder being zero
Definition at line 677 of file cfCharSetsUtil.cc.
684 for (
i.lastItem();
i.hasItem();
i--)
◆ removeContent() [1/2]
◆ removeContent() [2/2]
◆ removeFactors()
Definition at line 822 of file cfCharSetsUtil.cc.
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()));
◆ reorderb()
Definition at line 259 of file cfCharSetsUtil.cc.
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++)
◆ select()
◆ sortCFListByLevel()
void sortCFListByLevel |
( |
CFList & |
list | ) |
|
sort in descending order of level of elements
Definition at line 428 of file cfCharSetsUtil.cc.
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();
◆ sortListCFList()
sort in descending order of length of elements
Definition at line 396 of file cfCharSetsUtil.cc.
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();
◆ swapvar() [1/2]
◆ swapvar() [2/2]
◆ Tdeg()
Definition at line 91 of file cfCharSetsUtil.cc.
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)
◆ uniGcd()
Definition at line 720 of file cfCharSetsUtil.cc.
725 for (
i= L;
i.hasItem();
i++)
727 if (
i.getItem().isUnivariate() &&
i.getItem().level() == 1)
737 for (;
i.hasItem();
i++)
CFList FS2
candidate factors that might get removed
static const int SW_RATIONAL
set to 1 for computations over Q
CanonicalForm Prem(const CanonicalForm &F, const CanonicalForm &G)
pseudo remainder of F by G with certain factors of LC (g) cancelled
const CanonicalForm int const CFList const Variable & y
int nr_of_poly(const CFList &PS, const Variable &x, Intarray &G)
CFList swapvar(const CFList &PS, const Variable &x, const Variable &y)
swapvar a whole list of CanonicalForms
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)
static BOOLEAN length(leftv result, leftv arg)
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)
REvaluation E(1, terms.length(), IntRandom(25))
bool lowerRank(const CanonicalForm &F, const CanonicalForm &G, int &ind)
bool isSubset(const CFList &PS, const CFList &Cset)
is PS a subset of Cset ?
CanonicalForm normalize(const CanonicalForm &F)
normalize a poly, i.e. in char 0 clear denominators, remove integer content in char p divide by leadi...
template List< Variable > Difference(const List< Variable > &, const List< Variable > &)
int status int void * buf
static int max(int a, int b)
CFList FS1
factors that were removed
int minLevel(const CFList &L)
bool contractsub(const CFList &cs1, const CFList &cs2)
CFFList factorize(const CanonicalForm &f, bool issqrfree=false)
factorization over or
bool fdivides(const CanonicalForm &f, const CanonicalForm &g)
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g )
CFList get_Terms(const CanonicalForm &f)
CanonicalForm bCommonDen(const CanonicalForm &f)
CanonicalForm bCommonDen ( const CanonicalForm & f )
static int min(int a, int b)
factory's class for variables
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 > &)
const Variable & v
< [in] a sqrfree bivariate poly
int degpsmin(const CFList &PS, const Variable &x, Intarray &A, Intarray &B, Intarray &C, Intarray &D)
int status int void size_t count
int degpsmax(const CFList &PS, const Variable &x, Intarray &A, Intarray &C)
void rem(unsigned long *a, unsigned long *q, unsigned long p, int °a, int degq)