Macros | Functions | Variables
kbuckets.cc File Reference
#include <omalloc/omalloc.h>
#include <misc/auxiliary.h>
#include <polys/monomials/p_polys.h>
#include <coeffs/coeffs.h>
#include <polys/monomials/ring.h>
#include <polys/kbuckets.h>

Go to the source code of this file.

Macros

#define MULTIPLY_BUCKET(B, I)
 

Functions

unsigned int pLogLength (unsigned int l)
 Some internal stuff. More...
 
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)
 
poly kBucketExtractLmOfBucket (kBucket_pt bucket, int i)
 
int ksCheckCoeff (number *a, number *b, const coeffs r)
 

Variables

static omBin kBucket_bin = omGetSpecBin(sizeof(kBucket))
 

Macro Definition Documentation

§ MULTIPLY_BUCKET

#define MULTIPLY_BUCKET (   B,
 
)

Definition at line 43 of file kbuckets.cc.

Function Documentation

§ kbTest()

BOOLEAN kbTest ( kBucket_pt  bucket)

Tests.

Definition at line 181 of file kbuckets.cc.

182 {
183  return TRUE;
184 }
#define TRUE
Definition: auxiliary.h:101

§ 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 628 of file kbuckets.cc.

629 {
630  if (q == NULL) return;
631  assume(*l <= 0 || pLength(q) == *l);
632 
633  int i, l1;
634  ring r = bucket->bucket_ring;
635 
636  if (*l <= 0)
637  {
638  l1 = pLength(q);
639  *l = l1;
640  }
641  else
642  l1 = *l;
643 
644  kBucketMergeLm(bucket);
645  kbTest(bucket);
646  i = pLogLength(l1);
647 
648  while (bucket->buckets[i] != NULL)
649  {
650  //MULTIPLY_BUCKET(bucket,i);
651  #ifdef USE_COEF_BUCKETS
652  if (bucket->coef[i]!=NULL)
653  {
654  q = p_Plus_mm_Mult_qq(q, bucket->coef[i], bucket->buckets[i],
655  l1, bucket->buckets_length[i], r);
656  p_Delete(&bucket->coef[i],r);
657  p_Delete(&bucket->buckets[i],r);
658  }
659  else
660  q = p_Add_q(q, bucket->buckets[i],
661  l1, bucket->buckets_length[i], r);
662  #else
663  q = p_Add_q(q, bucket->buckets[i],
664  l1, bucket->buckets_length[i], r);
665  #endif
666  bucket->buckets[i] = NULL;
667  bucket->buckets_length[i] = 0;
668  i = pLogLength(l1);
669  assume(i<= MAX_BUCKET);
670  assume(bucket->buckets_used<= MAX_BUCKET);
671  }
672 
673  kbTest(bucket);
674  bucket->buckets[i] = q;
675  bucket->buckets_length[i]=l1;
676  if (i >= bucket->buckets_used)
677  bucket->buckets_used = i;
678  else
679  kBucketAdjustBucketsUsed(bucket);
680  kbTest(bucket);
681 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:181
#define MAX_BUCKET
Bucket definition (should be no one elses business, though)
Definition: kbuckets.h:174
static int pLength(poly a)
Definition: p_polys.h:189
const ring r
Definition: syzextra.cc:208
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:403
int i
Definition: cfEzgcd.cc:123
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
unsigned int pLogLength(unsigned int l)
Some internal stuff.
Definition: kbuckets.cc:55
#define NULL
Definition: omList.c:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877
int l
Definition: cfEzgcd.cc:94
static poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq, const ring r)
Definition: p_polys.h:1106

§ 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 978 of file kbuckets.cc.

979 {
980  if (q == NULL) return append;
981  poly lm;
982  loop
983  {
984  lm = kBucketGetLm(bucket);
985  if (lm == NULL) return append;
986  if (p_LmCmp(lm, q, bucket->bucket_ring) == 1)
987  {
988  lm = kBucketExtractLm(bucket);
989  pNext(append) = lm;
990  pIter(append);
991  }
992  else
993  {
994  return append;
995  }
996  }
997 }
CFFList append(const CFFList &Inputlist, const CFFactor &TheFactor)
loop
Definition: myNF.cc:98
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:480
poly kBucketExtractLm(kBucket_pt bucket)
Definition: kbuckets.cc:485
#define pIter(p)
Definition: monomials.h:44
ring bucket_ring
Definition: kbuckets.h:191
static int p_LmCmp(poly p, poly q, const ring r)
Definition: p_polys.h:1467
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10

§ 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 690 of file kbuckets.cc.

692 {
693  assume(*l <= 0 || pLength(p) == *l);
694  int i, l1;
695  poly p1 = p;
696  ring r = bucket->bucket_ring;
697 
698  if (*l <= 0)
699  {
700  l1 = pLength(p1);
701  *l = l1;
702  }
703  else
704  l1 = *l;
705 
706  if (m == NULL || p == NULL) return;
707 
708 #ifndef HAVE_PSEUDO_BUCKETS
709  kBucketMergeLm(bucket);
710  kbTest(bucket);
711  i = pLogLength(l1);
712 
713 #if defined(HAVE_PLURAL)
714  if ((rField_is_Ring(r) && !(rField_is_Domain(r)))
715  ||(rIsPluralRing(r)))
716  {
717  pSetCoeff0(m, n_InpNeg(pGetCoeff(m),r->cf));
718  p1=pp_Mult_mm(p,m,r);
719  pSetCoeff0(m, n_InpNeg(pGetCoeff(m),r->cf));
720  l1=pLength(p1);
721  i = pLogLength(l1);
722  }
723  else
724 #endif
725  {
726  if ((i <= bucket->buckets_used) && (bucket->buckets[i] != NULL))
727  {
728  assume(pLength(bucket->buckets[i])==bucket->buckets_length[i]);
729 //#ifdef USE_COEF_BUCKETS
730 // if(bucket->coef[i]!=NULL)
731 // {
732 // poly mult=p_Mult_mm(bucket->coef[i],m,r);
733 // bucket->coef[i]=NULL;
734 // p1 = p_Minus_mm_Mult_qq(bucket->buckets[i], mult, p1,
735 // bucket->buckets_length[i], l1,
736 // spNoether, r);
737 // }
738 // else
739 //#endif
740  MULTIPLY_BUCKET(bucket,i);
741  p1 = p_Minus_mm_Mult_qq(bucket->buckets[i], m, p1,
742  bucket->buckets_length[i], l1,
743  spNoether, r);
744  l1 = bucket->buckets_length[i];
745  bucket->buckets[i] = NULL;
746  bucket->buckets_length[i] = 0;
747  i = pLogLength(l1);
748  }
749  else
750  {
751  pSetCoeff0(m, n_InpNeg(pGetCoeff(m),r->cf));
752  if (spNoether != NULL)
753  {
754  l1 = -1;
755  p1 = r->p_Procs->pp_Mult_mm_Noether(p1, m, spNoether, l1, r);
756  i = pLogLength(l1);
757  }
758  else
759  {
760  p1 = r->p_Procs->pp_Mult_mm(p1, m, r);
761  }
762  pSetCoeff0(m, n_InpNeg(pGetCoeff(m),r->cf));
763  }
764  }
765 
766  while (bucket->buckets[i] != NULL)
767  {
768  //kbTest(bucket);
769  MULTIPLY_BUCKET(bucket,i);
770  p1 = p_Add_q(p1, bucket->buckets[i],
771  l1, bucket->buckets_length[i], r);
772  bucket->buckets[i] = NULL;
773  bucket->buckets_length[i] = 0;
774  i = pLogLength(l1);
775  }
776 
777  bucket->buckets[i] = p1;
778  bucket->buckets_length[i]=l1;
779  if (i >= bucket->buckets_used)
780  bucket->buckets_used = i;
781  else
782  kBucketAdjustBucketsUsed(bucket);
783 #else // HAVE_PSEUDO_BUCKETS
784  bucket->p = p_Minus_mm_Mult_qq(bucket->p, m, p,
785  bucket->l, l1,
786  spNoether, r);
787 #endif
788 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:181
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:43
return P p
Definition: myNF.cc:203
static poly pp_Mult_mm(poly p, poly m, const ring r)
Definition: p_polys.h:957
static BOOLEAN rField_is_Domain(const ring r)
Definition: ring.h:480
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static int pLength(poly a)
Definition: p_polys.h:189
const ring r
Definition: syzextra.cc:208
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
int m
Definition: cfEzgcd.cc:119
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)
Definition: coeffs.h:561
int i
Definition: cfEzgcd.cc:123
unsigned int pLogLength(unsigned int l)
Some internal stuff.
Definition: kbuckets.cc:55
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:477
#define NULL
Definition: omList.c:10
int l
Definition: kbuckets.h:182
poly p
Definition: kbuckets.h:181
#define pSetCoeff0(p, n)
Definition: monomials.h:67
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)
Definition: p_polys.h:976
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877
int l
Definition: cfEzgcd.cc:94

§ kBucket_Mult_n()

void kBucket_Mult_n ( kBucket_pt  bucket,
number  n 
)

Multiply Bucket by number ,i.e. Bpoly == n*Bpoly.

Definition at line 572 of file kbuckets.cc.

573 {
574 #ifndef HAVE_PSEUDO_BUCKETS
575  kbTest(bucket);
576  ring r=bucket->bucket_ring;
577  int i;
578 
579  for (i=0; i<= bucket->buckets_used; i++)
580  {
581  if (bucket->buckets[i] != NULL)
582  {
583 #ifdef USE_COEF_BUCKETS
584  if (i<coef_start)
585  bucket->buckets[i] = p_Mult_nn(bucket->buckets[i], n, r);
586  /* Frank Seelisch on March 11, 2010:
587  This looks a bit strange: The following "if" is indented
588  like the previous line of code. But coded as it is,
589  it should actually be two spaces less indented.
590  Question: Should the following "if" also only be
591  performed when "(i<coef_start)" is true?
592  For the time being, I leave it as it is. */
593  if (rField_is_Ring(r) && !(rField_is_Domain(r)))
594  {
595  bucket->buckets_length[i] = pLength(bucket->buckets[i]);
596  kBucketAdjust(bucket, i);
597  }
598  else
599  if (bucket->coef[i]!=NULL)
600  {
601  bucket->coef[i] = p_Mult_nn(bucket->coef[i],n,r);
602  }
603  else
604  {
605  bucket->coef[i] = p_NSet(n_Copy(n,r),r);
606  }
607 #else
608  bucket->buckets[i] = p_Mult_nn(bucket->buckets[i], n, r);
609  if (rField_is_Ring(r) && !(rField_is_Domain(r)))
610  {
611  bucket->buckets_length[i] = pLength(bucket->buckets[i]);
612  kBucketAdjust(bucket, i);
613  }
614 #endif
615  }
616  }
617  kbTest(bucket);
618 #else
619  bucket->p = p_Mult_nn(bucket->p, n, bucket->bucket_ring);
620 #endif
621 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:181
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1443
static BOOLEAN rField_is_Domain(const ring r)
Definition: ring.h:480
static int pLength(poly a)
Definition: p_polys.h:189
const ring r
Definition: syzextra.cc:208
ring bucket_ring
Definition: kbuckets.h:191
int i
Definition: cfEzgcd.cc:123
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:895
void kBucketAdjust(kBucket_pt bucket, int i)
Bucket number i from bucket is out of length sync, resync.
Definition: kbuckets.cc:539
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:477
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:455
poly p
Definition: kbuckets.h:181

§ 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 795 of file kbuckets.cc.

796 {
797  assume((!rIsPluralRing(bucket->bucket_ring))||p_IsConstant(m, bucket->bucket_ring));
798  assume(l <= 0 || pLength(p) == l);
799  int i, l1;
800  poly p1 = p;
801  ring r = bucket->bucket_ring;
802 
803  if (m == NULL || p == NULL) return;
804 
805  if (l <= 0)
806  {
807  l1 = pLength(p1);
808  l = l1;
809  }
810  else
811  l1 = l;
812 
813  kBucketMergeLm(bucket);
814  kbTest(bucket);
815  i = pLogLength(l1);
816  #ifdef USE_COEF_BUCKETS
817  number n=n_Init(1,r->cf);
818  #endif
819  if (i <= bucket->buckets_used && bucket->buckets[i] != NULL)
820  {
821  //if (FALSE){
822  #ifdef USE_COEF_BUCKETS
823  if ((bucket->coef[i]!=NULL) &&(i>=coef_start))
824  {
825  number orig_coef=p_GetCoeff(bucket->coef[i],r);
826  //we take ownership:
827  p_SetCoeff0(bucket->coef[i],n_Init(0,r),r);
828  number add_coef=n_Copy(p_GetCoeff(m,r),r);
829  number gcd=n_Gcd(add_coef, orig_coef,r);
830 
831  if (!(n_IsOne(gcd,r)))
832  {
833  number orig_coef2=n_ExactDiv(orig_coef,gcd,r);
834  number add_coef2=n_ExactDiv(add_coef, gcd,r);
835  n_Delete(&orig_coef,r);
836  n_Delete(&add_coef,r);
837  orig_coef=orig_coef2;
838  add_coef=add_coef2;
839 
840  //p_Mult_nn(bucket->buckets[i], orig_coef,r);
841  n_Delete(&n,r);
842  n=gcd;
843  }
844 
845  //assume(n_IsOne(n,r));
846  number backup=p_GetCoeff(m,r);
847 
848  p_SetCoeff0(m,add_coef,r);
849  bucket->buckets[i]=p_Mult_nn(bucket->buckets[i],orig_coef,r);
850 
851  n_Delete(&orig_coef,r);
852  p_Delete(&bucket->coef[i],r);
853 
854  p1 = p_Plus_mm_Mult_qq(bucket->buckets[i], m, p1,
855  bucket->buckets_length[i], l1, r);
856  l1=bucket->buckets_length[i];
857  bucket->buckets[i]=NULL;
858  bucket->buckets_length[i] = 0;
859  i = pLogLength(l1);
860  assume(l1==pLength(p1));
861 
862  p_SetCoeff(m,backup,r); //deletes add_coef
863  }
864  else
865  #endif
866  {
867  MULTIPLY_BUCKET(bucket,i);
868  p1 = p_Plus_mm_Mult_qq(bucket->buckets[i], m, p1,
869  bucket->buckets_length[i], l1, r);
870  l1 = bucket->buckets_length[i];
871  bucket->buckets[i] = NULL;
872  bucket->buckets_length[i] = 0;
873  i = pLogLength(l1);
874  }
875  }
876  else
877  {
878  #ifdef USE_COEF_BUCKETS
879  number swap_n=p_GetCoeff(m,r);
880 
881  assume(n_IsOne(n,r));
882  p_SetCoeff0(m,n,r);
883  n=swap_n;
884  //p_SetCoeff0(n, swap_n, r);
885  //p_GetCoeff0(n, swap_n,r);
886  #endif
887  p1 = r->p_Procs->pp_Mult_mm(p1, m, r);
888  #ifdef USE_COEF_BUCKETS
889  //m may not be changed
890  p_SetCoeff(m,n_Copy(n,r),r);
891  #endif
892  }
893 
894  while ((bucket->buckets[i] != NULL) && (p1!=NULL))
895  {
896  assume(i!=0);
897  #ifdef USE_COEF_BUCKETS
898  if ((bucket->coef[i]!=NULL) &&(i>=coef_start))
899  {
900  number orig_coef=p_GetCoeff(bucket->coef[i],r);
901  //we take ownership:
902  p_SetCoeff0(bucket->coef[i],n_Init(0,r),r);
903  number add_coef=n_Copy(n,r);
904  number gcd=n_Gcd(add_coef, orig_coef,r);
905 
906  if (!(n_IsOne(gcd,r)))
907  {
908  number orig_coef2=n_ExactDiv(orig_coef,gcd,r);
909  number add_coef2=n_ExactDiv(add_coef, gcd,r);
910  n_Delete(&orig_coef,r);
911  n_Delete(&n,r);
912  n_Delete(&add_coef,r);
913  orig_coef=orig_coef2;
914  add_coef=add_coef2;
915  //p_Mult_nn(bucket->buckets[i], orig_coef,r);
916  n=gcd;
917  }
918  //assume(n_IsOne(n,r));
919  bucket->buckets[i]=p_Mult_nn(bucket->buckets[i],orig_coef,r);
920  p1=p_Mult_nn(p1,add_coef,r);
921 
922  p1 = p_Add_q(p1, bucket->buckets[i],r);
923  l1=pLength(p1);
924 
925  bucket->buckets[i]=NULL;
926  n_Delete(&orig_coef,r);
927  p_Delete(&bucket->coef[i],r);
928  //l1=bucket->buckets_length[i];
929  assume(l1==pLength(p1));
930  }
931  else
932  #endif
933  {
934  //don't do that, pull out gcd
935  #ifdef USE_COEF_BUCKETS
936  if(!(n_IsOne(n,r)))
937  {
938  p1=p_Mult_nn(p1, n, r);
939  n_Delete(&n,r);
940  n=n_Init(1,r);
941  }
942  #endif
943  MULTIPLY_BUCKET(bucket,i);
944  p1 = p_Add_q(p1, bucket->buckets[i],
945  l1, bucket->buckets_length[i], r);
946  bucket->buckets[i] = NULL;
947  bucket->buckets_length[i] = 0;
948  }
949  i = pLogLength(l1);
950  }
951 
952  bucket->buckets[i] = p1;
953 #ifdef USE_COEF_BUCKETS
954  assume(bucket->coef[i]==NULL);
955 
956  if (!(n_IsOne(n,r)))
957  {
958  bucket->coef[i]=p_NSet(n,r);
959  }
960  else
961  {
962  bucket->coef[i]=NULL;
963  n_Delete(&n,r);
964  }
965 
966  if ((p1==NULL) && (bucket->coef[i]!=NULL))
967  p_Delete(&bucket->coef[i],r);
968 #endif
969  bucket->buckets_length[i]=l1;
970  if (i > bucket->buckets_used)
971  bucket->buckets_used = i;
972  else
973  kBucketAdjustBucketsUsed(bucket);
974 
975  kbTest(bucket);
976 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:181
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of &#39;a&#39; and &#39;b&#39; in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
Definition: coeffs.h:690
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:43
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:472
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1443
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:542
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:407
static int pLength(poly a)
Definition: p_polys.h:189
const ring r
Definition: syzextra.cc:208
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1876
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:895
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
unsigned int pLogLength(unsigned int l)
Some internal stuff.
Definition: kbuckets.cc:55
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:455
int gcd(int a, int b)
Definition: walkSupport.cc:839
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 ...
Definition: coeffs.h:626
#define p_GetCoeff(p, r)
Definition: monomials.h:57
#define p_SetCoeff0(p, n, r)
Definition: monomials.h:68
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877
int l
Definition: cfEzgcd.cc:94
static poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq, const ring r)
Definition: p_polys.h:1106

§ kBucketAdjust()

void kBucketAdjust ( kBucket_pt  bucket,
int  i 
)

Bucket number i from bucket is out of length sync, resync.

Definition at line 539 of file kbuckets.cc.

539  {
540 
541  MULTIPLY_BUCKET(bucket,i);
542 
543  int l1 = bucket->buckets_length[i];
544  poly p1 = bucket->buckets[i];
545  bucket->buckets[i] = NULL;
546  bucket->buckets_length[i] = 0;
547  i = pLogLength(l1);
548 
549  while (bucket->buckets[i] != NULL)
550  {
551  //kbTest(bucket);
552  MULTIPLY_BUCKET(bucket,i);
553  p1 = p_Add_q(p1, bucket->buckets[i],
554  l1, bucket->buckets_length[i], bucket->bucket_ring);
555  bucket->buckets[i] = NULL;
556  bucket->buckets_length[i] = 0;
557  i = pLogLength(l1);
558  }
559 
560  bucket->buckets[i] = p1;
561  bucket->buckets_length[i]=l1;
562  if (i >= bucket->buckets_used)
563  bucket->buckets_used = i;
564  else
565  kBucketAdjustBucketsUsed(bucket);
566 }
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:43
ring bucket_ring
Definition: kbuckets.h:191
int i
Definition: cfEzgcd.cc:123
unsigned int pLogLength(unsigned int l)
Some internal stuff.
Definition: kbuckets.cc:55
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877

§ kBucketClear()

void kBucketClear ( kBucket_pt  bucket,
poly p,
int *  length 
)

Definition at line 495 of file kbuckets.cc.

496 {
497  assume(pLength(bucket->p) == bucket->l);
498  *p = bucket->p;
499  *length = bucket->l;
500  bucket->p = NULL;
501  bucket->l = 0;
502 }
return P p
Definition: myNF.cc:203
static int pLength(poly a)
Definition: p_polys.h:189
#define assume(x)
Definition: mod2.h:403
#define NULL
Definition: omList.c:10
int l
Definition: kbuckets.h:182
poly p
Definition: kbuckets.h:181

§ kBucketCreate()

kBucket_pt kBucketCreate ( const ring  bucket_ring)

Creation/Destruction of buckets.

Definition at line 193 of file kbuckets.cc.

194 {
195  assume(bucket_ring != NULL);
197  bucket->bucket_ring = bucket_ring;
198  return bucket;
199 }
static omBin kBucket_bin
Definition: kbuckets.cc:45
kBucket * kBucket_pt
Definition: kbuckets.h:15
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:403
P bucket
Definition: myNF.cc:79
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10

§ kBucketDeleteAndDestroy()

void kBucketDeleteAndDestroy ( kBucket_pt bucket_pt)

Definition at line 207 of file kbuckets.cc.

208 {
209  kBucket_pt bucket = *bucket_pt;
210  kbTest(bucket);
211  int i;
212  for (i=0; i<= bucket->buckets_used; i++)
213  {
214 
215  if (bucket->buckets[i] != NULL)
216  {
217  p_Delete(&(bucket->buckets[i]), bucket->bucket_ring);
218 #ifdef USE_COEF_BUCKETS
219  if (bucket->coef[i]!=NULL)
220  p_Delete(&(bucket->coef[i]), bucket->bucket_ring);
221 #endif
222  }
223  }
224  omFreeBin(bucket, kBucket_bin);
225  *bucket_pt = NULL;
226 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:181
static omBin kBucket_bin
Definition: kbuckets.cc:45
ring bucket_ring
Definition: kbuckets.h:191
P bucket
Definition: myNF.cc:79
int i
Definition: cfEzgcd.cc:123
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
#define NULL
Definition: omList.c:10
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259

§ kBucketDestroy()

void kBucketDestroy ( kBucket_pt bucket_pt)

Definition at line 200 of file kbuckets.cc.

201 {
202  omFreeBin(*bucket_pt, kBucket_bin);
203  *bucket_pt = NULL;
204 }
static omBin kBucket_bin
Definition: kbuckets.cc:45
#define NULL
Definition: omList.c:10
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259

§ kBucketExtractLm()

poly kBucketExtractLm ( kBucket_pt  bucket)
inline

Definition at line 485 of file kbuckets.cc.

486 {
487  poly lm = bucket->p;
488  assume(pLength(bucket->p) == bucket->l);
489  pIter(bucket->p);
490  (bucket->l)--;
491  pNext(lm) = NULL;
492  return lm;
493 }
static int pLength(poly a)
Definition: p_polys.h:189
#define pIter(p)
Definition: monomials.h:44
#define assume(x)
Definition: mod2.h:403
#define NULL
Definition: omList.c:10
int l
Definition: kbuckets.h:182
#define pNext(p)
Definition: monomials.h:43
poly p
Definition: kbuckets.h:181
polyrec * poly
Definition: hilb.h:10

§ kBucketExtractLmOfBucket()

poly kBucketExtractLmOfBucket ( kBucket_pt  bucket,
int  i 
)

Definition at line 1249 of file kbuckets.cc.

1250 {
1251  assume(bucket->buckets[i]!=NULL);
1252 
1253  poly p=bucket->buckets[i];
1254  bucket->buckets_length[i]--;
1255 #ifdef USE_COEF_BUCKETS
1256  ring r=bucket->bucket_ring;
1257  if (bucket->coef[i]!=NULL)
1258  {
1259  poly next=pNext(p);
1260  if (next==NULL)
1261  {
1262  MULTIPLY_BUCKET(bucket,i);
1263  p=bucket->buckets[i];
1264  bucket->buckets[i]=NULL;
1265  return p;
1266  }
1267  else
1268  {
1269  bucket->buckets[i]=next;
1270  number c=p_GetCoeff(bucket->coef[i],r);
1271  pNext(p)=NULL;
1272  p=p_Mult_nn(p,c,r);
1273  assume(p!=NULL);
1274  return p;
1275  }
1276  }
1277  else
1278 #endif
1279  {
1280  bucket->buckets[i]=pNext(bucket->buckets[i]);
1281  pNext(p)=NULL;
1282  assume(p!=NULL);
1283  return p;
1284  }
1285 }
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:43
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:403
int i
Definition: cfEzgcd.cc:123
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:895
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
#define p_GetCoeff(p, r)
Definition: monomials.h:57
polyrec * poly
Definition: hilb.h:10
ListNode * next
Definition: janet.h:31

§ kBucketGetLm()

const poly kBucketGetLm ( kBucket_pt  bucket)

Definition at line 480 of file kbuckets.cc.

481 {
482  return bucket->p;
483 }
poly p
Definition: kbuckets.h:181

§ kBucketInit()

void kBucketInit ( kBucket_pt  bucket,
poly  lm,
int  length 
)

Definition at line 467 of file kbuckets.cc.

468 {
469  int i;
470 
471  assume(bucket != NULL);
472  assume(length <= 0 || length == pLength(lm));
473 
474  bucket->p = lm;
475  if (length <= 0) bucket->l = pLength(lm);
476  else bucket->l = length;
477 
478 }
static int pLength(poly a)
Definition: p_polys.h:189
#define assume(x)
Definition: mod2.h:403
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int l
Definition: kbuckets.h:182
poly p
Definition: kbuckets.h:181

§ kBucketPolyRed()

number kBucketPolyRed ( kBucket_pt  bucket,
poly  p1,
int  l1,
poly  spNoether 
)

Definition at line 1053 of file kbuckets.cc.

1056 {
1057  ring r=bucket->bucket_ring;
1058  assume((!rIsPluralRing(r))||p_LmEqual(p1,kBucketGetLm(bucket), r));
1059  assume(p1 != NULL &&
1060  p_DivisibleBy(p1, kBucketGetLm(bucket), r));
1061  assume(pLength(p1) == (int) l1);
1062 
1063  poly a1 = pNext(p1), lm = kBucketExtractLm(bucket);
1064  BOOLEAN reset_vec=FALSE;
1065  number rn;
1066 
1067  /* we shall reduce bucket=bn*lm+... by p1=an*t+a1 where t=lm(p1)
1068  and an,bn shall be defined further down only if lc(p1)!=1
1069  we already know: an|bn and t|lm */
1070  if(a1==NULL)
1071  {
1072  p_LmDelete(&lm, r);
1073  return n_Init(1,r->cf);
1074  }
1075 
1076  if (! n_IsOne(pGetCoeff(p1),r->cf))
1077  {
1078  number an = pGetCoeff(p1), bn = pGetCoeff(lm);
1079 //StringSetS("##### an = "); nWrite(an); PrintS(StringEndS("\n")); // NOTE/TODO: use StringAppendS("\n"); omFree(s);
1080 //StringSetS("##### bn = "); nWrite(bn); PrintS(StringEndS("\n")); // NOTE/TODO: use StringAppendS("\n"); omFree(s);
1081  /* ksCheckCoeff: divide out gcd from an and bn: */
1082  int ct = ksCheckCoeff(&an, &bn,r->cf);
1083  /* the previous command returns ct=0 or ct=2 iff an!=1
1084  note: an is now 1 or -1 */
1085 
1086  /* setup factor for p1 which cancels leading terms */
1087  p_SetCoeff(lm, bn, r);
1088  if ((ct == 0) || (ct == 2))
1089  {
1090  /* next line used to be here before but is WRONG:
1091  kBucket_Mult_n(bucket, an);
1092  its use would result in a wrong sign for the tail of bucket
1093  in the reduction */
1094 
1095  /* correct factor for cancelation by changing sign if an=-1 */
1096  if (rField_is_Ring(r))
1097  lm = p_Mult_nn(lm, an, r);
1098  else
1099  kBucket_Mult_n(bucket, an);
1100  }
1101  rn = an;
1102  }
1103  else
1104  {
1105  rn = n_Init(1,r->cf);
1106  }
1107 
1108  if (p_GetComp(p1, r) != p_GetComp(lm, r))
1109  {
1110  p_SetCompP(a1, p_GetComp(lm, r), r);
1111  reset_vec = TRUE;
1112  p_SetComp(lm, p_GetComp(p1, r), r);
1113  p_Setm(lm, r);
1114  }
1115 
1116  p_ExpVectorSub(lm, p1, r);
1117  l1--;
1118 
1119  assume(l1==pLength(a1));
1120 #if 0
1121  BOOLEAN backuped=FALSE;
1122  number coef;
1123  //@Viktor, don't ignore coefficients on monomials
1124  if(l1==1) {
1125 
1126  //if (rField_is_Q(r)) {
1127  //avoid this for function fields, as gcds are expensive at the moment
1128 
1129 
1130  coef=p_GetCoeff(a1,r);
1131  lm=p_Mult_nn(lm, coef, r);
1132  p_SetCoeff0(a1, n_Init(1,r), r);
1133  backuped=TRUE;
1134  //WARNING: not thread_safe
1135  //deletes coef as side effect
1136  //}
1137  }
1138 #endif
1139 
1140  kBucket_Minus_m_Mult_p(bucket, lm, a1, &l1, spNoether);
1141 
1142 #if 0
1143  if (backuped)
1144  p_SetCoeff0(a1,coef,r);
1145 #endif
1146 
1147  p_LmDelete(&lm, r);
1148  if (reset_vec) p_SetCompP(a1, 0, r);
1149  kbTest(bucket);
1150  return rn;
1151 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:181
#define FALSE
Definition: auxiliary.h:97
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:472
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:242
#define p_GetComp(p, r)
Definition: monomials.h:72
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:542
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:480
int ksCheckCoeff(number *a, number *b)
#define TRUE
Definition: auxiliary.h:101
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
void kBucket_Mult_n(kBucket_pt bucket, number n)
Multiply Bucket by number ,i.e. Bpoly == n*Bpoly.
Definition: kbuckets.cc:572
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:407
static int pLength(poly a)
Definition: p_polys.h:189
poly kBucketExtractLm(kBucket_pt bucket)
Definition: kbuckets.cc:485
const ring r
Definition: syzextra.cc:208
static void p_SetCompP(poly p, int i, ring r)
Definition: p_polys.h:249
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
static BOOLEAN p_DivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1777
static void p_ExpVectorSub(poly p1, poly p2, const ring r)
Definition: p_polys.h:1363
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:895
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...
Definition: kbuckets.cc:690
#define p_LmEqual(p1, p2, r)
Definition: p_polys.h:1611
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:477
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:228
#define p_GetCoeff(p, r)
Definition: monomials.h:57
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:706
#define p_SetCoeff0(p, n, r)
Definition: monomials.h:68
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:88

§ kBucketShallowCopyDelete()

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.

Definition at line 509 of file kbuckets.cc.

512 {
513 #ifndef HAVE_PSEUDO_BUCKETS
514  int i;
515 
516  kBucketCanonicalize(bucket);
517  for (i=0; i<= bucket->buckets_used; i++)
518  if (bucket->buckets[i] != NULL)
519  {
520  MULTIPLY_BUCKET(bucket,i);
521  bucket->buckets[i] = p_shallow_copy_delete(bucket->buckets[i],
522  bucket->bucket_ring,
523  new_tailRing,
524  new_tailBin);
525  }
526 #else
527  bucket->p = p_shallow_copy_delete(p,
528  bucket_ring,
529  new_tailRing,
530  new_tailBin);
531 #endif
532  bucket->bucket_ring = new_tailRing;
533 }
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:43
return P p
Definition: myNF.cc:203
ring bucket_ring
Definition: kbuckets.h:191
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
poly p
Definition: kbuckets.h:181
int kBucketCanonicalize(kBucket_pt bucket)

§ kBucketSimpleContent()

void kBucketSimpleContent ( kBucket_pt  )

Definition at line 1154 of file kbuckets.cc.

1154 {}

§ kBucketTakeOutComp()

void kBucketTakeOutComp ( kBucket_pt  bucket,
long  comp,
poly r_p,
int *  l 
)

Definition at line 1012 of file kbuckets.cc.

1015 {
1016  poly p = NULL, q;
1017  int i, lp = 0, lq;
1018 
1019 #ifndef HAVE_PSEUDO_BUCKETS
1020  kBucketMergeLm(bucket);
1021  for (i=1; i<=bucket->buckets_used; i++)
1022  {
1023  if (bucket->buckets[i] != NULL)
1024  {
1025  MULTIPLY_BUCKET(bucket,i);
1026  p_TakeOutComp(&(bucket->buckets[i]), comp, &q, &lq, bucket->bucket_ring);
1027  if (q != NULL)
1028  {
1029  assume(pLength(q) == lq);
1030  bucket->buckets_length[i] -= lq;
1031  assume(pLength(bucket->buckets[i]) == bucket->buckets_length[i]);
1032  p = p_Add_q(p, q, lp, lq, bucket->bucket_ring);
1033  }
1034  }
1035  }
1036  kBucketAdjustBucketsUsed(bucket);
1037 #else
1038  p_TakeOutComp(&(bucket->p), comp, &p, &lp,bucket->bucket_ring);
1039  (bucket->l) -= lp;
1040 #endif
1041  *r_p = p;
1042  *l = lp;
1043 
1044  kbTest(bucket);
1045 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:181
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:43
return P p
Definition: myNF.cc:203
void p_TakeOutComp(poly *p, long comp, poly *q, int *lq, const ring r)
Definition: p_polys.cc:3394
static int pLength(poly a)
Definition: p_polys.h:189
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:403
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int l
Definition: kbuckets.h:182
poly p
Definition: kbuckets.h:181
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877
int l
Definition: cfEzgcd.cc:94

§ ksCheckCoeff() [1/2]

int ksCheckCoeff ( number *  a,
number *  b 
)

§ ksCheckCoeff() [2/2]

int ksCheckCoeff ( number *  a,
number *  b,
const coeffs  r 
)

Definition at line 1298 of file kbuckets.cc.

1299 {
1300  int c = 0;
1301  number an = *a, bn = *b;
1302  n_Test(an,r);
1303  n_Test(bn,r);
1304 
1305  number cn = n_SubringGcd(an, bn, r);
1306 
1307  if(n_IsOne(cn, r))
1308  {
1309  an = n_Copy(an, r);
1310  bn = n_Copy(bn, r);
1311  }
1312  else
1313  {
1314  an = n_Div(an, cn, r); n_Normalize(an,r);
1315  bn = n_Div(bn, cn, r); n_Normalize(bn,r);
1316  }
1317  n_Delete(&cn, r);
1318  if (n_IsOne(an, r))
1319  {
1320  c = 1;
1321  }
1322  if (n_IsOne(bn, r))
1323  {
1324  c += 2;
1325  }
1326  *a = an;
1327  *b = bn;
1328  return c;
1329 }
const poly a
Definition: syzextra.cc:212
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:472
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:582
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:742
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:455
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of &#39;a&#39; and &#39;b&#39;, i.e., a/b; raises an error if &#39;b&#39; is not invertible in r exceptio...
Definition: coeffs.h:619
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
Definition: coeffs.h:692
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
const poly b
Definition: syzextra.cc:213

§ p_TakeOutComp()

void p_TakeOutComp ( poly p,
long  comp,
poly q,
int *  lq,
const ring  r 
)

Definition at line 3394 of file p_polys.cc.

3395 {
3396  spolyrec pp, qq;
3397  poly p, q, p_prev;
3398  int l = 0;
3399 
3400 #ifdef HAVE_ASSUME
3401  int lp = pLength(*r_p);
3402 #endif
3403 
3404  pNext(&pp) = *r_p;
3405  p = *r_p;
3406  p_prev = &pp;
3407  q = &qq;
3408 
3409  while(p != NULL)
3410  {
3411  while (p_GetComp(p,r) == comp)
3412  {
3413  pNext(q) = p;
3414  pIter(q);
3415  p_SetComp(p, 0,r);
3416  p_SetmComp(p,r);
3417  pIter(p);
3418  l++;
3419  if (p == NULL)
3420  {
3421  pNext(p_prev) = NULL;
3422  goto Finish;
3423  }
3424  }
3425  pNext(p_prev) = p;
3426  p_prev = p;
3427  pIter(p);
3428  }
3429 
3430  Finish:
3431  pNext(q) = NULL;
3432  *r_p = pNext(&pp);
3433  *r_q = pNext(&qq);
3434  *lq = l;
3435 #ifdef HAVE_ASSUME
3436  assume(pLength(*r_p) + pLength(*r_q) == lp);
3437 #endif
3438  p_Test(*r_p,r);
3439  p_Test(*r_q,r);
3440 }
return P p
Definition: myNF.cc:203
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:242
#define p_GetComp(p, r)
Definition: monomials.h:72
static int pLength(poly a)
Definition: p_polys.h:189
poly pp
Definition: myNF.cc:296
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:403
#define p_Test(p, r)
Definition: p_polys.h:160
#define p_SetmComp
Definition: p_polys.h:239
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
int l
Definition: cfEzgcd.cc:94

§ pLogLength() [1/2]

unsigned int pLogLength ( unsigned int  l)
inline

Some internal stuff.

Definition at line 55 of file kbuckets.cc.

56 {
57  unsigned int i = 0;
58 
59  if (l == 0) return 0;
60  l--;
61 #ifdef BUCKET_TWO_BASE
62  while ((l = (l >> 1))) i++;
63 #else
64  while ((l = (l >> 2))) i++;
65 #endif
66  return i+1;
67 }
int i
Definition: cfEzgcd.cc:123
int l
Definition: cfEzgcd.cc:94

§ pLogLength() [2/2]

unsigned int pLogLength ( poly  p)
inline

Definition at line 70 of file kbuckets.cc.

71 {
72  return pLogLength((unsigned int) pLength(p));
73 }
return P p
Definition: myNF.cc:203
static int pLength(poly a)
Definition: p_polys.h:189
unsigned int pLogLength(unsigned int l)
Some internal stuff.
Definition: kbuckets.cc:55

Variable Documentation

§ kBucket_bin

omBin kBucket_bin = omGetSpecBin(sizeof(kBucket))
static

Definition at line 45 of file kbuckets.cc.