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 (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

#define MULTIPLY_BUCKET (   B,
 
)

Definition at line 47 of file kbuckets.cc.

Function Documentation

BOOLEAN kbTest ( kBucket_pt  bucket)

Tests.

Definition at line 185 of file kbuckets.cc.

186 {
187  return TRUE;
188 }
#define TRUE
Definition: auxiliary.h:144
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.

637 {
638  if (q == NULL) return;
639  assume(*l <= 0 || pLength(q) == *l);
640 
641  int i, l1;
642  ring r = bucket->bucket_ring;
643 
644  if (*l <= 0)
645  {
646  l1 = pLength(q);
647  *l = l1;
648  }
649  else
650  l1 = *l;
651 
652  kBucketMergeLm(bucket);
653  kbTest(bucket);
654  i = pLogLength(l1);
655 
656  while (bucket->buckets[i] != NULL)
657  {
658  //MULTIPLY_BUCKET(bucket,i);
659  #ifdef USE_COEF_BUCKETS
660  if (bucket->coef[i]!=NULL)
661  {
662  q = p_Plus_mm_Mult_qq(q, bucket->coef[i], bucket->buckets[i],
663  l1, bucket->buckets_length[i], r);
664  p_Delete(&bucket->coef[i],r);
665  p_Delete(&bucket->buckets[i],r);
666  }
667  else
668  q = p_Add_q(q, bucket->buckets[i],
669  l1, bucket->buckets_length[i], r);
670  #else
671  q = p_Add_q(q, bucket->buckets[i],
672  l1, bucket->buckets_length[i], r);
673  #endif
674  bucket->buckets[i] = NULL;
675  bucket->buckets_length[i] = 0;
676  i = pLogLength(l1);
677  assume(i<= MAX_BUCKET);
678  assume(bucket->buckets_used<= MAX_BUCKET);
679  }
680 
681  kbTest(bucket);
682  bucket->buckets[i] = q;
683  bucket->buckets_length[i]=l1;
684  if (i >= bucket->buckets_used)
685  bucket->buckets_used = i;
686  else
687  kBucketAdjustBucketsUsed(bucket);
688  kbTest(bucket);
689 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:185
#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:405
int i
Definition: cfEzgcd.cc:123
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
unsigned int pLogLength(unsigned int l)
Some internal stuff.
Definition: kbuckets.cc:59
#define NULL
Definition: omList.c:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
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:1111
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.

987 {
988  if (q == NULL) return append;
989  poly lm;
990  loop
991  {
992  lm = kBucketGetLm(bucket);
993  if (lm == NULL) return append;
994  if (p_LmCmp(lm, q, bucket->bucket_ring) == 1)
995  {
996  lm = kBucketExtractLm(bucket);
997  pNext(append) = lm;
998  pIter(append);
999  }
1000  else
1001  {
1002  return append;
1003  }
1004  }
1005 }
CFFList append(const CFFList &Inputlist, const CFFactor &TheFactor)
loop
Definition: myNF.cc:98
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:484
poly kBucketExtractLm(kBucket_pt bucket)
Definition: kbuckets.cc:489
#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:1472
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
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.

700 {
701  assume(*l <= 0 || pLength(p) == *l);
702  int i, l1;
703  poly p1 = p;
704  ring r = bucket->bucket_ring;
705 
706  if (*l <= 0)
707  {
708  l1 = pLength(p1);
709  *l = l1;
710  }
711  else
712  l1 = *l;
713 
714  if (m == NULL || p == NULL) return;
715 
716 #ifndef HAVE_PSEUDO_BUCKETS
717  kBucketMergeLm(bucket);
718  kbTest(bucket);
719  i = pLogLength(l1);
720 
721 #if defined(HAVE_RINGS)||defined(HAVE_PLURAL)
722  if ((rField_is_Ring(r) && !(rField_is_Domain(r)))
723  ||(rIsPluralRing(r)))
724  {
725  pSetCoeff0(m, n_InpNeg(pGetCoeff(m),r->cf));
726  p1=pp_Mult_mm(p,m,r);
727  pSetCoeff0(m, n_InpNeg(pGetCoeff(m),r->cf));
728  l1=pLength(p1);
729  i = pLogLength(l1);
730  }
731  else
732 #endif
733  {
734  if ((i <= bucket->buckets_used) && (bucket->buckets[i] != NULL))
735  {
736  assume(pLength(bucket->buckets[i])==bucket->buckets_length[i]);
737 //#ifdef USE_COEF_BUCKETS
738 // if(bucket->coef[i]!=NULL)
739 // {
740 // poly mult=p_Mult_mm(bucket->coef[i],m,r);
741 // bucket->coef[i]=NULL;
742 // p1 = p_Minus_mm_Mult_qq(bucket->buckets[i], mult, p1,
743 // bucket->buckets_length[i], l1,
744 // spNoether, r);
745 // }
746 // else
747 //#endif
748  MULTIPLY_BUCKET(bucket,i);
749  p1 = p_Minus_mm_Mult_qq(bucket->buckets[i], m, p1,
750  bucket->buckets_length[i], l1,
751  spNoether, r);
752  l1 = bucket->buckets_length[i];
753  bucket->buckets[i] = NULL;
754  bucket->buckets_length[i] = 0;
755  i = pLogLength(l1);
756  }
757  else
758  {
759  pSetCoeff0(m, n_InpNeg(pGetCoeff(m),r->cf));
760  if (spNoether != NULL)
761  {
762  l1 = -1;
763  p1 = r->p_Procs->pp_Mult_mm_Noether(p1, m, spNoether, l1, r);
764  i = pLogLength(l1);
765  }
766  else
767  {
768  p1 = r->p_Procs->pp_Mult_mm(p1, m, r);
769  }
770  pSetCoeff0(m, n_InpNeg(pGetCoeff(m),r->cf));
771  }
772  }
773 
774  while (bucket->buckets[i] != NULL)
775  {
776  //kbTest(bucket);
777  MULTIPLY_BUCKET(bucket,i);
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;
782  i = pLogLength(l1);
783  }
784 
785  bucket->buckets[i] = p1;
786  bucket->buckets_length[i]=l1;
787  if (i >= bucket->buckets_used)
788  bucket->buckets_used = i;
789  else
790  kBucketAdjustBucketsUsed(bucket);
791 #else // HAVE_PSEUDO_BUCKETS
792  bucket->p = p_Minus_mm_Mult_qq(bucket->p, m, p,
793  bucket->l, l1,
794  spNoether, r);
795 #endif
796 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:185
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:47
return P p
Definition: myNF.cc:203
static poly pp_Mult_mm(poly p, poly m, const ring r)
Definition: p_polys.h:962
static BOOLEAN rField_is_Domain(const ring r)
Definition: ring.h:440
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 bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
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:405
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:558
int i
Definition: cfEzgcd.cc:123
unsigned int pLogLength(unsigned int l)
Some internal stuff.
Definition: kbuckets.cc:59
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#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:981
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
int l
Definition: cfEzgcd.cc:94
void kBucket_Mult_n ( kBucket_pt  bucket,
number  n 
)

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

Definition at line 576 of file kbuckets.cc.

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

804 {
805  assume((!rIsPluralRing(bucket->bucket_ring))||p_IsConstant(m, bucket->bucket_ring));
806  assume(l <= 0 || pLength(p) == l);
807  int i, l1;
808  poly p1 = p;
809  ring r = bucket->bucket_ring;
810 
811  if (m == NULL || p == NULL) return;
812 
813  if (l <= 0)
814  {
815  l1 = pLength(p1);
816  l = l1;
817  }
818  else
819  l1 = l;
820 
821  kBucketMergeLm(bucket);
822  kbTest(bucket);
823  i = pLogLength(l1);
824  #ifdef USE_COEF_BUCKETS
825  number n=n_Init(1,r->cf);
826  #endif
827  if (i <= bucket->buckets_used && bucket->buckets[i] != NULL)
828  {
829  //if (FALSE){
830  #ifdef USE_COEF_BUCKETS
831  if ((bucket->coef[i]!=NULL) &&(i>=coef_start))
832  {
833  number orig_coef=p_GetCoeff(bucket->coef[i],r);
834  //we take ownership:
835  p_SetCoeff0(bucket->coef[i],n_Init(0,r),r);
836  number add_coef=n_Copy(p_GetCoeff(m,r),r);
837  number gcd=n_Gcd(add_coef, orig_coef,r);
838 
839  if (!(n_IsOne(gcd,r)))
840  {
841  number orig_coef2=n_ExactDiv(orig_coef,gcd,r);
842  number add_coef2=n_ExactDiv(add_coef, gcd,r);
843  n_Delete(&orig_coef,r);
844  n_Delete(&add_coef,r);
845  orig_coef=orig_coef2;
846  add_coef=add_coef2;
847 
848  //p_Mult_nn(bucket->buckets[i], orig_coef,r);
849  n_Delete(&n,r);
850  n=gcd;
851  }
852 
853  //assume(n_IsOne(n,r));
854  number backup=p_GetCoeff(m,r);
855 
856  p_SetCoeff0(m,add_coef,r);
857  bucket->buckets[i]=p_Mult_nn(bucket->buckets[i],orig_coef,r);
858 
859  n_Delete(&orig_coef,r);
860  p_Delete(&bucket->coef[i],r);
861 
862  p1 = p_Plus_mm_Mult_qq(bucket->buckets[i], m, p1,
863  bucket->buckets_length[i], l1, r);
864  l1=bucket->buckets_length[i];
865  bucket->buckets[i]=NULL;
866  bucket->buckets_length[i] = 0;
867  i = pLogLength(l1);
868  assume(l1==pLength(p1));
869 
870  p_SetCoeff(m,backup,r); //deletes add_coef
871  }
872  else
873  #endif
874  {
875  MULTIPLY_BUCKET(bucket,i);
876  p1 = p_Plus_mm_Mult_qq(bucket->buckets[i], m, p1,
877  bucket->buckets_length[i], l1, r);
878  l1 = bucket->buckets_length[i];
879  bucket->buckets[i] = NULL;
880  bucket->buckets_length[i] = 0;
881  i = pLogLength(l1);
882  }
883  }
884  else
885  {
886  #ifdef USE_COEF_BUCKETS
887  number swap_n=p_GetCoeff(m,r);
888 
889  assume(n_IsOne(n,r));
890  p_SetCoeff0(m,n,r);
891  n=swap_n;
892  //p_SetCoeff0(n, swap_n, r);
893  //p_GetCoeff0(n, swap_n,r);
894  #endif
895  p1 = r->p_Procs->pp_Mult_mm(p1, m, r);
896  #ifdef USE_COEF_BUCKETS
897  //m may not be changed
898  p_SetCoeff(m,n_Copy(n,r),r);
899  #endif
900  }
901 
902  while ((bucket->buckets[i] != NULL) && (p1!=NULL))
903  {
904  assume(i!=0);
905  #ifdef USE_COEF_BUCKETS
906  if ((bucket->coef[i]!=NULL) &&(i>=coef_start))
907  {
908  number orig_coef=p_GetCoeff(bucket->coef[i],r);
909  //we take ownership:
910  p_SetCoeff0(bucket->coef[i],n_Init(0,r),r);
911  number add_coef=n_Copy(n,r);
912  number gcd=n_Gcd(add_coef, orig_coef,r);
913 
914  if (!(n_IsOne(gcd,r)))
915  {
916  number orig_coef2=n_ExactDiv(orig_coef,gcd,r);
917  number add_coef2=n_ExactDiv(add_coef, gcd,r);
918  n_Delete(&orig_coef,r);
919  n_Delete(&n,r);
920  n_Delete(&add_coef,r);
921  orig_coef=orig_coef2;
922  add_coef=add_coef2;
923  //p_Mult_nn(bucket->buckets[i], orig_coef,r);
924  n=gcd;
925  }
926  //assume(n_IsOne(n,r));
927  bucket->buckets[i]=p_Mult_nn(bucket->buckets[i],orig_coef,r);
928  p1=p_Mult_nn(p1,add_coef,r);
929 
930  p1 = p_Add_q(p1, bucket->buckets[i],r);
931  l1=pLength(p1);
932 
933  bucket->buckets[i]=NULL;
934  n_Delete(&orig_coef,r);
935  p_Delete(&bucket->coef[i],r);
936  //l1=bucket->buckets_length[i];
937  assume(l1==pLength(p1));
938  }
939  else
940  #endif
941  {
942  //don't do that, pull out gcd
943  #ifdef USE_COEF_BUCKETS
944  if(!(n_IsOne(n,r)))
945  {
946  p1=p_Mult_nn(p1, n, r);
947  n_Delete(&n,r);
948  n=n_Init(1,r);
949  }
950  #endif
951  MULTIPLY_BUCKET(bucket,i);
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;
956  }
957  i = pLogLength(l1);
958  }
959 
960  bucket->buckets[i] = p1;
961 #ifdef USE_COEF_BUCKETS
962  assume(bucket->coef[i]==NULL);
963 
964  if (!(n_IsOne(n,r)))
965  {
966  bucket->coef[i]=p_NSet(n,r);
967  }
968  else
969  {
970  bucket->coef[i]=NULL;
971  n_Delete(&n,r);
972  }
973 
974  if ((p1==NULL) && (bucket->coef[i]!=NULL))
975  p_Delete(&bucket->coef[i],r);
976 #endif
977  bucket->buckets_length[i]=l1;
978  if (i > bucket->buckets_used)
979  bucket->buckets_used = i;
980  else
981  kBucketAdjustBucketsUsed(bucket);
982 
983  kbTest(bucket);
984 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:185
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...
Definition: coeffs.h:685
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:47
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:469
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1448
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:539
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
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:405
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1784
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:902
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
unsigned int pLogLength(unsigned int l)
Some internal stuff.
Definition: kbuckets.cc:59
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:452
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:622
#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 'p'
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
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:1111
void kBucketAdjust ( kBucket_pt  bucket,
int  i 
)

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

Definition at line 543 of file kbuckets.cc.

543  {
544 
545  MULTIPLY_BUCKET(bucket,i);
546 
547  int l1 = bucket->buckets_length[i];
548  poly p1 = bucket->buckets[i];
549  bucket->buckets[i] = NULL;
550  bucket->buckets_length[i] = 0;
551  i = pLogLength(l1);
552 
553  while (bucket->buckets[i] != NULL)
554  {
555  //kbTest(bucket);
556  MULTIPLY_BUCKET(bucket,i);
557  p1 = p_Add_q(p1, bucket->buckets[i],
558  l1, bucket->buckets_length[i], bucket->bucket_ring);
559  bucket->buckets[i] = NULL;
560  bucket->buckets_length[i] = 0;
561  i = pLogLength(l1);
562  }
563 
564  bucket->buckets[i] = p1;
565  bucket->buckets_length[i]=l1;
566  if (i >= bucket->buckets_used)
567  bucket->buckets_used = i;
568  else
569  kBucketAdjustBucketsUsed(bucket);
570 }
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:47
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:59
#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:884
void kBucketClear ( kBucket_pt  bucket,
poly p,
int *  length 
)

Definition at line 499 of file kbuckets.cc.

500 {
501  assume(pLength(bucket->p) == bucket->l);
502  *p = bucket->p;
503  *length = bucket->l;
504  bucket->p = NULL;
505  bucket->l = 0;
506 }
return P p
Definition: myNF.cc:203
static int pLength(poly a)
Definition: p_polys.h:189
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
int l
Definition: kbuckets.h:182
poly p
Definition: kbuckets.h:181
kBucket_pt kBucketCreate ( ring  bucket_ring)

Creation/Destruction of buckets.

Definition at line 197 of file kbuckets.cc.

198 {
199  assume(bucket_ring != NULL);
201  bucket->bucket_ring = bucket_ring;
202  return bucket;
203 }
static omBin kBucket_bin
Definition: kbuckets.cc:49
kBucket * kBucket_pt
Definition: kbuckets.h:15
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:405
P bucket
Definition: myNF.cc:79
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
void kBucketDeleteAndDestroy ( kBucket_pt bucket_pt)

Definition at line 211 of file kbuckets.cc.

212 {
213  kBucket_pt bucket = *bucket_pt;
214  kbTest(bucket);
215  int i;
216  for (i=0; i<= bucket->buckets_used; i++)
217  {
218 
219  if (bucket->buckets[i] != NULL)
220  {
221  p_Delete(&(bucket->buckets[i]), bucket->bucket_ring);
222 #ifdef USE_COEF_BUCKETS
223  if (bucket->coef[i]!=NULL)
224  p_Delete(&(bucket->coef[i]), bucket->bucket_ring);
225 #endif
226  }
227  }
228  omFreeBin(bucket, kBucket_bin);
229  *bucket_pt = NULL;
230 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:185
static omBin kBucket_bin
Definition: kbuckets.cc:49
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:850
#define NULL
Definition: omList.c:10
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
void kBucketDestroy ( kBucket_pt bucket_pt)

Definition at line 204 of file kbuckets.cc.

205 {
206  omFreeBin(*bucket_pt, kBucket_bin);
207  *bucket_pt = NULL;
208 }
static omBin kBucket_bin
Definition: kbuckets.cc:49
#define NULL
Definition: omList.c:10
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
poly kBucketExtractLm ( kBucket_pt  bucket)
inline

Definition at line 489 of file kbuckets.cc.

490 {
491  poly lm = bucket->p;
492  assume(pLength(bucket->p) == bucket->l);
493  pIter(bucket->p);
494  (bucket->l)--;
495  pNext(lm) = NULL;
496  return lm;
497 }
static int pLength(poly a)
Definition: p_polys.h:189
#define pIter(p)
Definition: monomials.h:44
#define assume(x)
Definition: mod2.h:405
#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
poly kBucketExtractLmOfBucket ( kBucket_pt  bucket,
int  i 
)

Definition at line 1257 of file kbuckets.cc.

1258 {
1259  assume(bucket->buckets[i]!=NULL);
1260 
1261  poly p=bucket->buckets[i];
1262  bucket->buckets_length[i]--;
1263 #ifdef USE_COEF_BUCKETS
1264  ring r=bucket->bucket_ring;
1265  if (bucket->coef[i]!=NULL)
1266  {
1267  poly next=pNext(p);
1268  if (next==NULL)
1269  {
1270  MULTIPLY_BUCKET(bucket,i);
1271  p=bucket->buckets[i];
1272  bucket->buckets[i]=NULL;
1273  return p;
1274  }
1275  else
1276  {
1277  bucket->buckets[i]=next;
1278  number c=p_GetCoeff(bucket->coef[i],r);
1279  pNext(p)=NULL;
1280  p=p_Mult_nn(p,c,r);
1281  assume(p!=NULL);
1282  return p;
1283  }
1284  }
1285  else
1286 #endif
1287  {
1288  bucket->buckets[i]=pNext(bucket->buckets[i]);
1289  pNext(p)=NULL;
1290  assume(p!=NULL);
1291  return p;
1292  }
1293 }
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:47
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:405
int i
Definition: cfEzgcd.cc:123
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:902
#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
const poly kBucketGetLm ( kBucket_pt  bucket)

Definition at line 484 of file kbuckets.cc.

485 {
486  return bucket->p;
487 }
poly p
Definition: kbuckets.h:181
void kBucketInit ( kBucket_pt  bucket,
poly  lm,
int  length 
)

Definition at line 471 of file kbuckets.cc.

472 {
473  int i;
474 
475  assume(bucket != NULL);
476  assume(length <= 0 || length == pLength(lm));
477 
478  bucket->p = lm;
479  if (length <= 0) bucket->l = pLength(lm);
480  else bucket->l = length;
481 
482 }
static int pLength(poly a)
Definition: p_polys.h:189
#define assume(x)
Definition: mod2.h:405
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int l
Definition: kbuckets.h:182
poly p
Definition: kbuckets.h:181
number kBucketPolyRed ( kBucket_pt  bucket,
poly  p1,
int  l1,
poly  spNoether 
)

Definition at line 1061 of file kbuckets.cc.

1064 {
1065  ring r=bucket->bucket_ring;
1066  assume((!rIsPluralRing(r))||p_LmEqual(p1,kBucketGetLm(bucket), r));
1067  assume(p1 != NULL &&
1068  p_DivisibleBy(p1, kBucketGetLm(bucket), r));
1069  assume(pLength(p1) == (int) l1);
1070 
1071  poly a1 = pNext(p1), lm = kBucketExtractLm(bucket);
1072  BOOLEAN reset_vec=FALSE;
1073  number rn;
1074 
1075  /* we shall reduce bucket=bn*lm+... by p1=an*t+a1 where t=lm(p1)
1076  and an,bn shall be defined further down only if lc(p1)!=1
1077  we already know: an|bn and t|lm */
1078  if(a1==NULL)
1079  {
1080  p_LmDelete(&lm, r);
1081  return n_Init(1,r->cf);
1082  }
1083 
1084  if (! n_IsOne(pGetCoeff(p1),r->cf))
1085  {
1086  number an = pGetCoeff(p1), bn = pGetCoeff(lm);
1087 //StringSetS("##### an = "); nWrite(an); PrintS(StringEndS("\n")); // NOTE/TODO: use StringAppendS("\n"); omFree(s);
1088 //StringSetS("##### bn = "); nWrite(bn); PrintS(StringEndS("\n")); // NOTE/TODO: use StringAppendS("\n"); omFree(s);
1089  /* ksCheckCoeff: divide out gcd from an and bn: */
1090  int ct = ksCheckCoeff(&an, &bn,r->cf);
1091  /* the previous command returns ct=0 or ct=2 iff an!=1
1092  note: an is now 1 or -1 */
1093 
1094  /* setup factor for p1 which cancels leading terms */
1095  p_SetCoeff(lm, bn, r);
1096  if ((ct == 0) || (ct == 2))
1097  {
1098  /* next line used to be here before but is WRONG:
1099  kBucket_Mult_n(bucket, an);
1100  its use would result in a wrong sign for the tail of bucket
1101  in the reduction */
1102 
1103  /* correct factor for cancelation by changing sign if an=-1 */
1104  if (rField_is_Ring(r))
1105  lm = p_Mult_nn(lm, an, r);
1106  else
1107  kBucket_Mult_n(bucket, an);
1108  }
1109  rn = an;
1110  }
1111  else
1112  {
1113  rn = n_Init(1,r->cf);
1114  }
1115 
1116  if (p_GetComp(p1, r) != p_GetComp(lm, r))
1117  {
1118  p_SetCompP(a1, p_GetComp(lm, r), r);
1119  reset_vec = TRUE;
1120  p_SetComp(lm, p_GetComp(p1, r), r);
1121  p_Setm(lm, r);
1122  }
1123 
1124  p_ExpVectorSub(lm, p1, r);
1125  l1--;
1126 
1127  assume(l1==pLength(a1));
1128 #if 0
1129  BOOLEAN backuped=FALSE;
1130  number coef;
1131  //@Viktor, don't ignore coefficients on monomials
1132  if(l1==1) {
1133 
1134  //if (rField_is_Q(r)) {
1135  //avoid this for function fields, as gcds are expensive at the moment
1136 
1137 
1138  coef=p_GetCoeff(a1,r);
1139  lm=p_Mult_nn(lm, coef, r);
1140  p_SetCoeff0(a1, n_Init(1,r), r);
1141  backuped=TRUE;
1142  //WARNING: not thread_safe
1143  //deletes coef as side effect
1144  //}
1145  }
1146 #endif
1147 
1148  kBucket_Minus_m_Mult_p(bucket, lm, a1, &l1, spNoether);
1149 
1150 #if 0
1151  if (backuped)
1152  p_SetCoeff0(a1,coef,r);
1153 #endif
1154 
1155  p_LmDelete(&lm, r);
1156  if (reset_vec) p_SetCompP(a1, 0, r);
1157  kbTest(bucket);
1158  return rn;
1159 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:185
#define FALSE
Definition: auxiliary.h:140
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:469
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
#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:539
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:484
int ksCheckCoeff(number *a, number *b)
#define TRUE
Definition: auxiliary.h:144
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:576
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
static int pLength(poly a)
Definition: p_polys.h:189
poly kBucketExtractLm(kBucket_pt bucket)
Definition: kbuckets.cc:489
const ring r
Definition: syzextra.cc:208
static void p_SetCompP(poly p, int i, ring r)
Definition: p_polys.h:243
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:405
static BOOLEAN p_DivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1685
static void p_ExpVectorSub(poly p1, poly p2, const ring r)
Definition: p_polys.h:1368
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:902
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:698
#define p_LmEqual(p1, p2, r)
Definition: p_polys.h:1519
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:437
#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:436
#define p_GetCoeff(p, r)
Definition: monomials.h:57
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:707
#define p_SetCoeff0(p, n, r)
Definition: monomials.h:68
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:131
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 513 of file kbuckets.cc.

516 {
517 #ifndef HAVE_PSEUDO_BUCKETS
518  int i;
519 
520  kBucketCanonicalize(bucket);
521  for (i=0; i<= bucket->buckets_used; i++)
522  if (bucket->buckets[i] != NULL)
523  {
524  MULTIPLY_BUCKET(bucket,i);
525  bucket->buckets[i] = p_shallow_copy_delete(bucket->buckets[i],
526  bucket->bucket_ring,
527  new_tailRing,
528  new_tailBin);
529  }
530 #else
531  bucket->p = p_shallow_copy_delete(p,
532  bucket_ring,
533  new_tailRing,
534  new_tailBin);
535 #endif
536  bucket->bucket_ring = new_tailRing;
537 }
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:47
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)
void kBucketSimpleContent ( kBucket_pt  )

Definition at line 1162 of file kbuckets.cc.

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

Definition at line 1020 of file kbuckets.cc.

1023 {
1024  poly p = NULL, q;
1025  int i, lp = 0, lq;
1026 
1027 #ifndef HAVE_PSEUDO_BUCKETS
1028  kBucketMergeLm(bucket);
1029  for (i=1; i<=bucket->buckets_used; i++)
1030  {
1031  if (bucket->buckets[i] != NULL)
1032  {
1033  MULTIPLY_BUCKET(bucket,i);
1034  p_TakeOutComp(&(bucket->buckets[i]), comp, &q, &lq, bucket->bucket_ring);
1035  if (q != NULL)
1036  {
1037  assume(pLength(q) == lq);
1038  bucket->buckets_length[i] -= lq;
1039  assume(pLength(bucket->buckets[i]) == bucket->buckets_length[i]);
1040  p = p_Add_q(p, q, lp, lq, bucket->bucket_ring);
1041  }
1042  }
1043  }
1044  kBucketAdjustBucketsUsed(bucket);
1045 #else
1046  p_TakeOutComp(&(bucket->p), comp, &p, &lp,bucket->bucket_ring);
1047  (bucket->l) -= lp;
1048 #endif
1049  *r_p = p;
1050  *l = lp;
1051 
1052  kbTest(bucket);
1053 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:185
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:47
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:3378
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:405
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:884
int l
Definition: cfEzgcd.cc:94
int ksCheckCoeff ( number *  a,
number *  b 
)
int ksCheckCoeff ( number *  a,
number *  b,
const coeffs  r 
)

Definition at line 1306 of file kbuckets.cc.

1307 {
1308  int c = 0;
1309  number an = *a, bn = *b;
1310  n_Test(an,r);
1311  n_Test(bn,r);
1312 
1313  number cn = n_SubringGcd(an, bn, r);
1314 
1315  if(n_IsOne(cn, r))
1316  {
1317  an = n_Copy(an, r);
1318  bn = n_Copy(bn, r);
1319  }
1320  else
1321  {
1322  an = n_Div(an, cn, r); n_Normalize(an,r);
1323  bn = n_Div(bn, cn, r); n_Normalize(bn,r);
1324  }
1325  n_Delete(&cn, r);
1326  if (n_IsOne(an, r))
1327  {
1328  c = 1;
1329  }
1330  if (n_IsOne(bn, r))
1331  {
1332  c += 2;
1333  }
1334  *a = an;
1335  *b = bn;
1336  return c;
1337 }
const poly a
Definition: syzextra.cc:212
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:469
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:579
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:923
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:452
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
Definition: coeffs.h:615
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
Definition: coeffs.h:687
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:456
const poly b
Definition: syzextra.cc:213
void p_TakeOutComp ( poly p,
long  comp,
poly q,
int *  lq,
const ring  r 
)

Definition at line 3378 of file p_polys.cc.

3379 {
3380  spolyrec pp, qq;
3381  poly p, q, p_prev;
3382  int l = 0;
3383 
3384 #ifdef HAVE_ASSUME
3385  int lp = pLength(*r_p);
3386 #endif
3387 
3388  pNext(&pp) = *r_p;
3389  p = *r_p;
3390  p_prev = &pp;
3391  q = &qq;
3392 
3393  while(p != NULL)
3394  {
3395  while (p_GetComp(p,r) == comp)
3396  {
3397  pNext(q) = p;
3398  pIter(q);
3399  p_SetComp(p, 0,r);
3400  p_SetmComp(p,r);
3401  pIter(p);
3402  l++;
3403  if (p == NULL)
3404  {
3405  pNext(p_prev) = NULL;
3406  goto Finish;
3407  }
3408  }
3409  pNext(p_prev) = p;
3410  p_prev = p;
3411  pIter(p);
3412  }
3413 
3414  Finish:
3415  pNext(q) = NULL;
3416  *r_p = pNext(&pp);
3417  *r_q = pNext(&qq);
3418  *lq = l;
3419 #ifdef HAVE_ASSUME
3420  assume(pLength(*r_p) + pLength(*r_q) == lp);
3421 #endif
3422  p_Test(*r_p,r);
3423  p_Test(*r_q,r);
3424 }
return P p
Definition: myNF.cc:203
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
#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:405
#define p_Test(p, r)
Definition: p_polys.h:160
#define p_SetmComp
Definition: p_polys.h:233
#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
unsigned int pLogLength ( unsigned int  l)
inline

Some internal stuff.

Definition at line 59 of file kbuckets.cc.

60 {
61  unsigned int i = 0;
62 
63  if (l == 0) return 0;
64  l--;
65 #ifdef BUCKET_TWO_BASE
66  while ((l = (l >> 1))) i++;
67 #else
68  while ((l = (l >> 2))) i++;
69 #endif
70  return i+1;
71 }
int i
Definition: cfEzgcd.cc:123
int l
Definition: cfEzgcd.cc:94
unsigned int pLogLength ( poly  p)
inline

Definition at line 74 of file kbuckets.cc.

75 {
76  return pLogLength((unsigned int) pLength(p));
77 }
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:59

Variable Documentation

omBin kBucket_bin = omGetSpecBin(sizeof(kBucket))
static

Definition at line 49 of file kbuckets.cc.