 |
My Project
debian-1:4.1.1-p2+ds-4build3
|
Go to the source code of this file.
|
static int | LOG4 (int v) |
| Some internal stuff. More...
|
|
static unsigned int | pLogLength (unsigned int l) |
|
static unsigned int | pLogLength (poly p) |
|
BOOLEAN | kbTest (kBucket_pt bucket) |
| Tests. More...
|
|
kBucket_pt | kBucketCreate (const ring bucket_ring) |
| Creation/Destruction of buckets. More...
|
|
void | kBucketDestroy (kBucket_pt *bucket_pt) |
|
void | kBucketDeleteAndDestroy (kBucket_pt *bucket_pt) |
|
void | kBucketInit (kBucket_pt bucket, poly lm, int length) |
|
const poly | kBucketGetLm (kBucket_pt bucket) |
|
poly | kBucketExtractLm (kBucket_pt bucket) |
|
void | kBucketClear (kBucket_pt bucket, poly *p, int *length) |
|
void | kBucketShallowCopyDelete (kBucket_pt bucket, ring new_tailRing, omBin new_tailBin, pShallowCopyDeleteProc p_shallow_copy_delete) |
| For changing the ring of the Bpoly to new_tailBin. More...
|
|
void | kBucketAdjust (kBucket_pt bucket, int i) |
| Bucket number i from bucket is out of length sync, resync. More...
|
|
void | kBucket_Mult_n (kBucket_pt bucket, number n) |
| Multiply Bucket by number ,i.e. Bpoly == n*Bpoly. More...
|
|
void | kBucket_Add_q (kBucket_pt bucket, poly q, int *l) |
| Add to Bucket a poly ,i.e. Bpoly == q+Bpoly. More...
|
|
void | kBucket_Minus_m_Mult_p (kBucket_pt bucket, poly m, poly p, int *l, poly spNoether) |
| Bpoly == Bpoly - m*p; where m is a monom Does not destroy p and m assume (*l <= 0 || pLength(p) == *l) More...
|
|
void | kBucket_Plus_mm_Mult_pp (kBucket_pt bucket, poly m, poly p, int l) |
| Bpoly == Bpoly + m*p; where m is a monom Does not destroy p and m assume (l <= 0 || pLength(p) == l) More...
|
|
poly | kBucket_ExtractLarger (kBucket_pt bucket, poly q, poly append) |
| Extract all monomials of bucket which are larger than q Append those to append, and return last monomial of append. More...
|
|
void | p_TakeOutComp (poly *p, long comp, poly *q, int *lq, const ring r) |
|
void | kBucketTakeOutComp (kBucket_pt bucket, long comp, poly *r_p, int *l) |
|
int | ksCheckCoeff (number *a, number *b) |
|
number | kBucketPolyRed (kBucket_pt bucket, poly p1, int l1, poly spNoether) |
|
void | kBucketSimpleContent (kBucket_pt bucket) |
|
poly | kBucketExtractLmOfBucket (kBucket_pt bucket, int i) |
|
int | ksCheckCoeff (number *a, number *b, const coeffs r) |
|
◆ MULTIPLY_BUCKET
#define MULTIPLY_BUCKET |
( |
|
B, |
|
|
|
I |
|
) |
| |
◆ kbTest()
◆ kBucket_Add_q()
void kBucket_Add_q |
( |
kBucket_pt |
bucket, |
|
|
poly |
q, |
|
|
int * |
l |
|
) |
| |
Add to Bucket a poly ,i.e. Bpoly == q+Bpoly.
Add to Bucket a poly ,i.e. Bpoly == Bpoly + q.
Definition at line 636 of file kbuckets.cc.
638 if (q ==
NULL)
return;
652 kBucketMergeLm(bucket);
656 while (bucket->buckets[
i] !=
NULL)
659 #ifdef USE_COEF_BUCKETS
660 if (bucket->coef[
i]!=
NULL)
663 l1, bucket->buckets_length[
i], r);
669 l1, bucket->buckets_length[
i], r);
672 l1, bucket->buckets_length[
i], r);
674 bucket->buckets[
i] =
NULL;
675 bucket->buckets_length[
i] = 0;
682 bucket->buckets[
i] = q;
683 bucket->buckets_length[
i]=l1;
684 if (
i >= bucket->buckets_used)
685 bucket->buckets_used =
i;
687 kBucketAdjustBucketsUsed(bucket);
◆ kBucket_ExtractLarger()
poly kBucket_ExtractLarger |
( |
kBucket_pt |
bucket, |
|
|
poly |
q, |
|
|
poly |
append |
|
) |
| |
Extract all monomials of bucket which are larger than q Append those to append, and return last monomial of append.
Definition at line 986 of file kbuckets.cc.
◆ kBucket_Minus_m_Mult_p()
void kBucket_Minus_m_Mult_p |
( |
kBucket_pt |
bucket, |
|
|
poly |
m, |
|
|
poly |
p, |
|
|
int * |
l, |
|
|
poly |
spNoether |
|
) |
| |
Bpoly == Bpoly - m*p; where m is a monom Does not destroy p and m assume (*l <= 0 || pLength(p) == *l)
Bpoly == Bpoly - m*p; where m is a monom Does not destroy p and m (TODO: rename into kBucket_Minus_mm_Mult_pp!?) assume (*l <= 0 || pLength(p) == *l)
Definition at line 698 of file kbuckets.cc.
716 #ifndef HAVE_PSEUDO_BUCKETS
717 kBucketMergeLm(bucket);
721 #if defined(HAVE_PLURAL)
734 if ((i <= bucket->buckets_used) && (bucket->buckets[
i] !=
NULL))
736 assume(
pLength(bucket->buckets[
i])==(
unsigned)bucket->buckets_length[
i]);
750 bucket->buckets_length[
i], l1,
752 l1 = bucket->buckets_length[
i];
753 bucket->buckets[
i] =
NULL;
754 bucket->buckets_length[
i] = 0;
760 if (spNoether !=
NULL)
763 p1 = r->p_Procs->pp_Mult_mm_Noether(p1,
m, spNoether, l1, r);
768 p1 = r->p_Procs->pp_Mult_mm(p1,
m, r);
774 while (bucket->buckets[
i] !=
NULL)
778 p1 =
p_Add_q(p1, bucket->buckets[
i],
779 l1, bucket->buckets_length[
i], r);
780 bucket->buckets[
i] =
NULL;
781 bucket->buckets_length[
i] = 0;
785 bucket->buckets[
i] = p1;
786 bucket->buckets_length[
i]=l1;
787 if (
i >= bucket->buckets_used)
788 bucket->buckets_used =
i;
790 kBucketAdjustBucketsUsed(bucket);
791 #else // HAVE_PSEUDO_BUCKETS
◆ kBucket_Mult_n()
void kBucket_Mult_n |
( |
kBucket_pt |
bucket, |
|
|
number |
n |
|
) |
| |
Multiply Bucket by number ,i.e. Bpoly == n*Bpoly.
Definition at line 580 of file kbuckets.cc.
582 #ifndef HAVE_PSEUDO_BUCKETS
587 for (
i=0;
i<= bucket->buckets_used;
i++)
589 if (bucket->buckets[
i] !=
NULL)
591 #ifdef USE_COEF_BUCKETS
603 bucket->buckets_length[
i] =
pLength(bucket->buckets[
i]);
607 if (bucket->coef[
i]!=
NULL)
619 bucket->buckets_length[
i] =
pLength(bucket->buckets[
i]);
◆ kBucket_Plus_mm_Mult_pp()
void kBucket_Plus_mm_Mult_pp |
( |
kBucket_pt |
bucket, |
|
|
poly |
m, |
|
|
poly |
p, |
|
|
int |
l |
|
) |
| |
Bpoly == Bpoly + m*p; where m is a monom Does not destroy p and m assume (l <= 0 || pLength(p) == l)
Definition at line 803 of file kbuckets.cc.
821 kBucketMergeLm(bucket);
824 #ifdef USE_COEF_BUCKETS
827 if (i <= bucket->buckets_used && bucket->buckets[
i] !=
NULL)
830 #ifdef USE_COEF_BUCKETS
831 if ((bucket->coef[
i]!=
NULL) &&(
i>=coef_start))
837 number
gcd=
n_Gcd(add_coef, orig_coef,r);
845 orig_coef=orig_coef2;
857 bucket->buckets[
i]=
__p_Mult_nn(bucket->buckets[
i],orig_coef,r);
863 bucket->buckets_length[
i], l1, r);
864 l1=bucket->buckets_length[
i];
865 bucket->buckets[
i]=
NULL;
866 bucket->buckets_length[
i] = 0;
877 bucket->buckets_length[
i], l1, r);
878 l1 = bucket->buckets_length[
i];
879 bucket->buckets[
i] =
NULL;
880 bucket->buckets_length[
i] = 0;
886 #ifdef USE_COEF_BUCKETS
895 p1 = r->p_Procs->pp_Mult_mm(p1,
m, r);
896 #ifdef USE_COEF_BUCKETS
902 while ((bucket->buckets[
i] !=
NULL) && (p1!=
NULL))
905 #ifdef USE_COEF_BUCKETS
906 if ((bucket->coef[
i]!=
NULL) &&(
i>=coef_start))
911 number add_coef=
n_Copy(n,r);
912 number
gcd=
n_Gcd(add_coef, orig_coef,r);
921 orig_coef=orig_coef2;
927 bucket->buckets[
i]=
__p_Mult_nn(bucket->buckets[
i],orig_coef,r);
930 p1 =
p_Add_q(p1, bucket->buckets[
i],r);
933 bucket->buckets[
i]=
NULL;
943 #ifdef USE_COEF_BUCKETS
952 p1 =
p_Add_q(p1, bucket->buckets[
i],
953 l1, bucket->buckets_length[
i], r);
954 bucket->buckets[
i] =
NULL;
955 bucket->buckets_length[
i] = 0;
960 bucket->buckets[
i] = p1;
961 #ifdef USE_COEF_BUCKETS
970 bucket->coef[
i]=
NULL;
977 bucket->buckets_length[
i]=l1;
978 if (
i > bucket->buckets_used)
979 bucket->buckets_used =
i;
981 kBucketAdjustBucketsUsed(bucket);
◆ kBucketAdjust()
Bucket number i from bucket is out of length sync, resync.
Definition at line 547 of file kbuckets.cc.
551 int l1 = bucket->buckets_length[
i];
552 poly p1 = bucket->buckets[
i];
553 bucket->buckets[
i] =
NULL;
554 bucket->buckets_length[
i] = 0;
557 while (bucket->buckets[
i] !=
NULL)
561 p1 =
p_Add_q(p1, bucket->buckets[
i],
563 bucket->buckets[
i] =
NULL;
564 bucket->buckets_length[
i] = 0;
568 bucket->buckets[
i] = p1;
569 bucket->buckets_length[
i]=l1;
570 if (
i >= bucket->buckets_used)
571 bucket->buckets_used =
i;
573 kBucketAdjustBucketsUsed(bucket);
◆ kBucketClear()
void kBucketClear |
( |
kBucket_pt |
bucket, |
|
|
poly * |
p, |
|
|
int * |
length |
|
) |
| |
◆ kBucketCreate()
Creation/Destruction of buckets.
Definition at line 206 of file kbuckets.cc.
◆ kBucketDeleteAndDestroy()
void kBucketDeleteAndDestroy |
( |
kBucket_pt * |
bucket_pt | ) |
|
Definition at line 220 of file kbuckets.cc.
225 for (
i=0;
i<= bucket->buckets_used;
i++)
228 #ifdef USE_COEF_BUCKETS
◆ kBucketDestroy()
◆ kBucketExtractLm()
◆ kBucketExtractLmOfBucket()
poly kBucketExtractLmOfBucket |
( |
kBucket_pt |
bucket, |
|
|
int |
i |
|
) |
| |
Definition at line 1334 of file kbuckets.cc.
1338 poly
p=bucket->buckets[
i];
1339 bucket->buckets_length[
i]--;
1340 #ifdef USE_COEF_BUCKETS
1342 if (bucket->coef[
i]!=
NULL)
1348 p=bucket->buckets[
i];
1349 bucket->buckets[
i]=
NULL;
1354 bucket->buckets[
i]=
next;
1365 bucket->buckets[
i]=
pNext(bucket->buckets[
i]);
◆ kBucketGetLm()
◆ kBucketInit()
void kBucketInit |
( |
kBucket_pt |
bucket, |
|
|
poly |
lm, |
|
|
int |
length |
|
) |
| |
◆ kBucketPolyRed()
number kBucketPolyRed |
( |
kBucket_pt |
bucket, |
|
|
poly |
p1, |
|
|
int |
l1, |
|
|
poly |
spNoether |
|
) |
| |
Definition at line 1061 of file kbuckets.cc.
1096 if ((ct == 0) || (ct == 2))
◆ kBucketShallowCopyDelete()
For changing the ring of the Bpoly to new_tailBin.
Definition at line 517 of file kbuckets.cc.
521 #ifndef HAVE_PSEUDO_BUCKETS
525 for (
i=0;
i<= bucket->buckets_used;
i++)
526 if (bucket->buckets[
i] !=
NULL)
529 bucket->buckets[
i] = p_shallow_copy_delete(bucket->buckets[
i],
535 bucket->
p = p_shallow_copy_delete(
p,
◆ kBucketSimpleContent()
Definition at line 1162 of file kbuckets.cc.
1164 if (bucket->buckets[0]==
NULL)
return;
1170 if (
cf->cfSubringGcd==
ndGcd)
return;
1172 number nn=
pGetCoeff(bucket->buckets[0]);
1186 for (
int i=1;
i<=bucket->buckets_used;
i++)
1188 if (bucket->buckets[
i]!=
NULL)
1205 for (
int i=0;
i<=bucket->buckets_used;
i++)
1207 if (bucket->buckets[
i]!=
NULL)
1209 poly
p=bucket->buckets[
i];
1225 for (
int i=bucket->buckets_used;
i>=0;
i--)
1227 if (bucket->buckets[
i]!=
NULL)
1229 poly
p=bucket->buckets[
i];
◆ kBucketTakeOutComp()
void kBucketTakeOutComp |
( |
kBucket_pt |
bucket, |
|
|
long |
comp, |
|
|
poly * |
r_p, |
|
|
int * |
l |
|
) |
| |
Definition at line 1020 of file kbuckets.cc.
1027 #ifndef HAVE_PSEUDO_BUCKETS
1028 kBucketMergeLm(bucket);
1029 for (
i=1;
i<=bucket->buckets_used;
i++)
1031 if (bucket->buckets[
i] !=
NULL)
1038 bucket->buckets_length[
i] -=
lq;
1039 assume(
pLength(bucket->buckets[
i]) == (
unsigned)bucket->buckets_length[
i]);
1044 kBucketAdjustBucketsUsed(bucket);
◆ ksCheckCoeff() [1/2]
int ksCheckCoeff |
( |
number * |
a, |
|
|
number * |
b |
|
) |
| |
◆ ksCheckCoeff() [2/2]
int ksCheckCoeff |
( |
number * |
a, |
|
|
number * |
b, |
|
|
const coeffs |
r |
|
) |
| |
◆ LOG4()
Some internal stuff.
Definition at line 53 of file kbuckets.cc.
55 const unsigned int b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
56 const unsigned int S[] = {1, 2, 4, 8, 16};
59 if (
v &
b[4]) {
v >>= S[4]; r |= S[3]; }
60 if (
v &
b[3]) {
v >>= S[3]; r |= S[2]; }
61 if (
v &
b[2]) {
v >>= S[2]; r |= S[1]; }
62 if (
v &
b[1]) {
v >>= S[1]; r |= S[0]; }
◆ p_TakeOutComp()
void p_TakeOutComp |
( |
poly * |
p, |
|
|
long |
comp, |
|
|
poly * |
q, |
|
|
int * |
lq, |
|
|
const ring |
r |
|
) |
| |
◆ pLogLength() [1/2]
static unsigned int pLogLength |
( |
poly |
p | ) |
|
|
inlinestatic |
◆ pLogLength() [2/2]
static unsigned int pLogLength |
( |
unsigned int |
l | ) |
|
|
inlinestatic |
Definition at line 68 of file kbuckets.cc.
74 #ifdef BUCKET_TWO_BASE
◆ kBucket_bin
int ksCheckCoeff(number *a, number *b)
int kBucketCanonicalize(kBucket_pt bucket)
#define p_SetCoeff0(p, n, r)
static FORCE_INLINE number n_ExactDiv(number a, number b, const coeffs r)
assume that there is a canonical subring in cf and we know that division is possible for these a and ...
static BOOLEAN rField_is_Domain(const ring r)
static int LOG4(int v)
Some internal stuff.
static int SI_LOG2(int v)
static void p_SetCompP(poly p, int i, ring r)
#define MAX_BUCKET
Bucket definition (should be no one elses business, though)
static poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq, const ring r)
static poly p_Minus_mm_Mult_qq(poly p, const poly m, const poly q, int &lp, int lq, const poly spNoether, const ring r)
static BOOLEAN length(leftv result, leftv arg)
#define __p_GetComp(p, r)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
number p_InitContent(poly ph, const ring r)
static unsigned int pLogLength(unsigned int l)
static poly pp_Mult_mm(poly p, poly m, const ring r)
const poly kBucketGetLm(kBucket_pt bucket)
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
#define __p_Mult_nn(p, n, r)
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
static void p_ExpVectorSub(poly p1, poly p2, const ring r)
#define p_LmEqual(p1, p2, r)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
static unsigned pLength(poly a)
poly kBucketExtractLm(kBucket_pt bucket)
void PrintS(const char *s)
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
void kBucket_Minus_m_Mult_p(kBucket_pt bucket, poly m, poly p, int *l, poly spNoether)
Bpoly == Bpoly - m*p; where m is a monom Does not destroy p and m assume (*l <= 0 || pLength(p) == *l...
static BOOLEAN rField_is_Ring(const ring r)
void kBucket_Mult_n(kBucket_pt bucket, number n)
Multiply Bucket by number ,i.e. Bpoly == n*Bpoly.
number ndGcd(number, number, const coeffs r)
static void p_LmDelete(poly p, const ring r)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static BOOLEAN p_DivisibleBy(poly a, poly b, const ring r)
static int p_LmCmp(poly p, poly q, const ring r)
CFFList append(const CFFList &Inputlist, const CFFactor &TheFactor)
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
static void p_Delete(poly *p, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
static number p_SetCoeff(poly p, number n, ring r)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ,...
void p_TakeOutComp(poly *p, long comp, poly *q, int *lq, const ring r)
void kBucketAdjust(kBucket_pt bucket, int i)
Bucket number i from bucket is out of length sync, resync.
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
static void p_Setm(poly p, const ring r)
const Variable & v
< [in] a sqrfree bivariate poly
#define MULTIPLY_BUCKET(B, I)
static BOOLEAN p_IsConstant(const poly p, const ring r)
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
static FORCE_INLINE int n_Size(number n, const coeffs r)
return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used fo...
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
#define omFreeBin(addr, bin)
static poly p_Mult_nn(poly p, number n, const ring r)