Data Structures | Macros | Typedefs | Functions
kbuckets.h File Reference
#include <polys/monomials/ring.h>
#include <polys/templates/p_Procs.h>

Go to the source code of this file.

Data Structures

class  kBucket
 

Macros

#define MAX_BUCKET   14
 Bucket definition (should be no one elses business, though) More...
 

Typedefs

typedef kBucketkBucket_pt
 
typedef polyrec * poly
 

Functions

kBucket_pt kBucketCreate (ring r)
 Creation/Destruction of buckets. More...
 
void kBucketDestroy (kBucket_pt *bucket)
 
void kBucketDeleteAndDestroy (kBucket_pt *bucket)
 
void kBucketInit (kBucket_pt bucket, poly p, int length)
 
void kBucketClear (kBucket_pt bucket, poly *p, int *length)
 
poly kBucketClear (kBucket_pt bucket)
 
int kBucketCanonicalize (kBucket_pt bucket)
 
poly kBucketExtractLm (kBucket_pt bucket)
 
void kBucketSetLm (kBucket_pt bucket, poly lm)
 
void kBucketAdjust (kBucket_pt bucket, int i)
 Bucket number i from bucket is out of length sync, resync. More...
 
number kBucketPolyRed (kBucket_pt bucket, poly p, int l, poly spNoether)
 
void kBucketTakeOutComp (kBucket_pt bucket, long comp, poly *p, int *l)
 
void kBucket_Mult_n (kBucket_pt bucket, number n)
 Multiply Bucket by number ,i.e. Bpoly == n*Bpoly. 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 kBucket_Add_q (kBucket_pt bucket, poly q, int *lq)
 Add to Bucket a poly ,i.e. Bpoly == Bpoly + q. More...
 
poly kBucket_ExtractLarger_Add_q (kBucket_pt bucket, poly append, poly q, int *lq)
 
void kBucket_Minus_m_Mult_p (kBucket_pt bucket, poly m, poly p, int *l, poly spNother=NULL)
 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) 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...
 
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...
 
BOOLEAN kbTest (kBucket_pt bucket)
 Tests. More...
 
poly kBucketGetLm (kBucket_pt bucket, p_kBucketSetLm_Proc_Ptr _p_kBucketSetLm)
 
poly kBucketGetLm (kBucket_pt bucket)
 
poly kBucketExtractLmOfBucket (kBucket_pt bucket, int i)
 
void kBucketSimpleContent (kBucket_pt bucket)
 
BOOLEAN kBucketIsCleared (kBucket_pt bucket)
 
int ksCheckCoeff (number *a, number *b, const coeffs r)
 

Data Structure Documentation

class kBucket

Definition at line 177 of file kbuckets.h.

Data Fields
ring bucket_ring
int l
poly p

Macro Definition Documentation

#define MAX_BUCKET   14

Bucket definition (should be no one elses business, though)

Definition at line 174 of file kbuckets.h.

Typedef Documentation

typedef kBucket* kBucket_pt

Definition at line 15 of file kbuckets.h.

typedef polyrec* poly

Definition at line 16 of file kbuckets.h.

Function Documentation

BOOLEAN kbTest ( kBucket_pt  bucket)

Tests.

Definition at line 186 of file kbuckets.cc.

187 {
188  return TRUE;
189 }
#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 == Bpoly + q.

Add to Bucket a poly ,i.e. Bpoly == Bpoly + q.

Definition at line 637 of file kbuckets.cc.

638 {
639  if (q == NULL) return;
640  assume(*l <= 0 || pLength(q) == *l);
641 
642  int i, l1;
643  ring r = bucket->bucket_ring;
644 
645  if (*l <= 0)
646  {
647  l1 = pLength(q);
648  *l = l1;
649  }
650  else
651  l1 = *l;
652 
653  kBucketMergeLm(bucket);
654  kbTest(bucket);
655  i = pLogLength(l1);
656 
657  while (bucket->buckets[i] != NULL)
658  {
659  //MULTIPLY_BUCKET(bucket,i);
660  #ifdef USE_COEF_BUCKETS
661  if (bucket->coef[i]!=NULL)
662  {
663  q = p_Plus_mm_Mult_qq(q, bucket->coef[i], bucket->buckets[i],
664  l1, bucket->buckets_length[i], r);
665  p_Delete(&bucket->coef[i],r);
666  p_Delete(&bucket->buckets[i],r);
667  }
668  else
669  q = p_Add_q(q, bucket->buckets[i],
670  l1, bucket->buckets_length[i], r);
671  #else
672  q = p_Add_q(q, bucket->buckets[i],
673  l1, bucket->buckets_length[i], r);
674  #endif
675  bucket->buckets[i] = NULL;
676  bucket->buckets_length[i] = 0;
677  i = pLogLength(l1);
678  assume(i<= MAX_BUCKET);
679  assume(bucket->buckets_used<= MAX_BUCKET);
680  }
681 
682  kbTest(bucket);
683  bucket->buckets[i] = q;
684  bucket->buckets_length[i]=l1;
685  if (i >= bucket->buckets_used)
686  bucket->buckets_used = i;
687  else
688  kBucketAdjustBucketsUsed(bucket);
689  kbTest(bucket);
690 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:186
#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:60
#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 989 of file kbuckets.cc.

990 {
991  if (q == NULL) return append;
992  poly lm;
993  loop
994  {
995  lm = kBucketGetLm(bucket);
996  if (lm == NULL) return append;
997  if (p_LmCmp(lm, q, bucket->bucket_ring) == 1)
998  {
999  lm = kBucketExtractLm(bucket);
1000  pNext(append) = lm;
1001  pIter(append);
1002  }
1003  else
1004  {
1005  return append;
1006  }
1007  }
1008 }
CFFList append(const CFFList &Inputlist, const CFFactor &TheFactor)
loop
Definition: myNF.cc:98
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:485
poly kBucketExtractLm(kBucket_pt bucket)
Definition: kbuckets.cc:490
#define pIter(p)
Definition: monomials.h:44
ring bucket_ring
Definition: kbuckets.h:191
polyrec * poly
Definition: hilb.h:10
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
poly kBucket_ExtractLarger_Add_q ( kBucket_pt  bucket,
poly  append,
poly  q,
int lq 
)
inline

Definition at line 121 of file kbuckets.h.

122 {
123  append = kBucket_ExtractLarger(bucket, q, append);
124  kBucket_Add_q(bucket, q, lq);
125  return append;
126 }
CFFList append(const CFFList &Inputlist, const CFFactor &TheFactor)
void kBucket_Add_q(kBucket_pt bucket, poly q, int *lq)
Add to Bucket a poly ,i.e. Bpoly == Bpoly + q.
Definition: kbuckets.cc:637
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 monom...
Definition: kbuckets.cc:989
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 (TODO: rename into kBucket_Minus_mm_Mult_pp!?) 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 699 of file kbuckets.cc.

701 {
702  assume(*l <= 0 || pLength(p) == *l);
703  int i, l1;
704  poly p1 = p;
705  ring r = bucket->bucket_ring;
706 
707  if (*l <= 0)
708  {
709  l1 = pLength(p1);
710  *l = l1;
711  }
712  else
713  l1 = *l;
714 
715  if (m == NULL || p == NULL) return;
716 
717 #ifndef HAVE_PSEUDO_BUCKETS
718  kBucketMergeLm(bucket);
719  kbTest(bucket);
720  i = pLogLength(l1);
721 
722 #if defined(HAVE_RINGS)||defined(HAVE_PLURAL)
723  if ((rField_is_Ring(r) && !(rField_is_Domain(r)))
724  ||(rIsPluralRing(r)))
725  {
726  pSetCoeff0(m, n_InpNeg(pGetCoeff(m),r->cf));
727  p1=pp_Mult_mm(p,m,r);
728  pSetCoeff0(m, n_InpNeg(pGetCoeff(m),r->cf));
729  l1=pLength(p1);
730  i = pLogLength(l1);
731  }
732  else
733 #endif
734  {
735  if ((i <= bucket->buckets_used) && (bucket->buckets[i] != NULL))
736  {
737  assume(pLength(bucket->buckets[i])==bucket->buckets_length[i]);
738 //#ifdef USE_COEF_BUCKETS
739 // if(bucket->coef[i]!=NULL)
740 // {
741 // poly mult=p_Mult_mm(bucket->coef[i],m,r);
742 // bucket->coef[i]=NULL;
743 // p1 = p_Minus_mm_Mult_qq(bucket->buckets[i], mult, p1,
744 // bucket->buckets_length[i], l1,
745 // spNoether, r);
746 // }
747 // else
748 //#endif
749  MULTIPLY_BUCKET(bucket,i);
750  p1 = p_Minus_mm_Mult_qq(bucket->buckets[i], m, p1,
751  bucket->buckets_length[i], l1,
752  spNoether, r);
753  l1 = bucket->buckets_length[i];
754  bucket->buckets[i] = NULL;
755  bucket->buckets_length[i] = 0;
756  i = pLogLength(l1);
757  }
758  else
759  {
760  pSetCoeff0(m, n_InpNeg(pGetCoeff(m),r->cf));
761  if (spNoether != NULL)
762  {
763  l1 = -1;
764  p1 = r->p_Procs->pp_Mult_mm_Noether(p1, m, spNoether, l1, r);
765  i = pLogLength(l1);
766  }
767  else
768  {
769  p1 = r->p_Procs->pp_Mult_mm(p1, m, r);
770  }
771  pSetCoeff0(m, n_InpNeg(pGetCoeff(m),r->cf));
772  }
773  }
774 
775  while (bucket->buckets[i] != NULL)
776  {
777  //kbTest(bucket);
778  MULTIPLY_BUCKET(bucket,i);
779  p1 = p_Add_q(p1, bucket->buckets[i],
780  l1, bucket->buckets_length[i], r);
781  bucket->buckets[i] = NULL;
782  bucket->buckets_length[i] = 0;
783  i = pLogLength(l1);
784  }
785 
786  bucket->buckets[i] = p1;
787  bucket->buckets_length[i]=l1;
788  if (i >= bucket->buckets_used)
789  bucket->buckets_used = i;
790  else
791  kBucketAdjustBucketsUsed(bucket);
792 #else // HAVE_PSEUDO_BUCKETS
793  bucket->p = p_Minus_mm_Mult_qq(bucket->p, m, p,
794  bucket->l, l1,
795  spNoether, r);
796 #endif
797 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:186
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:48
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:431
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:355
static int pLength(poly a)
Definition: p_polys.h:189
const ring r
Definition: syzextra.cc:208
ring bucket_ring
Definition: kbuckets.h:191
polyrec * poly
Definition: hilb.h:10
#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:556
int i
Definition: cfEzgcd.cc:123
unsigned int pLogLength(unsigned int l)
Some internal stuff.
Definition: kbuckets.cc:60
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:428
#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
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 577 of file kbuckets.cc.

578 {
579 #ifndef HAVE_PSEUDO_BUCKETS
580  kbTest(bucket);
581  ring r=bucket->bucket_ring;
582  int i;
583 
584  for (i=0; i<= bucket->buckets_used; i++)
585  {
586  if (bucket->buckets[i] != NULL)
587  {
588 #ifdef USE_COEF_BUCKETS
589  if (i<coef_start)
590  bucket->buckets[i] = p_Mult_nn(bucket->buckets[i], n, r);
591 #ifdef HAVE_RINGS
592  /* Frank Seelisch on March 11, 2010:
593  This looks a bit strange: The following "if" is indented
594  like the previous line of code. But coded as it is,
595  it should actually be two spaces less indented.
596  Question: Should the following "if" also only be
597  performed when "(i<coef_start)" is true?
598  For the time being, I leave it as it is. */
599  if (rField_is_Ring(r) && !(rField_is_Domain(r)))
600  {
601  bucket->buckets_length[i] = pLength(bucket->buckets[i]);
602  kBucketAdjust(bucket, i);
603  }
604 #endif
605  else
606  if (bucket->coef[i]!=NULL)
607  {
608  bucket->coef[i] = p_Mult_nn(bucket->coef[i],n,r);
609  }
610  else
611  {
612  bucket->coef[i] = p_NSet(n_Copy(n,r),r);
613  }
614 #else
615  bucket->buckets[i] = p_Mult_nn(bucket->buckets[i], n, r);
616 #ifdef HAVE_RINGS
617  if (rField_is_Ring(r) && !(rField_is_Domain(r)))
618  {
619  bucket->buckets_length[i] = pLength(bucket->buckets[i]);
620  kBucketAdjust(bucket, i);
621  }
622 #endif
623 #endif
624  }
625  }
626  kbTest(bucket);
627 #else
628  bucket->p = p_Mult_nn(bucket->p, n, bucket->bucket_ring);
629 #endif
630 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:186
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:431
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:544
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:428
#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:451
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 804 of file kbuckets.cc.

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

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

Definition at line 500 of file kbuckets.cc.

501 {
502  assume(pLength(bucket->p) == bucket->l);
503  *p = bucket->p;
504  *length = bucket->l;
505  bucket->p = NULL;
506  bucket->l = 0;
507 }
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
poly kBucketClear ( kBucket_pt  bucket)
inline

Definition at line 44 of file kbuckets.h.

45 {
46  int dummy;
47  poly p;
48  kBucketClear(bucket, &p, &dummy);
49  return p;
50 }
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:500
return P p
Definition: myNF.cc:203
polyrec * poly
Definition: hilb.h:10
kBucket_pt kBucketCreate ( ring  r)

Creation/Destruction of buckets.

Definition at line 198 of file kbuckets.cc.

199 {
200  assume(bucket_ring != NULL);
202  bucket->bucket_ring = bucket_ring;
203  return bucket;
204 }
static omBin kBucket_bin
Definition: kbuckets.cc:50
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)

Definition at line 212 of file kbuckets.cc.

213 {
214  kBucket_pt bucket = *bucket_pt;
215  kbTest(bucket);
216  int i;
217  for (i=0; i<= bucket->buckets_used; i++)
218  {
219 
220  if (bucket->buckets[i] != NULL)
221  {
222  p_Delete(&(bucket->buckets[i]), bucket->bucket_ring);
223 #ifdef USE_COEF_BUCKETS
224  if (bucket->coef[i]!=NULL)
225  p_Delete(&(bucket->coef[i]), bucket->bucket_ring);
226 #endif
227  }
228  }
229  omFreeBin(bucket, kBucket_bin);
230  *bucket_pt = NULL;
231 }
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:186
static omBin kBucket_bin
Definition: kbuckets.cc:50
ring bucket_ring
Definition: kbuckets.h:191
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)

Definition at line 205 of file kbuckets.cc.

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

Definition at line 230 of file kbuckets.h.

231 {
232  poly lm = kBucketGetLm(bucket);
233  #ifdef HAVE_COEF_BUCKETS
234  assume(bucket->coef[0]==NULL);
235  #endif
236  bucket->buckets[0] = NULL;
237  bucket->buckets_length[0] = 0;
238 
239  return lm;
240 }
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
poly kBucketGetLm(kBucket_pt bucket, p_kBucketSetLm_Proc_Ptr _p_kBucketSetLm)
Definition: kbuckets.h:207
#define NULL
Definition: omList.c:10
poly kBucketExtractLmOfBucket ( kBucket_pt  bucket,
int  i 
)

Definition at line 1260 of file kbuckets.cc.

1261 {
1262  assume(bucket->buckets[i]!=NULL);
1263 
1264  poly p=bucket->buckets[i];
1265  bucket->buckets_length[i]--;
1266 #ifdef USE_COEF_BUCKETS
1267  ring r=bucket->bucket_ring;
1268  if (bucket->coef[i]!=NULL)
1269  {
1270  poly next=pNext(p);
1271  if (next==NULL)
1272  {
1273  MULTIPLY_BUCKET(bucket,i);
1274  p=bucket->buckets[i];
1275  bucket->buckets[i]=NULL;
1276  return p;
1277  }
1278  else
1279  {
1280  bucket->buckets[i]=next;
1281  number c=p_GetCoeff(bucket->coef[i],r);
1282  pNext(p)=NULL;
1283  p=p_Mult_nn(p,c,r);
1284  assume(p!=NULL);
1285  return p;
1286  }
1287  }
1288  else
1289 #endif
1290  {
1291  bucket->buckets[i]=pNext(bucket->buckets[i]);
1292  pNext(p)=NULL;
1293  assume(p!=NULL);
1294  return p;
1295  }
1296 }
#define MULTIPLY_BUCKET(B, I)
Definition: kbuckets.cc:48
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
ring bucket_ring
Definition: kbuckets.h:191
polyrec * poly
Definition: hilb.h:10
#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
ListNode * next
Definition: janet.h:31
poly kBucketGetLm ( kBucket_pt  bucket,
p_kBucketSetLm_Proc_Ptr  _p_kBucketSetLm 
)
inline

Definition at line 207 of file kbuckets.h.

208 {
209 #ifdef HAVE_COEF_BUCKETS
210  assume(bucket->coef[0]==NULL);
211 #endif
212 
213  poly& lead = bucket->buckets[0];
214 
215  if (lead == NULL)
216  _p_kBucketSetLm(bucket);
217 
218 #ifdef HAVE_COEF_BUCKETS
219  assume(bucket->coef[0]==NULL);
220 #endif
221 
222  return lead;
223 }
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
poly kBucketGetLm ( kBucket_pt  bucket)
inline

Definition at line 225 of file kbuckets.h.

226 {
227  return kBucketGetLm(bucket, bucket->bucket_ring->p_Procs->p_kBucketSetLm); // TODO: needs ring :(
228 }
ring bucket_ring
Definition: kbuckets.h:191
poly kBucketGetLm(kBucket_pt bucket, p_kBucketSetLm_Proc_Ptr _p_kBucketSetLm)
Definition: kbuckets.h:207
void kBucketInit ( kBucket_pt  bucket,
poly  p,
int  length 
)

Definition at line 472 of file kbuckets.cc.

473 {
474  int i;
475 
476  assume(bucket != NULL);
477  assume(length <= 0 || length == pLength(lm));
478 
479  bucket->p = lm;
480  if (length <= 0) bucket->l = pLength(lm);
481  else bucket->l = length;
482 
483 }
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
BOOLEAN kBucketIsCleared ( kBucket_pt  bucket)
number kBucketPolyRed ( kBucket_pt  bucket,
poly  p,
int  l,
poly  spNoether 
)

Definition at line 1064 of file kbuckets.cc.

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

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

Definition at line 1165 of file kbuckets.cc.

1165 {}
void kBucketTakeOutComp ( kBucket_pt  bucket,
long  comp,
poly p,
int l 
)

Definition at line 1023 of file kbuckets.cc.

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

Definition at line 1309 of file kbuckets.cc.

1310 {
1311  int c = 0;
1312  number an = *a, bn = *b;
1313  n_Test(an,r);
1314  n_Test(bn,r);
1315 
1316  number cn = n_SubringGcd(an, bn, r);
1317 
1318  if(n_IsOne(cn, r))
1319  {
1320  an = n_Copy(an, r);
1321  bn = n_Copy(bn, r);
1322  }
1323  else
1324  {
1325  an = n_Div(an, cn, r); n_Normalize(an,r);
1326  bn = n_Div(bn, cn, r); n_Normalize(bn,r);
1327  }
1328  n_Delete(&cn, r);
1329  if (n_IsOne(an, r))
1330  {
1331  c = 1;
1332  }
1333  if (n_IsOne(bn, r))
1334  {
1335  c += 2;
1336  }
1337  *a = an;
1338  *b = bn;
1339  return c;
1340 }
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:468
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:577
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:918
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:451
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:613
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
Definition: coeffs.h:685
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
const poly b
Definition: syzextra.cc:213