22 #define EXT_POLY_NEW 0 52 #define ENTER_USE_MEMMOVE 92 #ifdef ENTER_USE_MYMEMMOVE 93 inline void _my_memmove_d_gt_s(
unsigned long* d,
unsigned long*
s,
long l)
95 register unsigned long* _dl = (
unsigned long*) d;
96 register unsigned long* _sl = (
unsigned long*) s;
97 register long _i = l - 1;
107 inline void _my_memmove_d_lt_s(
unsigned long* d,
unsigned long*
s,
long l)
109 register long _ll =
l;
110 register unsigned long* _dl = (
unsigned long*) d;
111 register unsigned long* _sl = (
unsigned long*)
s;
112 register long _i = 0;
122 inline void _my_memmove(
void* d,
void*
s,
long l)
124 unsigned long _d = (
unsigned long) d;
125 unsigned long _s = (
unsigned long)
s;
126 unsigned long _l = ((
l) + SIZEOF_LONG - 1) >> LOG_SIZEOF_LONG;
128 if (_d > _s) _my_memmove_d_gt_s(_d, _s, _l);
129 else _my_memmove_d_lt_s(_d, _s, _l);
133 #define memmove(d,s,l) _my_memmove(d, s, l) 140 #define pDivComp_EQUAL 2 141 #define pDivComp_LESS 1 142 #define pDivComp_GREATER -1 143 #define pDivComp_INCOMP 0 155 unsigned long la, lb;
156 unsigned long divmask =
currRing->divmask;
157 for (i=0; i<
currRing->VarL_Size; i++)
166 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
173 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
203 unsigned long la, lb;
204 unsigned long divmask =
currRing->divmask;
205 for (i=0; i<
currRing->VarL_Size; i++)
214 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
221 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
228 if (b) {
return -1; }
249 poly p = L->GetLmTailRing();
252 if (L->bucket !=
NULL)
290 L->ecart = L->pLDeg() - L->GetpFDeg();
299 L->ecart = L->pLDeg(strat->
LDegLast) - L->GetpFDeg();
341 ring
r = L->tailRing;
342 poly p = L->GetLmTailRing();
347 printf(
"\n cancelunit\n");
374 number eins=
nCopy(lc);
404 if (i == r->N)
break;
415 printf(
"\nDoes not divide\n");
420 printf(
"\nDivides. Go On\n");
434 number eins=
nInit(1);
464 if (i == r->N)
break;
522 inline static unsigned long*
initsevS (
const int maxnr)
524 return (
unsigned long*)
omAlloc0(maxnr*
sizeof(
unsigned long));
528 return (
int*)
omAlloc0(maxnr*
sizeof(
int));
532 int &length,
const int incr)
537 assume((length+incr) > 0);
541 (length+incr)*
sizeof(
TObject));
543 sevT = (
unsigned long*)
omReallocSize(sevT, length*
sizeof(
long*),
544 (length+incr)*
sizeof(
long*));
547 (length+incr)*
sizeof(
TObject*));
548 for (i=length-1;i>=0;i--) R[T[i].i_r] = &(T[i]);
562 for (j=0; j<=strat->
tl; j++)
566 if (strat->
T[j].max !=
NULL)
576 if (strat->
T[j].t_p !=
NULL)
587 if (p == strat->
S[i])
589 if (strat->
T[j].t_p !=
NULL)
613 for (j=0; j<=strat->
tl; j++)
617 if (strat->
T[j].max !=
NULL)
627 if (strat->
T[j].t_p !=
NULL)
639 if (p == strat->
S[i])
641 if (strat->
T[j].t_p !=
NULL)
665 assume(((*length)+incr)>0);
668 ((*length)+incr)*
sizeof(
LObject));
688 if ((*k) < 0)
return FALSE;
689 if (((p1 == (*p).p1) && (p2 == (*p).p2))
690 || ((p1 == (*p).p2) && (p2 == (*p).p1)))
709 if ((*k) < 0)
return FALSE;
721 for (i=0; i<=tlength; i++)
723 if (T[i].p == p)
return i;
734 if (i >= 0)
return i;
737 while (strat !=
NULL);
750 #define kFalseReturn(x) do { if (!x) return FALSE;} while (0) 756 for (i=1; i<=tailRing->N; i++)
759 return "Lm[i] different";
762 return "Lm[0] different";
764 return "Lm.next different";
766 return "Lm.coeff different";
775 r_assume(strat_tailRing == tailRing);
785 if (
T->t_p ==
NULL &&
i > 0)
791 const char* msg = kTest_LmEqual(
T->p,
T->t_p,
T->tailRing);
802 if (
T->t_p !=
NULL &&
i >= 0 && TN ==
'T')
807 return dReportError(
"%c[%d].max is not NULL as it should be", TN,
i);
823 p_Setm(test_max, tailRing);
835 if (
T->p ==
NULL &&
i > 0)
840 if ((
i >= 0) && (
T->pLength != 0)
845 return dReportError(
"%c[%d] pLength error: has %d, specified to have %d",
850 if (
i >= 0 && (TN ==
'T' || TN ==
'L'))
853 if (
T->FDeg !=
T->pFDeg())
857 return dReportError(
"%c[%d] FDeg error: has %d, specified to have %d",
858 TN,
i ,
T->pFDeg(), d);
863 if (
i >= 0 && TN ==
'T')
878 if (L->bucket !=
NULL)
880 kFalseReturn(
kbTest(L->bucket));
881 r_assume(L->bucket->bucket_ring == L->tailRing);
888 kFalseReturn(
kTest_T(L, strat_tailRing, lpos,
'L'));
897 return dReportError(
"L[%d] wrong sev: has %o, specified to have %o",
906 else if (tlength > 0 &&
T !=
NULL && (lpos >=0))
926 -1, strat->
T, strat->
tl));
929 if (strat->
T !=
NULL)
931 for (i=0; i<=strat->
tl; i++)
940 if (strat->
L !=
NULL)
942 for (i=0; i<=strat->
Ll; i++)
945 strat->
L[i].Next() != strat->
tail,
i,
946 strat->
T, strat->
tl));
957 if (strat->
S !=
NULL)
967 for (i=0; i<=strat->
sl; i++)
969 if (strat->
S[i] !=
NULL &&
972 return dReportError(
"S[%d] wrong sev: has %o, specified to have %o",
985 kFalseReturn(
kTest(strat));
988 for (i=0; i<=strat->
tl; i++)
990 if (strat->
T[i].i_r < 0 || strat->
T[i].i_r > strat->
tl)
991 return dReportError(
"strat->T[%d].i_r == %d out of bounds", i,
993 if (strat->
R[strat->
T[i].i_r] != &(strat->
T[i]))
997 if (strat->
S !=
NULL)
999 for (i=0; i<=strat->
sl; i++)
1004 if (strat->
S_2_R[i] != strat->
T[j].i_r)
1006 i, strat->
S_2_R[i], j, strat->
T[j].i_r);
1010 for (i=0; i<=strat->
Ll; i++)
1012 if (strat->
L[i].p1 !=
NULL && strat->
L[i].p2)
1014 if (strat->
L[i].i_r1 < 0 ||
1015 strat->
L[i].i_r1 > strat->
tl ||
1016 strat->
L[i].T_1(strat)->p != strat->
L[
i].p1)
1018 if (strat->
L[i].i_r2 < 0 ||
1019 strat->
L[i].i_r2 > strat->
tl ||
1020 strat->
L[i].T_2(strat)->p != strat->
L[
i].p2)
1025 if (strat->
L[i].i_r1 != -1)
1027 if (strat->
L[i].i_r2 != -1)
1030 if (strat->
L[i].i_r != -1)
1043 #ifdef ENTER_USE_MEMMOVE 1044 memmove(&(strat->
S[i]), &(strat->
S[i+1]), (strat->
sl - i)*
sizeof(
poly));
1045 memmove(&(strat->
ecartS[i]),&(strat->
ecartS[i+1]),(strat->
sl - i)*
sizeof(
int));
1046 memmove(&(strat->
sevS[i]),&(strat->
sevS[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1047 memmove(&(strat->
S_2_R[i]),&(strat->
S_2_R[i+1]),(strat->
sl - i)*
sizeof(
int));
1050 for (j=i; j<strat->
sl; j++)
1052 strat->
S[
j] = strat->
S[j+1];
1060 #ifdef ENTER_USE_MEMMOVE 1061 memmove(&(strat->
lenS[i]),&(strat->
lenS[i+1]),(strat->
sl - i)*
sizeof(
int));
1063 for (j=i; j<strat->
sl; j++) strat->
lenS[j] = strat->
lenS[j+1];
1068 #ifdef ENTER_USE_MEMMOVE 1071 for (j=i; j<strat->
sl; j++) strat->
lenSw[j] = strat->
lenSw[j+1];
1076 #ifdef ENTER_USE_MEMMOVE 1077 memmove(&(strat->
fromQ[i]),&(strat->
fromQ[i+1]),(strat->
sl - i)*
sizeof(
int));
1079 for (j=i; j<strat->
sl; j++)
1095 #ifdef ENTER_USE_MEMMOVE 1096 memmove(&(strat->
S[i]), &(strat->
S[i+1]), (strat->
sl - i)*
sizeof(
poly));
1097 memmove(&(strat->
sig[i]), &(strat->
sig[i+1]), (strat->
sl - i)*
sizeof(
poly));
1098 memmove(&(strat->
ecartS[i]),&(strat->
ecartS[i+1]),(strat->
sl - i)*
sizeof(
int));
1099 memmove(&(strat->
sevS[i]),&(strat->
sevS[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1100 memmove(&(strat->
sevSig[i]),&(strat->
sevSig[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1101 memmove(&(strat->
S_2_R[i]),&(strat->
S_2_R[i+1]),(strat->
sl - i)*
sizeof(
int));
1104 for (j=i; j<strat->
sl; j++)
1106 strat->
S[
j] = strat->
S[j+1];
1107 strat->
sig[
j] = strat->
sig[j+1];
1116 #ifdef ENTER_USE_MEMMOVE 1117 memmove(&(strat->
lenS[i]),&(strat->
lenS[i+1]),(strat->
sl - i)*
sizeof(
int));
1119 for (j=i; j<strat->
sl; j++) strat->
lenS[j] = strat->
lenS[j+1];
1124 #ifdef ENTER_USE_MEMMOVE 1127 for (j=i; j<strat->
sl; j++) strat->
lenSw[j] = strat->
lenSw[j+1];
1132 #ifdef ENTER_USE_MEMMOVE 1133 memmove(&(strat->
fromQ[i]),&(strat->
fromQ[i+1]),(strat->
sl - i)*
sizeof(
int));
1135 for (j=i; j<strat->
sl; j++)
1191 if (*length > 0 && j < *length)
1193 #ifdef ENTER_USE_MEMMOVE 1194 memmove(&(
set[j]), &(
set[j+1]), (*length - j)*
sizeof(
LObject));
1197 for (i=j; i < (*length); i++)
1202 memset(&(
set[*length]),0,
sizeof(
LObject));
1213 assume(p.FDeg == p.pFDeg());
1218 if (at <= (*length))
1220 memmove(&((*
set)[at+1]), &((*set)[at]), ((*length)-at+1)*
sizeof(
LObject));
1222 for (
i=(*length)+1;
i>=at+1;
i--) (*
set)[
i] = (*set)[
i-1];
1236 h->FDeg = h->pFDeg();
1237 h->ecart = h->pLDeg() - h->FDeg;
1239 h->length=h->pLength=
pLength(h->p);
1244 h->FDeg = h->pFDeg();
1246 h->length=h->pLength=
pLength(h->p);
1251 Lp->FDeg = Lp->pFDeg();
1258 Lp->FDeg = Lp->pFDeg();
1259 (*Lp).ecart =
si_max(ecartF,ecartG);
1260 (*Lp).ecart = (*Lp).ecart- (Lp->FDeg -
p_FDeg((*Lp).lcm,
currRing));
1269 return (ecart1 <= ecart2);
1300 int l,
j,compare,compareCoeff;
1304 h.ecart=0; h.length=0;
1316 pLcm(p,strat->
S[i],h.lcm);
1325 for(j = strat->
Bl;j>=0;j--)
1330 printf(
"\nChainCrit in enteronepairring\n");
1336 printf(
"\nh - neue Paar\n");
1341 printf(
"\ncompare = %i\ncompareCoeff = %i\n",compare,compareCoeff);
1348 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1351 printf(
"\nGelöscht h\n");
1362 printf(
"\nGelöscht: B[j]\n");
1369 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1372 printf(
"\nGelöscht h\n");
1385 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1388 printf(
"\nGelöscht h\n");
1399 printf(
"\nGelöscht: B[j]\n");
1409 printf(
"\nTrying to add spair S[%i] und p\n",i);
pWrite(strat->
S[i]);
pWrite(p);
1478 printf(
"\nThis is afterwards:\n");
1481 h.i_r1 = -1;h.i_r2 = -1;
1491 h.i_r2 = strat->
S_2_R[
i];
1497 posx = strat->
posInL(strat->
B,strat->
Bl,&h,strat);
1502 printf(
"\nThis s-poly was added to B:\n");
pWrite(h.p);
pWrite(h.p1);
pWrite(h.p2);printf(
"\ni_r1 = %i, i_r2 = %i\n",h.i_r1, h.i_r2);
pWrite(strat->
T[h.i_r1].p);
pWrite(strat->
T[h.i_r2].p);
1573 PrintS(
"\n--- create strong gcd poly: ");
1574 Print(
"\n p: %d", i);
1576 Print(
"\n strat->S[%d]: ", i);
1600 h.i_r1 = -1;h.i_r2 = -1;
1606 h.p1 =
p;h.p2 = strat->
S[
i];
1610 h.i_r2 = strat->
S_2_R[
i];
1621 posx = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
1626 if(h.IsNull())
return FALSE;
1640 printf(
"\nThis strong poly was added to L:\n");
pWrite(h.p);
pWrite(h.p1);
pWrite(h.p2);
1647 if(strat->
sl < 0)
return FALSE;
1649 for(i=0;i<strat->
sl;i++)
1675 if(pairsig!=
NULL &&
pLtCmp(pairsig,h->sig) == 0)
1678 printf(
"\nCan replace * (sig = *) with * (sig = *) since of * with sig *\n");
1690 h->i_r1 = -1;h->i_r2 = -1;
1760 PrintS(
"\n--- create strong gcd poly: ");
1761 Print(
"\n p: %d", i);
1763 Print(
"\n strat->S[%d]: ", i);
1787 if(
pLmCmp(pSigMult,sSigMult) == 0)
1796 if(
pLtCmp(pSigMult,sSigMult)==1)
1816 h.i_r1 = -1;h.i_r2 = -1;
1822 printf(
"\nPossible sigdrop in enterpairstrongSig (due to lost of sig)\n");
1827 int red_result =
redRing(&h,strat);
1829 printf(
"\nAfter redRing reduce:\n");
pWrite(h.p);
1835 printf(
"\nCancel the sigdrop. It reduced to 0\n");
1844 printf(
"\nSigdrop. end\n");
1846 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1848 strat->
enterS(h,0,strat,strat->
tl);
1855 h.sig =
pNeg(h.sig);
1862 printf(
"\nSigDrop in enteronestrongpolySig\n");
1869 int red_result =
redRing(&h,strat);
1874 printf(
"\nCancel the sigdrop after redRing (=0)\n");
1883 printf(
"\nAfter redRing still sigdrop:\n");
pWrite(h.p);
1885 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1888 strat->
enterS(h,0,strat, strat->
tl+1);
1900 printf(
"\nSigDrop in strongpair\noriginals: ");
pWrite(sig);
pWrite(strat->
sig[i]);
1901 printf(
"\nnow: ");
pWrite(pairsig);
1905 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1906 strat->
enterS(h,strat->
sl+1,strat,strat->
tl+1);
1909 h.p1 =
p;h.p2 = strat->
S[
i];
1913 h.i_r2 = strat->
S_2_R[
i];
1943 Lp.ecart=0; Lp.length=0;
1948 #ifndef HAVE_RATGRING 1949 pLcm(p,strat->
S[i],Lp.lcm);
1950 #elif defined(HAVE_RATGRING) 1954 pLcm(p,strat->
S[i],Lp.lcm);
1961 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
2003 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2008 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2065 for(j = strat->
Bl;j>=0;j--)
2067 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2071 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2097 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2164 Lp.p1 = strat->
S[
i];
2178 Lp.i_r1 = strat->
S_2_R[
i];
2194 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2229 Lp.ecart=0; Lp.length=0;
2234 pLcm(p,strat->
S[i],Lp.lcm);
2239 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
2281 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2286 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2339 for(j = strat->
Bl;j>=0;j--)
2341 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2345 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2370 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2398 Lp.p1 = strat->
S[
i];
2405 Lp.i_r1 = strat->
S_2_R[
i];
2420 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2444 unsigned long pSigMultNegSev,sSigMultNegSev;
2448 Lp.ecart=0; Lp.length=0;
2453 #ifndef HAVE_RATGRING 2454 pLcm(p,strat->
S[i],Lp.lcm);
2455 #elif defined(HAVE_RATGRING) 2483 PrintS(
"----------------\n");
2486 PrintS(
"----------------\n");
2492 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2514 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2515 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2516 || strat->
rewCrit1(sSigMult,sSigMultNegSev,Lp.lcm,strat,i+1)
2540 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2594 Lp.sevSig = ~pSigMultNegSev;
2601 Lp.sevSig = ~sSigMultNegSev;
2612 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
2627 Lp.checked = strat->
sl+1;
2634 Lp.prod_crit =
TRUE;
2647 PrintS(
"SIGNATURE OF PAIR: ");
2651 Lp.p1 = strat->
S[
i];
2665 Lp.i_r1 = strat->
S_2_R[
i];
2694 printf(
"\nTrying to add p and S[%i]\n",i);
2724 unsigned long pSigMultNegSev,sSigMultNegSev;
2728 Lp.ecart=0; Lp.length=0;
2733 #ifndef HAVE_RATGRING 2734 pLcm(p,strat->
S[i],Lp.lcm);
2735 #elif defined(HAVE_RATGRING) 2751 printf(
"\nIn Spoly: m1, m2 :\n");
pWrite(m1);
pWrite(m2);
2772 if(pSigMult !=
NULL)
2775 if(sSigMult !=
NULL)
2779 Print(
"----------------\n");
2782 Print(
"----------------\n");
2786 if(pSigMult !=
NULL && sSigMult !=
NULL)
2795 if(pSigMult ==
NULL)
2797 if(sSigMult ==
NULL)
2807 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2817 printf(
"\nPossible sigdrop in enterpairSig (due to lost of sig)\n");
2832 int red_result =
redRing(&Lp,strat);
2834 printf(
"\nAfter redRing reduce:\n");
pWrite(Lp.p);
2840 printf(
"\nCancel the sigdrop. It reduced to 0\n");
2849 printf(
"\nSigdrop. end\n");
2851 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
2853 strat->
enterS(Lp,0,strat,strat->
tl);
2867 Lp.sig =
pCopy(pSigMult);
2897 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2898 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2904 printf(
"\nDELETED!\n");
2927 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2984 Lp.sig =
pNeg(Lp.sig);
2995 Lp.sevSig = ~pSigMultNegSev;
3002 Lp.sevSig = ~sSigMultNegSev;
3014 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
3018 printf(
"\nrewCrit3 deletes it!\n");
3032 Lp.checked = strat->
sl+1;
3039 Lp.prod_crit =
TRUE;
3052 PrintS(
"SIGNATURE OF PAIR: ");
3056 Lp.p1 = strat->
S[
i];
3071 Lp.i_r1 = strat->
S_2_R[
i];
3090 printf(
"\nSigDrop in enteronepairSig\n");
pWrite(Lp.sig);
3096 int red_result =
redRing(&Lp,strat);
3101 printf(
"\nCancel the sigdrop after redRing (=0)\n");
3110 printf(
"\nAfter redRing still sigdrop:\n");
pWrite(Lp.p);
3112 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
3115 strat->
enterS(Lp,0,strat, strat->
tl+1);
3121 printf(
"\nThis spair was added to B:\n");
3155 pLcm(p,strat->
S[i],Lp.lcm);
3176 Lp.p1 = strat->
S[
i];
3180 Lp.i_r1 = strat->
S_2_R[
i];
3195 l = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
3206 int j=strat->
Ll+strat->
Bl+1;
3216 for (i=strat->
Bl; i>=0; i--)
3218 j = strat->
posInL(strat->
L,j,&(strat->
B[i]),strat);
3229 int j=strat->
Ll+strat->
Bl+1;
3239 for (i=strat->
Bl; i>=0; i--)
3241 j = strat->
posInLSba(strat->
L,j,&(strat->
B[i]),strat);
3262 for (j=0; j<=strat->
sl; j++)
3266 for (i=strat->
Bl; i>=0; i--)
3288 for (j=strat->
Ll; j>=0; j--)
3294 if (strat->
L[j].p == strat->
tail)
3314 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3340 for (j=strat->
Ll; j>=0; j--)
3360 for(i=j-1; i>=0; i--)
3362 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3379 for (j=strat->
Ll; j>=0; j--)
3410 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3413 if (strat->
L[j].p2 == p)
3419 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3433 strat->
L[
i].p2 = strat->
tail;
3450 else if (strat->
L[j].p2 == strat->
tail)
3489 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3492 if (strat->
L[j].p2 == p)
3498 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3512 strat->
L[
i].p2 = strat->
tail;
3529 else if (strat->
L[j].p2 == strat->
tail)
3537 #ifdef HAVE_RATGRING 3550 for (j=0; j<=strat->
sl; j++)
3554 for (i=strat->
Bl; i>=0; i--)
3562 Print(
"chain-crit-part: S[%d]=",j);
3564 Print(
" divide B[%d].lcm=",i);
3586 for (j=strat->
Ll; j>=0; j--)
3592 if (strat->
L[j].p == strat->
tail)
3596 PrintS(
"chain-crit-part: pCompareChainPart p=");
3598 Print(
" delete L[%d]",j);
3620 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3627 Print(
"chain-crit-part: sugar B[%d].lcm=",j);
3629 Print(
" delete B[%d]",i);
3640 Print(
"chain-crit-part: sugar B[%d].lcm=",i);
3642 Print(
" delete B[%d]",j);
3662 for (j=strat->
Ll; j>=0; j--)
3670 PrintS(
"chain-crit-part: sugar:pCompareChainPart p=");
3672 Print(
" delete L[%d]",j);
3690 for(i=j-1; i>=0; i--)
3692 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3696 Print(
"chain-crit-part: equal lcm B[%d].lcm=",j);
3698 Print(
" delete B[%d]\n",i);
3715 for (j=strat->
Ll; j>=0; j--)
3723 PrintS(
"chain-crit-part: pCompareChainPart p=");
3725 Print(
" delete L[%d]",j);
3754 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3757 if (strat->
L[j].p2 == p)
3763 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3780 strat->
L[
i].p2 = strat->
tail;
3787 PrintS(
"chain-crit-part: divisible_by p=");
3789 Print(
" delete L[%d]",l);
3800 PrintS(
"chain-crit-part: divisible_by(2) p=");
3802 Print(
" delete L[%d]",i);
3813 else if (strat->
L[j].p2 == strat->
tail)
3841 for (j=0; j<=
k; j++)
3843 if (!strat->
fromQ[j])
3854 for (j=0; j<=
k; j++)
3857 PrintS(
"\n Trying to add spoly : \n");
3868 for (j=0; j<=
k; j++)
3881 #ifdef HAVE_RATGRING 3911 for (j=0; j<=
k; j++)
3913 if (!strat->
fromQ[j])
3924 for (j=0; j<=
k; j++)
3933 for (j=0; j<=
k; j++)
3947 #ifdef HAVE_RATGRING 3971 for (j=0; j<=k && !strat->
sigdrop; j++)
3973 if (!strat->
fromQ[j])
3984 for (j=0; j<=k && !strat->
sigdrop; j++)
3993 for (j=0; j<=k && !strat->
sigdrop; j++)
4008 #ifdef HAVE_RATGRING 4036 for (j=0; j<=strat->
sl; j++)
4040 for (i=strat->
Bl; i>=0; i--)
4047 PrintS(
"--- chain criterion func chainCritRing type 1\n");
4050 PrintS(
" strat->B[i].lcm:");
4055 wrp(strat->
B[i].lcm);
4060 printf(
"\nChainCrit1\n");
4076 for (j=strat->
Ll; j>=0; j--)
4085 printf(
"\nChainCrit2\n");
4095 PrintS(
"--- chain criterion func chainCritRing type 2\n");
4096 PrintS(
"strat->L[j].p:");
4127 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
4130 if (strat->
L[j].p2 == p)
4138 &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
4145 PrintS(
"--- chain criterion func chainCritRing type 3\n");
4146 PrintS(
"strat->L[j].lcm:");
4147 wrp(strat->
L[j].lcm);
4148 PrintS(
" strat->L[i].lcm:");
4149 wrp(strat->
L[i].lcm);
4154 printf(
"\nChainCrit3\n");
4169 strat->
L[
i].p2 = strat->
tail;
4186 else if (strat->
L[j].p2 == strat->
tail)
4200 if (arg <= 0)
return 0;
4212 if (arg <= 0)
return 0;
4213 if (arg%2 == 1) { arg--; }
4223 #ifdef HAVE_VANIDEAL 4234 int l,
j,compare,compareCoeff;
4238 Lp.ecart=0; Lp.length=0;
4254 for(j = strat->
Bl;j>=0;j--)
4258 if (compareCoeff == 0 || compare == compareCoeff)
4276 if (compareCoeff == 1)
4283 if (compareCoeff == -1)
4294 if ((f==
NULL) || (p==
NULL))
return;
4326 tmp_h.SetShortExpVector();
4331 enterT(tmp_h, strat, strat->
tl + 1);
4336 Lp.i_r1 = strat->
tl;
4340 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
4354 if ((*cabsind < bound) && (*cabsind - step[1] + add < bound))
4363 if (N == 1)
return 0;
4365 while (exp[i] == cexp[i] && i <= N) i++;
4367 *cabsind -= cind[
i];
4370 *cabsind += cind[
i];
4373 if (i > N)
return 0;
4377 for (
int j = i + 1;
j <=
N;
j++)
4379 if (step[1] > step[
j]) step[1] = step[
j];
4381 add =
ind2(cexp[i] + 2);
4382 if (*cabsind - step[1] + add >= bound)
4385 *cabsind -= cind[
i];
4387 *cabsind += cind[
i];
4390 if (i > N)
return 0;
4393 }
while (step[1] != -1);
4398 if (add < step[i]) step[
i] =
add;
4399 for (i = 2; i <=
N; i++)
4401 if (step[1] > step[i]) step[1] = step[
i];
4427 for (
int i = 1; i <= leadRing->N; i++)
4433 if (cabsind < leadRing->ch)
4435 zeroPoly =
p_ISet(
twoPow(leadRing->ch - cabsind), tailRing);
4439 zeroPoly =
p_ISet(1, tailRing);
4441 for (
int i = 1; i <= leadRing->N; i++)
4443 for (
long j = 1;
j <= exp[
i];
j++)
4446 tmp2 =
p_ISet(1, tailRing);
4451 zeroPoly =
p_Mult_q(zeroPoly, tmp2, tailRing);
4456 zeroPoly =
p_Mult_q(zeroPoly,
p_Add_q(tmp3, tmp2, tailRing), tailRing);
4461 for (
int i = 1; i <= leadRing->N; i++)
4467 zeroPoly =
pNext(zeroPoly);
4469 pNext(tmp2) = zeroPoly;
4490 for (
int i = 1; i <=
currRing->N; i++)
4493 if (exp[i] & 1 != 0)
4495 exp[
i] = exp[
i] - 1;
4508 PrintS(
"-------------\npoly :");
4510 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
4511 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4512 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4514 Print(
"cind : %d\n", cabsind);
4531 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4556 for (
int i = 1; i <=
currRing->N; i++)
4567 PrintS(
"-------------\npoly :");
4569 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
4570 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4571 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4572 Print(
"bound : %d\n", bound);
4573 Print(
"cind : %d\n", cabsind);
4591 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4599 G0->m[
IDELEMS(G0) - 1] = zeroPoly;
4618 for (j=0; j<=
k; j++)
4640 for (j=0; j<=k && !strat->
sigdrop; j++)
4694 PrintS(
"--- create zero spoly: ");
4723 posx = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
4776 PrintS(
"--- create zero spoly: ");
4803 printf(
"\nSigdrop in enterextended spoly\n");
pWrite(h);
pWrite(hSig);
4807 int red_result =
redRing(&Lp,strat);
4809 printf(
"\nAfter redRing reduce:\n");
pWrite(Lp.p);
4815 printf(
"\nCancel the sigdrop. It reduced to 0\n");
4824 printf(
"\nSigdrop. end\n");
4826 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
4828 strat->
enterS(Lp,0,strat,strat->
tl);
4876 if ( (!strat->
fromT)
4886 clearS(h,h_sev, &j,&k,strat);
4914 printf(
"\n Trying to add extended spolys\n");
4919 printf(
"\n Trying to add spolys\n");
4924 printf(
"\n Trying to add gcd-polys\n");
4942 if ( (!strat->
fromT)
4950 clearS(h,h_sev, &j,&k,strat);
4967 if ( (!strat->
fromT)
4975 clearS(h,h_sev, &j,&k,strat);
4992 for (j=0; j<=
k; j++)
4994 const int iCompSj =
pGetComp(strat->
S[j]);
4995 if ((iCompH==iCompSj)
5006 for (j=0; j<=
k; j++)
5008 const int iCompSj =
pGetComp(strat->
S[j]);
5009 if ((iCompH==iCompSj)
5048 clearS(h,h_sev,&j,&k,strat);
5065 int new_suc=strat->
sl+1;
5069 for (; i<=strat->
sl; i++)
5074 if (new_suc > at) new_suc = at;
5077 sev = strat->
sevS[
i];
5080 for (j=i; j>=at+1; j--)
5082 strat->
S[
j] = strat->
S[j-1];
5089 strat->
sevS[at] = sev;
5090 strat->
S_2_R[at] = s2r;
5093 for (j=i; j>=at+1; j--)
5097 strat->
fromQ[at]=fq;
5101 if (new_suc <= strat->sl) *suc=new_suc;
5115 if(length==-1)
return 0;
5134 || ((o==oo) && (
pLmCmp(
set[length],p)!= cmp_int)))
5156 if (
pLmCmp(
set[length],p)== -cmp_int)
5164 if (cmp == cmp_int)
return an;
5165 if (cmp == -cmp_int)
return en;
5171 if (cmp == cmp_int) en =
i;
5172 else if (cmp == -cmp_int) an =
i;
5181 if (
pLmCmp(
set[length],p)== -cmp_int)
5188 if (
pLmCmp(
set[an],p) == cmp_int)
return an;
5189 if (
pLmCmp(
set[an],p) == -cmp_int)
return en;
5191 && ((strat->
ecartS[an])>ecart_p))
5196 if (
pLmCmp(
set[i],p) == cmp_int) en=i;
5197 else if (
pLmCmp(
set[i],p) == -cmp_int) an=i;
5201 &&((strat->
ecartS[
i])<ecart_p))
5216 if (length<0)
return 0;
5221 for(
int i = 0;i<=
length;i++)
5230 || ((op == o) && (
pLtCmp(
set[mon],p) == -1)))
5241 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5248 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5260 || ((op == o) && (
pLtCmp(
set[length],p) == -1)))
5274 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5281 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5293 if(end < 0 || end >=
IDELEMS(F))
5295 if (end<0)
return 0;
5302 for(i=start;i<end;i++)
5316 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5323 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5348 if (length==-1)
return 0;
5350 if (
pLmCmp(
set[length].p,p.p)!=
currRing->OrdSgn)
return length+1;
5379 if (
set[length].length<p.length)
5390 if (
set[an].length>p.length)
return an;
5394 if (
set[i].length>p.length) en=
i;
5406 if (length==-1)
return 0;
5408 int o = p.GetpFDeg();
5409 int op =
set[
length].GetpFDeg();
5412 || ((op == o) && (
pLmCmp(
set[length].p,p.p) !=
currRing->OrdSgn)))
5423 op=
set[an].GetpFDeg();
5430 op =
set[
i].GetpFDeg();
5442 if (length==-1)
return 0;
5444 int o = p.GetpFDeg();
5445 int op =
set[
length].GetpFDeg();
5459 op=
set[an].GetpFDeg();
5466 op =
set[
i].GetpFDeg();
5483 if (length==-1)
return 0;
5484 int o = p.GetpFDeg();
5485 int op =
set[
length].GetpFDeg();
5490 if ((op < o) || (
pLmCmp(
set[length].p,p.p)== -cmp_int))
5497 op =
set[an].GetpFDeg();
5498 if (op > o)
return an;
5499 if (op < 0)
return en;
5500 cmp =
pLmCmp(
set[an].p,p.p);
5501 if (cmp == cmp_int)
return an;
5502 if (cmp == -cmp_int)
return en;
5507 op =
set[
i].GetpFDeg();
5509 else if (op < o) an =
i;
5512 cmp =
pLmCmp(
set[i].p,p.p);
5513 if (cmp == cmp_int) en =
i;
5514 else if (cmp == -cmp_int) an =
i;
5560 if (length==-1)
return 0;
5562 int o = p.GetpFDeg();
5563 int op =
set[
length].GetpFDeg();
5566 || (( op == o) && (
set[length].length<p.length))
5567 || (( op == o) && (
set[length].length == p.length)
5578 op =
set[an].GetpFDeg();
5580 || (( op == o) && (
set[an].length > p.length))
5581 || (( op == o) && (
set[an].length == p.length)
5587 op =
set[
i].GetpFDeg();
5589 || (( op == o) && (
set[i].length > p.length))
5590 || (( op == o) && (
set[i].length == p.length)
5602 if (length==-1)
return 0;
5604 int o = p.GetpFDeg();
5605 int op =
set[
length].GetpFDeg();
5608 || (( op == o) && (
set[length].length<p.length))
5609 || (( op == o) && (
set[length].length == p.length)
5620 op =
set[an].GetpFDeg();
5622 || (( op == o) && (
set[an].length > p.length))
5623 || (( op == o) && (
set[an].length == p.length)
5629 op =
set[
i].GetpFDeg();
5631 || (( op == o) && (
set[i].length > p.length))
5632 || (( op == o) && (
set[i].length == p.length)
5648 if (length==-1)
return 0;
5650 int o = p.GetpFDeg();
5677 int ol = p.GetpLength();
5678 if (length==-1)
return 0;
5682 int oo=
set[
length].ecart;
5683 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
5693 int oo=
set[an].ecart;
5695 || ((oo==op) && (
set[an].
pLength > ol)))
5700 int oo=
set[
i].ecart;
5702 || ((oo == op) && (
set[i].
pLength > ol)))
5734 if (length==-1)
return 0;
5736 int o = p.GetpFDeg() + p.ecart;
5751 op =
set[an].GetpFDeg()+
set[an].ecart;
5758 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5770 if (length==-1)
return 0;
5772 int o = p.GetpFDeg() + p.ecart;
5787 op =
set[an].GetpFDeg()+
set[an].ecart;
5794 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5831 if (length==-1)
return 0;
5833 int o = p.GetpFDeg() + p.ecart;
5837 || (( op == o) && (
set[length].ecart > p.ecart))
5838 || (( op == o) && (
set[length].ecart==p.ecart)
5849 op =
set[an].GetpFDeg()+
set[an].ecart;
5851 || (( op == o) && (
set[an].ecart < p.ecart))
5852 || (( op == o) && (
set[an].ecart==p.ecart)
5858 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5860 || (( op == o) && (
set[i].ecart < p.ecart))
5861 || (( op == o) && (
set[i].ecart == p.ecart)
5872 if (length==-1)
return 0;
5874 int o = p.GetpFDeg() + p.ecart;
5878 || (( op == o) && (
set[length].ecart > p.ecart))
5879 || (( op == o) && (
set[length].ecart==p.ecart)
5890 op =
set[an].GetpFDeg()+
set[an].ecart;
5892 || (( op == o) && (
set[an].ecart < p.ecart))
5893 || (( op == o) && (
set[an].ecart==p.ecart)
5899 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5901 || (( op == o) && (
set[i].ecart < p.ecart))
5902 || (( op == o) && (
set[i].ecart == p.ecart)
5918 if (length==-1)
return 0;
5922 int o = p.GetpFDeg() + p.ecart;
5925 if (
pGetComp(
set[length].p)*cc < c)
5927 if (
pGetComp(
set[length].p)*cc == c)
5931 || ((op == o) && (
set[length].ecart > p.ecart))
5932 || ((op == o) && (
set[length].ecart==p.ecart)
5948 int op =
set[an].GetpFDeg()+
set[an].ecart;
5950 || ((op == o) && (
set[an].ecart < p.ecart))
5951 || ((op == o) && (
set[an].ecart==p.ecart)
5960 else if (
pGetComp(
set[i].p)*cc == c)
5962 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
5964 || ((op == o) && (
set[i].ecart < p.ecart))
5965 || ((op == o) && (
set[i].ecart == p.ecart)
5979 if (length==-1)
return 0;
5983 int o = p.GetpFDeg() + p.ecart;
5986 if (
pGetComp(
set[length].p)*cc < c)
5988 if (
pGetComp(
set[length].p)*cc == c)
5992 || ((op == o) && (
set[length].ecart > p.ecart))
5993 || ((op == o) && (
set[length].ecart==p.ecart)
6009 int op =
set[an].GetpFDeg()+
set[an].ecart;
6011 || ((op == o) && (
set[an].ecart < p.ecart))
6012 || ((op == o) && (
set[an].ecart==p.ecart)
6021 else if (
pGetComp(
set[i].p)*cc == c)
6023 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
6025 || ((op == o) && (
set[i].ecart < p.ecart))
6026 || ((op == o) && (
set[i].ecart == p.ecart)
6046 if (length==-1)
return 0;
6049 int op=p.GetpFDeg();
6051 if (
set[length].ecart < o)
6053 if (
set[length].ecart == o)
6055 int oo=
set[
length].GetpFDeg();
6056 if ((oo < op) || ((oo==op) && (
set[length].length < p.length)))
6067 if (
set[an].ecart > o)
6069 if (
set[an].ecart == o)
6071 int oo=
set[an].GetpFDeg();
6073 || ((oo==op) && (
set[an].length > p.length)))
6079 if (
set[i].ecart > o)
6081 else if (
set[i].ecart == o)
6083 int oo=
set[
i].GetpFDeg();
6085 || ((oo == op) && (
set[i].length > p.length)))
6103 if (length<0)
return 0;
6105 int d=p->GetpFDeg();
6106 int op=
set[
length].GetpFDeg();
6109 || ((op == d) && (p->p1!=
NULL)&&(
set[length].p1==
NULL))
6120 op=
set[an].GetpFDeg();
6122 || ((op == d) && (p->p1!=
NULL) && (
set[an].p1==
NULL))
6128 op=
set[
i].GetpFDeg();
6130 || ((op==d) && (p->p1!=
NULL) && (
set[i].p1==
NULL))
6146 if (length<0)
return 0;
6172 if (length<0)
return 0;
6204 if (length<0)
return 0;
6229 if (length<0)
return 0;
6243 cmp =
pLtCmp(
set[an].sig,p->sig);
6250 if (
set[an].
FDeg > p->FDeg)
6252 if (
set[an].FDeg < p->
FDeg)
6254 if (
set[an].FDeg == p->FDeg)
6256 cmp =
pLtCmp(
set[an].p,p->p);
6265 cmp =
pLtCmp(
set[i].sig,p->sig);
6272 if (
set[i].
FDeg > p->FDeg)
6274 if (
set[i].FDeg < p->
FDeg)
6276 if (
set[i].FDeg == p->FDeg)
6278 cmp =
pLtCmp(
set[i].p,p->p);
6291 if (length < 0)
return 0;
6292 if (
set[length].
FDeg > p->FDeg)
6294 if (
set[length].
FDeg == p->FDeg)
6295 if(
set[length].
GetpLength() > p->GetpLength())
6306 if (
set[an].
FDeg > p->FDeg)
6308 if(
set[an].
FDeg == p->FDeg)
6316 if(
nGreater(
set[an].p->coef, p->p->coef))
6331 if (
set[i].
FDeg > p->FDeg)
6335 if(
set[i].
FDeg == p->FDeg)
6343 if(
nGreater(
set[i].p->coef, p->p->coef))
6363 if (strat->
syzl==0)
return 0;
6368 int en= strat->
syzl-1;
6404 if (length<0)
return 0;
6406 int o = p->GetpFDeg();
6407 int op =
set[
length].GetpFDeg();
6410 || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6419 op =
set[an].GetpFDeg();
6426 op =
set[
i].GetpFDeg();
6446 if (length<0)
return 0;
6448 int o = p->GetpFDeg();
6449 int op =
set[
length].GetpFDeg();
6461 op =
set[an].GetpFDeg();
6468 op =
set[
i].GetpFDeg();
6480 if (length<0)
return 0;
6481 if(start == (length +1))
return (length+1);
6482 int o = p->GetpFDeg();
6483 int op =
set[
length].GetpFDeg();
6495 op =
set[an].GetpFDeg();
6502 op =
set[
i].GetpFDeg();
6516 if (length < 0)
return 0;
6526 if (
set[an].
FDeg > p->FDeg)
6528 if (
set[an].FDeg < p->
FDeg)
6530 if (
set[an].FDeg == p->FDeg)
6560 if (
set[i].
FDeg > p->FDeg)
6562 if (
set[i].FDeg < p->
FDeg)
6564 if (
set[i].FDeg == p->FDeg)
6604 if (coeff == 0)
return -1;
6607 while (tmp % 2 == 0)
6626 if (length < 0)
return 0;
6628 int o = p->GetpFDeg();
6629 int op =
set[
length].GetpFDeg();
6631 if ((op > o) || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6640 op =
set[an].GetpFDeg();
6641 if ((op > o) || ((op == o) && (
pLmCmp(
set[an].p,p->p) != -
currRing->OrdSgn)))
6646 op =
set[
i].GetpFDeg();
6647 if ((op > o) || ((op == o) && (
pLmCmp(
set[i].p,p->p) != -
currRing->OrdSgn)))
6702 if (length<0)
return 0;
6704 int o = p->GetpFDeg();
6705 int op =
set[
length].GetpFDeg();
6708 || ((op == o) && (
set[length].length >p->length))
6709 || ((op == o) && (
set[length].length <= p->length)
6719 op =
set[an].GetpFDeg();
6721 || ((op == o) && (
set[an].length >p->length))
6722 || ((op == o) && (
set[an].length <=p->length)
6728 op =
set[
i].GetpFDeg();
6730 || ((op == o) && (
set[i].length > p->length))
6731 || ((op == o) && (
set[i].length <= p->length)
6743 if (length<0)
return 0;
6745 int o = p->GetpFDeg();
6746 int op =
set[
length].GetpFDeg();
6749 || ((op == o) && (
set[length].length >p->length))
6750 || ((op == o) && (
set[length].length <= p->length)
6760 op =
set[an].GetpFDeg();
6762 || ((op == o) && (
set[an].length >p->length))
6763 || ((op == o) && (
set[an].length <=p->length)
6769 op =
set[
i].GetpFDeg();
6771 || ((op == o) && (
set[i].length > p->length))
6772 || ((op == o) && (
set[i].length <= p->length)
6790 if (length<0)
return 0;
6792 int o = p->GetpFDeg();
6825 if (length<0)
return 0;
6827 int o = p->GetpFDeg() + p->ecart;
6831 || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6840 op =
set[an].GetpFDeg() +
set[an].ecart;
6847 op =
set[
i].GetpFDeg() +
set[
i].ecart;
6860 if (length<0)
return 0;
6862 int o = p->GetpFDeg() + p->ecart;
6875 op =
set[an].GetpFDeg() +
set[an].ecart;
6882 op =
set[
i].GetpFDeg() +
set[
i].ecart;
6901 if (length<0)
return 0;
6903 int o = p->GetpFDeg() + p->ecart;
6905 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6906 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6907 && (
set[length].ecart > p->ecart))
6908 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6909 && (
set[length].ecart == p->ecart)
6919 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
6920 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6921 && (
set[an].ecart > p->ecart))
6922 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6923 && (
set[an].ecart == p->ecart)
6929 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
6930 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6931 && (
set[i].ecart > p->ecart))
6932 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6933 && (
set[i].ecart == p->ecart)
6945 if (length<0)
return 0;
6947 int o = p->GetpFDeg() + p->ecart;
6949 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6950 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6951 && (
set[length].ecart > p->ecart))
6952 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6953 && (
set[length].ecart == p->ecart)
6963 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
6964 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6965 && (
set[an].ecart > p->ecart))
6966 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6967 && (
set[an].ecart == p->ecart)
6973 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
6974 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6975 && (
set[i].ecart > p->ecart))
6976 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6977 && (
set[i].ecart == p->ecart)
6995 if (length<0)
return 0;
6999 unsigned long c =
pGetComp(p->p)*cc;
7000 int o = p->GetpFDeg() + p->ecart;
7002 if (
pGetComp(
set[length].p)*cc > c)
7004 if (
pGetComp(
set[length].p)*cc == c)
7006 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
7007 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
7008 && (
set[length].ecart > p->ecart))
7009 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
7010 && (
set[length].ecart == p->ecart)
7025 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
7026 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7027 && (
set[an].ecart > p->ecart))
7028 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7029 && (
set[an].ecart == p->ecart)
7038 else if (
pGetComp(
set[i].p)*cc == c)
7040 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
7041 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7042 && (
set[i].ecart > p->ecart))
7043 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7044 && (
set[i].ecart == p->ecart)
7059 if (length<0)
return 0;
7063 unsigned long c =
pGetComp(p->p)*cc;
7064 int o = p->GetpFDeg() + p->ecart;
7066 if (
pGetComp(
set[length].p)*cc > c)
7068 if (
pGetComp(
set[length].p)*cc == c)
7070 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
7071 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
7072 && (
set[length].ecart > p->ecart))
7073 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
7074 && (
set[length].ecart == p->ecart)
7089 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
7090 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7091 && (
set[an].ecart > p->ecart))
7092 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7093 && (
set[an].ecart == p->ecart)
7102 else if (
pGetComp(
set[i].p)*cc == c)
7104 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
7105 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7106 && (
set[i].ecart > p->ecart))
7107 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7108 && (
set[i].ecart == p->ecart)
7127 PrintS(
"syzygy criterion checks: ");
7130 for (
int k=0;
k<strat->
syzl;
k++)
7135 Print(
"checking with: %d / %d -- \n",
k,strat->
syzl);
7167 PrintS(
"--- syzygy criterion checks: ");
7176 min = strat->
syzIdx[comp-2];
7186 max = strat->
syzIdx[comp-1];
7188 for (
int k=min;
k<
max;
k++)
7191 Print(
"COMP %d/%d - MIN %d - MAX %d - SYZL %ld\n",comp,strat->
currIdx,min,max,strat->
syzl);
7192 Print(
"checking with: %d -- ",
k);
7220 PrintS(
"rewritten criterion checks: ");
7223 for(
int k = strat->
sl;
k>=start;
k--)
7227 PrintS(
"checking with: ");
7238 printf(
"\nFaugere RewCrit: * divisible by *\n");
pWrite(sig);
pWrite(strat->
sig[
k]);
7246 PrintS(
"ALL ELEMENTS OF S\n----------------------------------------\n");
7247 for(
int kk = 0; kk<strat->
sl+1; kk++)
7251 PrintS(
"------------------------------\n");
7278 printf(
"\narriRewCrit\n");
7284 for (
int ii=strat->
sl; ii>start; ii--)
7290 if (!(
pLmCmp(p1,p2) == 1))
7293 printf(
"\narriRewCrit deleted: sig, P.sig\n");
7309 printf(
"\narriRewCritPre\n");
7315 for (
int i=strat->
Bl; i>-1; i--) {
7324 if (
pLmCmp(lm,strat->
B[found].GetLmCurrRing()) == -1)
7328 printf(
"\nDelete!\n");
7334 printf(
"\nDelete this one!\n");
7341 for (
int ii=strat->
sl; ii>-1; ii--)
7347 if (!(
pLmCmp(p1,p2) == 1))
7352 printf(
"\nDelete this one!\n");
7373 const unsigned long not_sev = ~L->sev;
7374 const unsigned long* sev = strat->
sevS;
7387 if (j > pos)
return NULL;
7388 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7390 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7395 if (!(sev[j] & not_sev) &&
7396 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]) &&
7410 if (j > pos)
return NULL;
7411 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7418 if (!(sev[j] & not_sev) &&
7419 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]) &&
7430 if (strat->
tl < 0 || strat->
S_2_R[j] == -1)
7432 T->Set(strat->
S[j], r, strat->
tailRing);
7440 return strat->
S_2_T(j);
7450 if (j > pos)
return NULL;
7452 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7453 t = strat->
S_2_T(j);
7456 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7461 if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7463 t = strat->
S_2_T(j);
7464 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[j]);
7479 if (j > pos)
return NULL;
7481 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7482 t = strat->
S_2_T(j);
7490 if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7492 t = strat->
S_2_T(j);
7493 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[j]);
7543 if (With ==
NULL)
break;
7553 return redtail(L, pos, strat);
7559 if (hn ==
NULL)
goto all_done;
7580 return redtail(&L, pos, strat);
7585 #define REDTAIL_CANONICALIZE 100 7589 p = h = L->GetLmTailRing();
7591 return L->GetLmCurrRing();
7598 Ln.pLength = L->GetpLength() - 1;
7622 Ln.SetShortExpVector();
7628 With = &(strat->
T[
j]);
7633 if (With ==
NULL)
break;
7660 pNext(h) = Ln.LmExtractAndIter();
7663 }
while (!Ln.IsNull());
7666 if (Ln.IsNull())
goto all_done;
7667 if (! withT) With_s.Init(
currRing);
7669 pNext(h) = Ln.LmExtractAndIter();
7688 return L->GetLmCurrRing();
7698 p = h = L->GetLmTailRing();
7700 return L->GetLmCurrRing();
7707 Ln.pLength = L->GetpLength() - 1;
7720 Ln.SetShortExpVector();
7722 if (With ==
NULL)
break;
7732 poly p_Ln=Ln.GetLmCurrRing();
7733 poly p_With=With->GetLmCurrRing();
7745 if (Ln.bucket!=
NULL)
7776 pNext(h) = Ln.LmExtractAndIter();
7779 }
while (!Ln.IsNull());
7782 if (Ln.IsNull())
goto all_done;
7785 pNext(h) = Ln.LmExtractAndIter();
7803 return L->GetLmCurrRing();
7819 if (strat->
Ll != *reduc)
7821 if (strat->
Ll != *reduc-1)
7833 if (red_result == 0)
7835 else if (red_result < 0)
7837 if ((red_result > 0) || ((strat->
Ll % 100)==99))
7839 if (strat->
Ll != *reduc && strat->
Ll > 0)
7856 Print(
"product criterion:%d chain criterion:%d\n",strat->
cp,strat->
c3);
7857 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7859 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7870 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7872 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7887 for (i=0; i<=strat->
sl; i++)
7897 for (i=0; i<=strat->
tl; i++)
7901 Print(
" o:%ld e:%d l:%d",
7902 strat->
T[i].pFDeg(),strat->
T[
i].ecart,strat->
T[
i].length);
7907 for (i=strat->
Ll; i>=0; i--)
7916 Print(
" o:%ld e:%d l:%d",
7917 strat->
L[i].pFDeg(),strat->
L[
i].ecart,strat->
L[
i].length);
7939 strat->
S=strat->
Shdl->m;
7944 memset(strat->
fromQ,0,i*
sizeof(
int));
7950 h.p =
pCopy(Q->m[i]);
7971 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
7974 strat->
enterS(h,pos,strat,-1);
7975 strat->
fromQ[pos]=1;
7985 h.p =
pCopy(F->m[i]);
8007 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8009 strat->
enterS(h,pos,strat,-1);
8035 strat->
S=strat->
Shdl->m;
8040 memset(strat->
fromQ,0,i*
sizeof(
int));
8046 h.p =
pCopy(Q->m[i]);
8067 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8070 strat->
enterS(h,pos,strat,-1);
8071 strat->
fromQ[pos]=1;
8081 h.p =
pCopy(F->m[i]);
8104 pos = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
8134 strat->
S = strat->
Shdl->m;
8147 memset(strat->
fromQ,0,i*
sizeof(
int));
8153 h.p =
pCopy(Q->m[i]);
8174 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8177 strat->
enterS(h,pos,strat,-1);
8178 strat->
fromQ[pos]=1;
8188 h.p =
pCopy(F->m[i]);
8289 for(i=1; i<=strat->
sl; i++)
8305 #if defined(DEBUGF5) || defined(DEBUGF51) 8306 PrintS(
"------------- GENERATING SYZ RULES NEW ---------------\n");
8313 while (i <= strat->sl)
8325 diff = comp - comp_old - 1;
8343 for (k = 0; k<
i; k++)
8370 diff = comp - comp_old - 1;
8387 for (k = 0; k<strat->
sl+1; k++)
8408 PrintS(
"Principal syzygies:\n");
8411 Print(
"ps %d\n",ps);
8412 PrintS(
"--------------------------------\n");
8413 for(i=0;i<=strat->
syzl-1;i++)
8422 PrintS(
"--------------------------------\n");
8442 strat->
S=strat->
Shdl->m;
8448 memset(strat->
fromQ,0,i*
sizeof(
int));
8454 h.p =
pCopy(Q->m[i]);
8475 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8478 strat->
enterS(h,pos,strat, strat->
tl+1);
8480 strat->
fromQ[pos]=1;
8491 h.p =
pCopy(F->m[i]);
8506 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8508 strat->
enterS(h,pos,strat, strat->
tl+1);
8550 h.is_normalized = 0;
8555 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8557 strat->
enterS(h,pos,strat, strat->
tl+1);
8565 strat->
enterS(h,0,strat, strat->
tl+1);
8587 strat->
S=strat->
Shdl->m;
8593 memset(strat->
fromQ,0,i*
sizeof(
int));
8599 h.p =
pCopy(Q->m[i]);
8620 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8623 strat->
enterS(h,pos,strat, strat->
tl+1);
8625 strat->
fromQ[pos]=1;
8636 h.p =
pCopy(F->m[i]);
8651 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8653 strat->
enterS(h,pos,strat, strat->
tl+1);
8695 h.is_normalized = 0;
8700 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8702 strat->
enterS(h,pos,strat, strat->
tl+1);
8710 strat->
enterS(h,0,strat, strat->
tl+1);
8726 while (j <= maxIndex)
8743 if (!
pIsVector((*p).p) && ((*p).ecart != 0))
8752 h1 = r =
pCopy((*p).p);
8805 while ((j <= strat->sl) && (
pGetComp(strat->
S[j])!=0)) j++;
8807 while (j<=strat->sl)
8831 while (j <= maxIndex)
8885 while (j <= maxIndex);
8915 while (i<=strat->sl)
8922 redSi =
pHead(strat->
S[i]);
8923 strat->
S[
i] =
redBba(strat->
S[i],i-1,strat);
8926 if (
pCmp(redSi,strat->
S[i])!=0)
8939 if (strat->
S[i]==
NULL)
8947 if (strat->
S[i]==
NULL)
8965 DENOMINATOR_LIST=denom;
8984 if (any_change)
reorderS(&suc,strat);
8989 for (i=0; i<=strat->
sl; i++)
9010 h.sev = strat->
sevS[
i];
9023 while (i<=strat->sl)
9028 redSi=
pHead((strat->
S)[i]);
9035 else if (
pCmp((strat->
S)[i],redSi)!=0)
9052 DENOMINATOR_LIST=denom;
9067 strat->
sevS[
i] = h.sev;
9077 if (any_change)
reorderS(&suc,strat);
9078 else { suc=-1;
break; }
9089 for (i=0; i<=strat->
sl; i++)
9093 strat->
S[
i] = h.p =
redtail(strat->
S[i],strat->
sl,strat);
9097 strat->
sevS[
i] = h.sev;
9103 h.sev = strat->
sevS[
i];
9104 h.length = h.pLength =
pLength(h.p);
9113 if (suc!= -1)
updateS(toT,strat);
9133 *
sizeof(
unsigned long));
9160 strat->
Shdl->m=strat->
S;
9162 if (atS <= strat->sl)
9164 #ifdef ENTER_USE_MEMMOVE 9165 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9166 (strat->
sl - atS + 1)*
sizeof(
poly));
9167 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9168 (strat->
sl - atS + 1)*
sizeof(
int));
9169 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9170 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9171 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9172 (strat->
sl - atS + 1)*
sizeof(
int));
9174 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9175 (strat->
sl - atS + 1)*
sizeof(
int));
9177 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9180 for (i=strat->
sl+1; i>=atS+1; i--)
9182 strat->
S[
i] = strat->
S[i-1];
9188 for (i=strat->
sl+1; i>=atS+1; i--)
9191 for (i=strat->
sl+1; i>=atS+1; i--)
9197 #ifdef ENTER_USE_MEMMOVE 9198 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9199 (strat->
sl - atS + 1)*
sizeof(
int));
9201 for (i=strat->
sl+1; i>=atS+1; i--)
9206 strat->
fromQ[atS]=0;
9210 strat->
S[atS] = p.p;
9216 strat->
sevS[atS] = p.sev;
9217 strat->
ecartS[atS] = p.ecart;
9218 strat->
S_2_R[atS] = atR;
9235 *
sizeof(
unsigned long));
9239 *
sizeof(
unsigned long));
9267 strat->
Shdl->m=strat->
S;
9274 if (atS <= strat->sl)
9276 #ifdef ENTER_USE_MEMMOVE 9277 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9278 (strat->
sl - atS + 1)*
sizeof(
poly));
9279 memmove(&(strat->
sig[atS+1]), &(strat->
sig[atS]),
9280 (strat->
sl - atS + 1)*
sizeof(
poly));
9281 memmove(&(strat->
sevSig[atS+1]), &(strat->
sevSig[atS]),
9282 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9283 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9284 (strat->
sl - atS + 1)*
sizeof(
int));
9285 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9286 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9287 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9288 (strat->
sl - atS + 1)*
sizeof(
int));
9290 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9291 (strat->
sl - atS + 1)*
sizeof(
int));
9293 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9296 for (i=strat->
sl+1; i>=atS+1; i--)
9298 strat->
S[
i] = strat->
S[i-1];
9302 strat->
sig[
i] = strat->
sig[i-1];
9306 for (i=strat->
sl+1; i>=atS+1; i--)
9309 for (i=strat->
sl+1; i>=atS+1; i--)
9315 #ifdef ENTER_USE_MEMMOVE 9316 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9317 (strat->
sl - atS + 1)*
sizeof(
int));
9319 for (i=strat->
sl+1; i>=atS+1; i--)
9324 strat->
fromQ[atS]=0;
9328 strat->
S[atS] = p.p;
9329 strat->
sig[atS] = p.sig;
9335 strat->
sevS[atS] = p.sev;
9345 strat->
sevSig[atS] = p.sevSig;
9347 strat->
ecartS[atS] = p.ecart;
9348 strat->
S_2_R[atS] = atR;
9352 Print(
"--- LIST S: %d ---\n",strat->
sl);
9353 for(k=0;k<=strat->
sl;k++)
9357 PrintS(
"--- LIST S END ---\n");
9373 assume(p.FDeg == p.pFDeg());
9378 for(i=strat->
tl;i>=0;i--)
9380 if (p.p==strat->
T[i].p)
9382 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
9388 #ifdef HAVE_TAIL_RING 9391 p.t_p=p.GetLmTailRing();
9396 atT = strat->
posInT(strat->
T, strat->
tl, p);
9397 if (strat->
tl == strat->
tmax-1)
9399 if (atT <= strat->tl)
9401 #ifdef ENTER_USE_MEMMOVE 9402 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9404 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9405 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9407 for (i=strat->
tl+1; i>=atT+1; i--)
9409 #ifndef ENTER_USE_MEMMOVE 9410 strat->
T[
i] = strat->
T[i-1];
9413 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9427 printf(
"\nenterT: add in position %i\n",atT);
9435 strat->
T[atT].max =
NULL;
9438 strat->
R[strat->
tl] = &(strat->
T[atT]);
9439 strat->
T[atT].i_r = strat->
tl;
9459 assume(p.FDeg == p.pFDeg());
9464 for(i=strat->
tl;i>=0;i--)
9466 if (p.p==strat->
T[i].p)
9468 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
9474 #ifdef HAVE_TAIL_RING 9477 p.t_p=p.GetLmTailRing();
9482 atT = strat->
posInT(strat->
T, strat->
tl, p);
9483 if (strat->
tl == strat->
tmax-1)
9485 if (atT <= strat->tl)
9487 #ifdef ENTER_USE_MEMMOVE 9488 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9490 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9491 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9493 for (i=strat->
tl+1; i>=atT+1; i--)
9495 #ifndef ENTER_USE_MEMMOVE 9496 strat->
T[
i] = strat->
T[i-1];
9499 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9513 printf(
"\nenterT_strong: add in position %i\n",atT);
9521 strat->
T[atT].max =
NULL;
9524 strat->
R[strat->
tl] = &(strat->
T[atT]);
9525 strat->
T[atT].i_r = strat->
tl;
9533 printf(
"\nDas ist p:\n");
pWrite(p.p);
9535 for(i=strat->
tl;i>=0;i--)
9540 printf(
"\nFound one: %i\n",i);
pWrite(strat->
T[i].p);
9564 printf(
"\n Entersyz:\n");
pWrite(p.sig);
9572 (strat->
syzmax)*
sizeof(
unsigned long),
9574 *
sizeof(
unsigned long));
9577 if (atT < strat->syzl)
9579 #ifdef ENTER_USE_MEMMOVE 9580 memmove(&(strat->
syz[atT+1]), &(strat->
syz[atT]),
9582 memmove(&(strat->
sevSyz[atT+1]), &(strat->
sevSyz[atT]),
9583 (strat->
syzl-atT+1)*
sizeof(
unsigned long));
9585 for (i=strat->
syzl; i>=atT+1; i--)
9587 #ifndef ENTER_USE_MEMMOVE 9588 strat->
syz[
i] = strat->
syz[i-1];
9600 strat->
syz[atT] = p.sig;
9601 strat->
sevSyz[atT] = p.sevSig;
9604 Print(
"element in strat->syz: %d--%d ",atT+1,strat->
syzmax);
9614 strat->
L[cc].sig, ~strat->
L[cc].sevSig,
currRing)
9623 printf(
"\n syzCrit deleted!\n");
pWrite(strat->
L[cc].p);
pWrite(strat->
L[cc].sig);
9631 PrintS(
"--- Syzygies ---\n");
9634 PrintS(
"--------------------------------\n");
9635 for(i=0;i<=strat->
syzl-1;i++)
9640 PrintS(
"--------------------------------\n");
9676 #ifdef HAVE_RATGRING 9721 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9722 else PrintS(
"ideal/module is not homogeneous\n");
9753 #ifdef HAVE_RATGRING 9792 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9793 else PrintS(
"ideal/module is not homogeneous\n");
10015 strat->
P.pLength=0;
10301 for (l=
IDELEMS(r)-1;l>=0;l--)
10312 for (l=
IDELEMS(r)-1;l>=0;l--)
10314 if ((r->m[l]!=
NULL)
10319 for(q=
IDELEMS(Q)-1; q>=0;q--)
10321 if ((Q->m[q]!=
NULL)
10343 for (l=
IDELEMS(r)-1;l>=0;l--)
10345 if ((r->m[l]!=
NULL)
10350 for(q=
IDELEMS(Q)-1; q>=0;q--)
10352 if ((Q->m[q]!=
NULL)
10383 for (l=
IDELEMS(r)-1;l>=0;l--)
10387 for(q=
IDELEMS(Q)-1; q>=0;q--)
10396 reduction_found=
TRUE;
10412 for (l=
IDELEMS(r)-1;l>=0;l--)
10416 for(q=
IDELEMS(Q)-1; q>=0;q--)
10427 reduction_found=
TRUE;
10441 if ( reduction_found)
10446 for (l=
IDELEMS(r)-1;l>=0;l--)
10477 for (l=
IDELEMS(r)-1;l>=0;l--)
10531 for (i=strat->
sl; i>=low; i--)
10533 int end_pos=strat->
sl;
10535 if (strat->
ak==0) end_pos=i-1;
10537 if ((T_j !=
NULL)&&(T_j->p==strat->
S[i]))
10543 Print(
"test S[%d]:",i);
10555 Print(
"to (tailR) S[%d]:",i);
10570 T_j->pCleardenom();
10578 Print(
"test S[%d]:",i);
10584 strat->
S[
i] =
redtailBba(strat->
S[i], end_pos, strat, withT);
10598 DENOMINATOR_LIST=denom;
10611 Print(
"to (-tailR) S[%d]:",i);
10622 sloppy_max =
FALSE;
10658 if (j < strat->
HCord)
10702 assume(L->i_r1 >= -1 && L->i_r1 <= strat->
tl);
10703 assume(L->i_r2 >= -1 && L->i_r2 <= strat->
tl);
10709 if ((L->i_r1 == -1) || (L->i_r2 == -1) )
10713 poly p1_max = (strat->
R[L->i_r1])->
max;
10714 poly p2_max = (strat->
R[L->i_r2])->
max;
10740 poly p1_max = (strat->
R[atR])->
max;
10763 ideal F =
idCopy(Forig);
10767 ideal monred =
idInit(1,1);
10768 for(
int i=0; i<
idElem(F); i++)
10774 if((posconst != -1) && (!
nIsZero(F->m[posconst]->coef)))
10784 for(
int i=0; i<idelemQ; i++)
10792 if((posconst != -1) && (!
nIsZero(monred->m[posconst]->coef)))
10794 pmon =
pCopy(monred->m[posconst]);
10808 for(
int i = 0, j = 0; i<
IDELEMS(F); i++)
10809 II->m[j++] =
prMapR(F->m[i], nMap, origR, QQ_ring);
10810 for(
int i = 0, j =
IDELEMS(F); i<idelemQ; i++)
10811 II->m[j++] =
prMapR(Q->m[i], nMap, origR, QQ_ring);
10817 for(
int i =
IDELEMS(II)-1; i>=0; i--)
10818 if(II->m[i] !=
NULL)
10819 II->m[i+1] = II->m[
i];
10823 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
10830 integer =
pHead(syz->m[i]);
10837 pmon =
prMapR(integer, nMap2, QQ_ring, origR);
10852 for(
int i = 0; i<
IDELEMS(one); i++)
10856 if(mindegmon ==
NULL)
10857 mindegmon =
pCopy(one->m[i]);
10860 if(
p_Deg(one->m[i], QQ_ring) <
p_Deg(mindegmon, QQ_ring))
10861 mindegmon =
pCopy(one->m[i]);
10865 if(mindegmon !=
NULL)
10867 for(
int i =
IDELEMS(II)-1; i>=0; i--)
10868 if(II->m[i] !=
NULL)
10869 II->m[i+1] = II->m[
i];
10870 II->m[0] =
pCopy(mindegmon);
10873 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
10887 if (found ==
FALSE)
10899 pmon =
prMapR(mindegmon, nMap2, QQ_ring, origR);
10930 poly pH = h->GetP();
10934 for(
int i = 0; i<=strat->
sl; i++)
10986 h->SetLmCurrRing();
10995 poly hSig = h->sig;
10996 poly pH = h->GetP();
11000 for(
int i = 0; i<=strat->
sl; i++)
11011 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
11038 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
11069 h->SetLmCurrRing();
11085 for(
int j = 0; j<=strat->
sl; j++)
11089 for(
int i = 0; i<=strat->
sl; i++)
11091 if((i != j) && (strat->
S[i] !=
NULL))
11151 if (expbound == 0) expbound = strat->
tailRing->bitmask << 1;
11168 new_tailRing->pFDeg =
currRing->pFDeg;
11169 new_tailRing->pLDeg =
currRing->pLDeg;
11173 Print(
"[%lu:%d", (
unsigned long) new_tailRing->bitmask, new_tailRing->ExpL_Size);
11182 for (i=0; i<=strat->
tl; i++)
11184 strat->
T[
i].ShallowCopyDelete(new_tailRing, new_tailBin,
11185 p_shallow_copy_delete);
11187 for (i=0; i<=strat->
Ll; i++)
11191 strat->
L[
i].ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11193 if ((strat->
P.t_p !=
NULL) ||
11195 strat->
P.ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11197 if ((L !=
NULL) && (L->tailRing != new_tailRing))
11200 L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11206 L->tailRing = new_tailRing;
11213 if ((T !=
NULL) && (T->tailRing != new_tailRing && T->i_r < 0))
11214 T->ShallowCopyDelete(new_tailRing, new_tailBin, p_shallow_copy_delete);
11221 strat->
tailBin = new_tailBin;
11247 unsigned long l = 0;
11253 for (i=0; i<= strat->
Ll; i++)
11257 for (i=0; i<=strat->
tl; i++)
11283 res->order = (
int *)
omAlloc0((n+1)*
sizeof(int));
11284 res->block0 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11285 res->block1 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11286 int **wvhdl = (
int **)
omAlloc0((n+1)*
sizeof(
int*));
11287 res->wvhdl = wvhdl;
11288 for (
int i=1; i<n; i++)
11290 res->order[
i] = r->order[i-1];
11291 res->block0[
i] = r->block0[i-1];
11292 res->block1[
i] = r->block1[i-1];
11293 res->wvhdl[
i] = r->wvhdl[i-1];
11299 for (
int i=
rBlocks(res); i>0; --
i)
11312 #ifndef SING_NDEBUG 11313 WarnS(
"error in nc_rComplete");
11331 res->order = (
int *)
omAlloc0((n+2)*
sizeof(int));
11332 res->block0 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11333 res->block1 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11334 int **wvhdl = (
int **)
omAlloc0((n+2)*
sizeof(
int*));
11335 res->wvhdl = wvhdl;
11336 for (
int i=2; i<n+2; i++)
11338 res->order[
i] = r->order[i-2];
11339 res->block0[
i] = r->block0[i-2];
11340 res->block1[
i] = r->block1[i-2];
11341 res->wvhdl[
i] = r->wvhdl[i-2];
11346 res->block0[0] = 1;
11347 res->wvhdl[0] = (
int *)
omAlloc(res->N*
sizeof(
int));
11348 for (
int i=0; i<res->N; ++
i)
11349 res->wvhdl[0][i] = 1;
11353 res->wvhdl[1] =
NULL;
11355 for (
int i=
rBlocks(res); i>1; --
i)
11368 #ifndef SING_NDEBUG 11369 WarnS(
"error in nc_rComplete");
11506 #ifdef HAVE_TAIL_BIN 11518 if (tailBin !=
NULL)
11522 if (t_kHEdge !=
NULL)
11524 if (t_kNoether !=
NULL)
11533 Timings
for the different possibilities of posInT:
11534 T15 EDL DL EL L 1-2-3
11535 Gonnet 43.26 42.30 38.34 41.98 38.40 100.04
11536 Hairer_2_1 1.11 1.15 1.04 1.22 1.08 4.7
11537 Twomat3 1.62 1.69 1.70 1.65 1.54 11.32
11538 ahml 4.48 4.03 4.03 4.38 4.96 26.50
11539 c7 15.02 13.98 15.16 13.24 17.31 47.89
11540 c8 505.09 407.46 852.76 413.21 499.19 n/
a 11541 f855 12.65 9.27 14.97 8.78 14.23 33.12
11542 gametwo6 11.47 11.35 14.57 11.20 12.02 35.07
11543 gerhard_3 2.73 2.83 2.93 2.64 3.12 6.24
11544 ilias13 22.89 22.46 24.62 20.60 23.34 53.86
11545 noon8 40.68 37.02 37.99 36.82 35.59 877.16
11546 rcyclic_19 48.22 42.29 43.99 45.35 51.51 204.29
11547 rkat9 82.37 79.46 77.20 77.63 82.54 267.92
11548 schwarz_11 16.46 16.81 16.76 16.81 16.72 35.56
11549 test016 16.39 14.17 14.40 13.50 14.26 34.07
11550 test017 34.70 36.01 33.16 35.48 32.75 71.45
11551 test042 10.76 10.99 10.27 11.57 10.45 23.04
11552 test058 6.78 6.75 6.51 6.95 6.22 9.47
11553 test066 10.71 10.94 10.76 10.61 10.56 19.06
11554 test073 10.75 11.11 10.17 10.79 8.63 58.10
11555 test086 12.23 11.81 12.88 12.24 13.37 66.68
11556 test103 5.05 4.80 5.47 4.64 4.89 11.90
11557 test154 12.96 11.64 13.51 12.46 14.61 36.35
11558 test162 65.27 64.01 67.35 59.79 67.54 196.46
11559 test164 7.50 6.50 7.68 6.70 7.96 17.13
11560 virasoro 3.39 3.50 3.35 3.47 3.70 7.66
11570 if (length==-1)
return 0;
11573 int op=p.GetpFDeg();
11574 int ol = p.GetpLength();
11576 if (
set[length].ecart < o)
11578 if (
set[length].ecart == o)
11580 int oo=
set[
length].GetpFDeg();
11581 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
11592 if (
set[an].ecart > o)
11594 if (
set[an].ecart == o)
11596 int oo=
set[an].GetpFDeg();
11598 || ((oo==op) && (
set[an].
pLength > ol)))
11604 if (
set[i].ecart > o)
11606 else if (
set[i].ecart == o)
11608 int oo=
set[
i].GetpFDeg();
11610 || ((oo == op) && (
set[i].
pLength > ol)))
11624 if (length==-1)
return 0;
11626 int op=p.GetpFDeg();
11627 int ol = p.GetpLength();
11629 int oo=
set[
length].GetpFDeg();
11630 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
11640 int oo=
set[an].GetpFDeg();
11642 || ((oo==op) && (
set[an].
pLength > ol)))
11647 int oo=
set[
i].GetpFDeg();
11649 || ((oo == op) && (
set[i].
pLength > ol)))
11660 int ol = p.GetpLength();
11663 if (
set[length].length<p.length)
11674 if (
set[an].
pLength>ol)
return an;
11695 if (strat->
red==redFirst)
PrintS(
"redFirst\n");
11697 else if (strat->
red==redEcart)
PrintS(
"redEcart\n");
11699 else Print(
"%p\n",(
void*)strat->
red);
11718 #ifdef HAVE_MORE_POS_IN_T 11749 else if (strat->
enterS==enterSMora)
PrintS(
"enterSMora\n");
11750 else if (strat->
enterS==enterSMoraNF)
PrintS(
"enterSMoraNF\n");
11756 PrintS(
"initEcartPair: ");
11760 Print(
"homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
11762 Print(
"honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
11768 Print(
"posInLDependsOnLength=%d\n",
11800 PrintS(
"currRing->pFDeg: ");
11815 PrintS(
"ecartWeights: ");
11822 #ifndef SING_NDEBUG 11827 #ifdef HAVE_SHIFTBBA 11841 #ifdef HAVE_SHIFTBBA 11858 #ifdef HAVE_SHIFTBBA 11950 #ifdef HAVE_SHIFTBBA 11960 for (i=0; i<=strat->
sl; i++)
11962 memset(&h,0,
sizeof(h));
11965 h.sev = strat->
sevS[
i];
11979 #ifdef HAVE_SHIFTBBA 12055 #ifdef HAVE_SHIFTBBA 12095 qfromQ = strat->
fromQ[
i];
12107 enterOnePairShift(qq, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, 0, i, uptodeg, lV);
12109 for (j=1; j<= toInsert; j++)
12124 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, i, uptodeg, lV);
12129 #ifdef HAVE_SHIFTBBA 12171 for (; j<= toInsert; j++)
12188 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, -1, uptodeg, lV);
12193 #ifdef HAVE_SHIFTBBA 12197 void enterOnePairShift (
poly q,
poly p,
int ecart,
int isFromQ,
kStrategy strat,
int atR,
int ecartq,
int qisFromQ,
int shiftcount,
int ifromS,
int ,
int lV)
12221 int qfromQ = qisFromQ;
12230 Lp.ecart=0; Lp.length=0;
12239 if (!
isInV(Lp.lcm, lV))
12244 PrintS(
"V crit applied to q = ");
12260 if((!((ecartq>0)&&(ecart>0)))
12283 Lp.ecart =
si_max(ecart,ecartq);
12284 if (strat->
fromT && (ecartq>ecart))
12302 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
12307 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12351 if (strat->
fromT && (ecartq>ecart))
12364 for(j = strat->
Bl;j>=0;j--)
12366 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
12370 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12394 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (qfromQ!=0))
12461 if ( (atR >= 0) && (shiftcount==0) && (ifromS >=0) )
12480 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
12486 #ifdef HAVE_SHIFTBBA 12499 if ( (!strat->
fromT)
12508 clearS(h,h_sev, &j,&k,strat);
12517 #ifdef HAVE_SHIFTBBA 12538 for (j=0; j<=
k; j++)
12540 if (!strat->
fromQ[j])
12553 for (j=0; j<=
k; j++)
12566 for (j=0; j<=
k; j++)
12591 #ifdef HAVE_SHIFTBBA 12611 atT = strat->
posInT(strat->
T, strat->
tl, p);
12618 for (i=1; i<=toInsert; i++)
12629 atT = strat->
posInT(strat->
T, strat->
tl, qq);
12638 #ifdef HAVE_SHIFTBBA 12645 p = h = L->GetLmTailRing();
12647 return L->GetLmCurrRing();
12654 Ln.pLength = L->GetpLength() - 1;
12662 while(!Ln.IsNull())
12666 Ln.SetShortExpVector();
12672 With = &(strat->
T[
j]);
12677 if (With ==
NULL)
break;
12693 pNext(h) = Ln.LmExtractAndIter();
12696 }
while (!Ln.IsNull());
12699 if (Ln.IsNull())
goto all_done;
12700 if (! withT) With_s.Init(
currRing);
12702 pNext(h) = Ln.LmExtractAndIter();
12717 return L->GetLmCurrRing();
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
#define TEST_OPT_INFREDTAIL
#define pSetmComp(p)
TODO:
void initEcartPairBba(LObject *Lp, poly, poly, int, int)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
int getIndexRng(long coeff)
int posInL11(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
denominator_list_s * denominator_list
int posInT_pLength(const TSet set, const int length, LObject &p)
#define omRealloc0Size(addr, o_size, size)
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
unsigned long p_GetMaxExpL(poly p, const ring r, unsigned long l_max)
return the maximal exponent of p in form of the maximal long var
static FORCE_INLINE number n_IntMod(number a, number b, const coeffs r)
for r a field, return n_Init(0,r) always: n_Div(a,b,r)*b+n_IntMod(a,b,r)==a n_IntMod(a,b,r) >=0
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...
KINLINE TObject ** initR()
const CanonicalForm int s
int posInTrg0(const TSet set, const int length, LObject &p)
void omMergeStickyBinIntoBin(omBin sticky_bin, omBin into_bin)
void initSbaPos(kStrategy strat)
poly redtail(LObject *L, int pos, kStrategy strat)
void enterOnePairShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS, int, int lV)
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
void enterSSba(LObject &p, int atS, kStrategy strat, int atR)
int posInL17(const LSet set, const int length, LObject *p, const kStrategy)
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
int itoInsert(poly p, int uptodeg, int lV, const ring r)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
int redRing(LObject *h, kStrategy strat)
void enterSMora(LObject &p, int atS, kStrategy strat, int atR=-1)
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
static FORCE_INLINE BOOLEAN n_IsUnit(number n, const coeffs r)
TRUE iff n has a multiplicative inverse in the given coeff field/ring r.
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
static CanonicalForm bound(const CFMatrix &M)
int posInT2(const TSet set, const int length, LObject &p)
long pLDeg1(poly p, int *l, const ring r)
static int p_Cmp(poly p1, poly p2, ring r)
KINLINE unsigned long * initsevT()
#define TEST_OPT_DEGBOUND
int posInL11Ringls(const LSet set, const int length, LObject *p, const kStrategy strat)
void pLcmRat(poly a, poly b, poly m, int rat_shift)
void initBuchMoraPos(kStrategy strat)
void clearSbatch(poly h, int k, int pos, kStrategy strat)
BOOLEAN(* rewCrit1)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
BOOLEAN p_LmCheckIsFromRing(poly p, ring r)
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
pLDegProc pOrigLDeg_TailRing
#define idDelete(H)
delete an ideal
long pLDeg1c_Totaldegree(poly p, int *l, const ring r)
static int * initS_2_R(const int maxnr)
#define pLtCmpOrdSgnDiffM(p, q)
void messageStat(int hilbcount, kStrategy strat)
void postReduceByMonSig(LObject *h, kStrategy strat)
static int min(int a, int b)
int posInL15Ring(const LSet set, const int length, LObject *p, const kStrategy)
static int si_min(const int a, const int b)
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly, kStrategy strat, int start=0)
long pLDeg1c(poly p, int *l, const ring r)
int posInIdealMonFirst(const ideal F, const poly p, int start, int end)
Compatiblity layer for legacy polynomial operations (over currRing)
int posInT1(const TSet set, const int length, LObject &p)
long totaldegreeWecart(poly p, ring r)
void chainCritNormal(poly p, int ecart, kStrategy strat)
void initenterpairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
KINLINE int ksReducePolyTail(LObject *PR, TObject *PW, LObject *Red)
int posInL17Ring(const LSet set, const int length, LObject *p, const kStrategy)
int posInLrg0(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
void initBuchMora(ideal F, ideal Q, kStrategy strat)
static poly p_Mult_mm(poly p, poly m, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
static BOOLEAN rIsSyzIndexRing(const ring r)
void cancelunit1(LObject *p, int *suc, int index, kStrategy strat)
int posInL15(const LSet set, const int length, LObject *p, const kStrategy)
void initenterpairsSigRing(poly h, poly hSig, int hFrom, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void enterOnePairSig(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
poly prMoveR(poly &p, ring src_r, ring dest_r)
void reorderS(int *suc, kStrategy strat)
static int rGetCurrSyzLimit(const ring r)
void initenterstrongPairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
static BOOLEAN p_LmExpVectorAddIsOk(const poly p1, const poly p2, const ring r)
static poly pp_Mult_nn(poly p, number n, const ring r)
int posInL13(const LSet set, const int length, LObject *p, const kStrategy)
static BOOLEAN rIsRatGRing(const ring r)
#define TEST_OPT_CONTENTSB
BOOLEAN posInLDependsOnLength
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
int kFindInT(poly p, TSet T, int tlength)
returns index of p in TSet, or -1 if not found
int(* posInLSba)(const LSet set, const int length, LObject *L, const kStrategy strat)
#define omFreeSize(addr, size)
int posInL110Ring(const LSet set, const int length, LObject *p, const kStrategy)
void cleanTSbaRing(kStrategy strat)
static short rVar(const ring r)
#define rVar(r) (r->N)
static int pDivComp(poly p, poly q)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
int ksCheckCoeff(number *a, number *b)
BOOLEAN sbaCheckGcdPair(LObject *h, kStrategy strat)
void initSyzRules(kStrategy strat)
int posInT15Ring(const TSet set, const int length, LObject &p)
long pLDeg0c(poly p, int *l, const ring r)
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
static unsigned long p_GetMaxExp(const unsigned long l, const ring r)
void initenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void initSL(ideal F, ideal Q, kStrategy strat)
ring rModifyRing(ring r, BOOLEAN omit_degree, BOOLEAN try_omit_comp, unsigned long exp_limit)
void scComputeHC(ideal S, ideal Q, int ak, poly &hEdge, ring tailRing)
int posInLRing(const LSet set, const int length, LObject *p, const kStrategy)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
#define pCmp(p1, p2)
pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2))) ...
static poly pp_Mult_mm(poly p, poly m, const ring r)
static BOOLEAN p_HasNotCF_Lift(poly p1, poly p2, const ring r)
p_HasNotCF for the IDLIFT case: ignore component
denominator_list DENOMINATOR_LIST
void enterpairsSpecial(poly h, int k, int ecart, int pos, kStrategy strat, int atR=-1)
poly pMove2CurrTail(poly p, kStrategy strat)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
#define pHasNotCF(p1, p2)
void initSSpecialSba(ideal F, ideal Q, ideal P, kStrategy strat)
static long p_Totaldegree(poly p, const ring r)
void deleteInS(int i, kStrategy strat)
static BOOLEAN rField_is_Domain(const ring r)
pShallowCopyDeleteProc p_shallow_copy_delete
BOOLEAN(* rewCrit3)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
ring sbaRing(kStrategy strat, const ring r, BOOLEAN, int)
poly preIntegerCheck(const ideal Forig, const ideal Q)
used for GB over ZZ: look for constant and monomial elements in the ideal background: any known const...
void initSLSba(ideal F, ideal Q, kStrategy strat)
void cancelunit(LObject *L, BOOLEAN inNF)
poly kCreateZeroPoly(long exp[], long cabsind, poly *t_p, ring leadRing, ring tailRing)
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
poly nc_CreateShortSpoly(poly p1, poly p2, const ring r)
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
poly redtailBba(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
int posInLF5C(const LSet, const int, LObject *, const kStrategy strat)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
long pLDeg1_Deg(poly p, int *l, const ring r)
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR, int uptodeg, int lV)
static unsigned long * initsevS(const int maxnr)
ring rAssure_c_dp(const ring r)
int posInL17_cRing(const LSet set, const int length, LObject *p, const kStrategy)
int posInT15(const TSet set, const int length, LObject &p)
int(* red)(LObject *L, kStrategy strat)
void initBuchMoraPosRing(kStrategy strat)
int nextZeroSimplexExponent(long exp[], long ind[], long cexp[], long cind[], long *cabsind, long step[], long bound, long N)
int redHomog(LObject *h, kStrategy strat)
static poly redBba1(poly h, int maxIndex, kStrategy strat)
int(* posInT)(const TSet T, const int tl, LObject &h)
static number p_SetCoeff(poly p, number n, ring r)
void HEckeTest(poly pp, kStrategy strat)
#define omCheckBinAddrSize(addr, size)
poly p_Sub(poly p1, poly p2, const ring r)
void chainCritSig(poly p, int, kStrategy strat)
static void p_LmFree(poly p, ring)
void enterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
#define pGetComp(p)
Component.
int posInL110(const LSet set, const int length, LObject *p, const kStrategy)
#define pLtCmpOrdSgnDiffP(p, q)
int posInT0(const TSet, const int length, LObject &)
static poly p_Copy(poly p, const ring r)
returns a copy of p
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void enterExtendedSpoly(poly h, kStrategy strat)
static FORCE_INLINE number n_Ann(number a, const coeffs r)
if r is a ring with zero divisors, return an annihilator!=0 of b otherwise return NULL ...
BOOLEAN(* syzCrit)(poly sig, unsigned long not_sevSig, kStrategy strat)
char completeReduce_retry
void initenterpairsShift(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
void kStratInitChangeTailRing(kStrategy strat)
static poly redBba(poly h, int maxIndex, kStrategy strat)
int posInLSig(const LSet set, const int length, LObject *p, const kStrategy)
long pLDeg1c_Deg(poly p, int *l, const ring r)
pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring, ring)
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
BOOLEAN kPosInLDependsOnLength(int(*pos_in_l)(const LSet set, const int length, LObject *L, const kStrategy strat))
void enterT(LObject &p, kStrategy strat, int atT)
poly prMapR(poly src, nMapFunc nMap, ring src_r, ring dest_r)
int redHoney(LObject *h, kStrategy strat)
void p_Cleardenom_n(poly ph, const ring r, number &c)
poly p_LPshift(poly p, int sh, int uptodeg, int lV, const ring r)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
void updateSShift(kStrategy strat, int uptodeg, int lV)
#define pFalseReturn(cond)
BOOLEAN p_CheckPolyRing(poly p, ring r)
#define omReallocSize(addr, o_size, size)
void(* initEcart)(TObject *L)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pGetExp(p, i)
Exponent.
int posInSMonFirst(const kStrategy strat, const int length, const poly p, const int ecart_p)
void(* enterOnePair)(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
void initS(ideal F, ideal Q, kStrategy strat)
void enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV)
int posInT11(const TSet set, const int length, LObject &p)
static int rBlocks(ring r)
void initSSpecial(ideal F, ideal Q, ideal P, kStrategy strat)
int posInT17_c(const TSet set, const int length, LObject &p)
int posInLF5CRing(const LSet set, int start, const int length, LObject *p, const kStrategy strat)
long p_Deg(poly a, const ring r)
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
void chainCritRing(poly p, int, kStrategy strat)
int posInT11Ring(const TSet set, const int length, LObject &p)
KINLINE TObject * S_2_T(int i)
void kBucketDestroy(kBucket_pt *bucket_pt)
void initEcartPairMora(LObject *Lp, poly, poly, int ecartF, int ecartG)
#define TEST_OPT_INTSTRATEGY
static void p_SetCompP(poly p, int i, ring r)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define TEST_OPT_NOT_SUGAR
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ...
static void enlargeT(TSet &T, TObject **&R, unsigned long *&sevT, int &length, const int incr)
int posInL11Ring(const LSet set, const int length, LObject *p, const kStrategy strat)
const CanonicalForm CFMap CFMap & N
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int syzComp
BOOLEAN isInPairsetL(int length, poly p1, poly p2, int *k, kStrategy strat)
void enterExtendedSpolySig(poly h, poly hSig, kStrategy strat)
void initHilbCrit(ideal, ideal, intvec **hilb, kStrategy strat)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
void enterOnePairSpecial(int i, poly p, int ecart, kStrategy strat, int atR=-1)
long p_WFirstTotalDegree(poly p, const ring r)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
void initEcartBBA(TObject *h)
int posInT17Ring(const TSet set, const int length, LObject &p)
void messageStatSBA(int hilbcount, kStrategy strat)
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
void enterOneZeroPairRing(poly f, poly t_p, poly p, int ecart, kStrategy strat, int atR=-1)
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z:...
long pLDeg0(poly p, int *l, const ring r)
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
#define pp_Test(p, lmRing, tailRing)
BOOLEAN pCompareChain(poly p, poly p1, poly p2, poly lcm, const ring R)
Returns TRUE if.
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
long kHomModDeg(poly p, ring r)
poly pMoveCurrTail2poly(poly p, kStrategy strat)
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
BOOLEAN enterOneStrongPolySig(int i, poly p, poly sig, int, int, kStrategy strat, int atR)
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted ...
static long p_FDeg(const poly p, const ring r)
static int p_LmCmp(poly p, poly q, const ring r)
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject *T, unsigned long expbound)
int posInL0(const LSet set, const int length, LObject *p, const kStrategy)
#define pIsConstant(p)
like above, except that Comp might be != 0
TObject * kFindDivisibleByInS(kStrategy strat, int pos, LObject *L, TObject *T, long ecart)
void initBuchMoraCrit(kStrategy strat)
static poly p_ShallowCopyDelete(poly p, const ring r, omBin bin)
static int si_max(const int a, const int b)
int posInL17_c(const LSet set, const int length, LObject *p, const kStrategy)
static void p_ExpVectorCopy(poly d_p, poly s_p, const ring r)
void exitSba(kStrategy strat)
void rDebugPrint(const ring r)
void PrintS(const char *s)
void kDebugPrint(kStrategy strat)
Output some debug info about a given strategy.
int isInV(poly p, int lV)
void deleteHC(LObject *L, kStrategy strat, BOOLEAN fromNext)
void superenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
static void p_ExpVectorAdd(poly p1, poly p2, const ring r)
int posInT17(const TSet set, const int length, LObject &p)
static poly p_LmFreeAndNext(poly p, ring)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
void deleteInSSba(int i, kStrategy strat)
static FORCE_INLINE int n_DivComp(number a, number b, const coeffs r)
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static FORCE_INLINE number n_Lcm(number a, number b, const coeffs r)
in Z: return the lcm of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
omBin omGetStickyBinOfBin(omBin bin)
void initBuchMoraShift(ideal F, ideal Q, kStrategy strat)
BOOLEAN rHasMixedOrdering(const ring r)
void enterT_strong(LObject &p, kStrategy strat, int atT)
static void enlargeL(LSet *L, int *length, const int incr)
static BOOLEAN _p_LmDivisibleByPart(poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
static int index(p_Length length, p_Ord ord)
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
void rChangeCurrRing(ring r)
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether)
poly redtailBba_Z(LObject *L, int pos, kStrategy strat)
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat)
BOOLEAN arriRewCriterion(poly, unsigned long, poly, kStrategy strat, int start=0)
void enterSMoraNF(LObject &p, int atS, kStrategy strat, int atR=-1)
#define rRing_has_Comp(r)
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
static void p_Delete(poly *p, const ring r)
static FORCE_INLINE number n_ExtGcd(number a, number b, number *s, number *t, const coeffs r)
beware that ExtGCD is only relevant for a few chosen coeff. domains and may perform something unexpec...
unsigned long p_GetShortExpVector(const poly p, const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
poly p_LPshiftT(poly p, int sh, int uptodeg, int lV, kStrategy strat, const ring r)
void kMergeBintoLSba(kStrategy strat)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
void initenterzeropairsRing(poly p, int ecart, kStrategy strat, int atR)
poly(* pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r, omBin dest_bin)
returns a poly from dest_r which is a ShallowCopy of s_p from source_r assumes that source_r->N == de...
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int)
#define TEST_OPT_SUGARCRIT
BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat)
void(* chainCrit)(poly p, int ecart, kStrategy strat)
void initPairtest(kStrategy strat)
long pLDegb(poly p, int *l, const ring r)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void postReduceByMon(LObject *h, kStrategy strat)
used for GB over ZZ: intermediate reduction by monomial elements background: any known constant eleme...
BOOLEAN p_CheckIsFromRing(poly p, ring r)
static BOOLEAN rField_is_Ring(const ring r)
void cleanT(kStrategy strat)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
void pEnlargeSet(poly **p, int l, int increment)
long pLDeg1_Totaldegree(poly p, int *l, const ring r)
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
int redEcart(LObject *h, kStrategy strat)
#define pLtCmpOrdSgnEqP(p, q)
BOOLEAN rHasGlobalOrdering(const ring r)
void rDelete(ring r)
unconditionally deletes fields in r
long ind_fact_2(long arg)
int posInSyz(const kStrategy strat, poly sig)
BOOLEAN enterOneStrongPoly(int i, poly p, int, int, kStrategy strat, int atR, bool enterTstrong)
int posInT110(const TSet set, const int length, LObject &p)
void enterOnePairRing(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
#define pInit()
allocates a new monomial and initializes everything to 0
#define TEST_OPT_CANCELUNIT
void initSbaCrit(kStrategy strat)
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
#define omSizeWOfBin(bin_ptr)
void updateS(BOOLEAN toT, kStrategy strat)
int posInT110Ring(const TSet set, const int length, LObject &p)
static bool rIsSCA(const ring r)
void completeReduce(kStrategy strat, BOOLEAN withT)
int posInL0Ring(const LSet set, const int length, LObject *p, const kStrategy)
#define REDTAIL_CANONICALIZE
BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat)
void chainCritOpt_1(poly, int, kStrategy strat)
void rKillModifiedRing(ring r)
long maxdegreeWecart(poly p, int *l, ring r)
void enterOnePairLift(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
static void p_Setm(poly p, const ring r)
void updateResult(ideal r, ideal Q, kStrategy strat)
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
KINLINE TObject * s_2_t(int i)
long pLDeg1_WFirstTotalDegree(poly p, int *l, const ring r)
int redFirst(LObject *h, kStrategy strat)
int posInLSpecial(const LSet set, const int length, LObject *p, const kStrategy)
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring tailRing)
static nc_type & ncRingType(nc_struct *p)
static intset initec(const int maxnr)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
static int pDivCompRing(poly p, poly q)
long pLDeg1c_WFirstTotalDegree(poly p, int *l, const ring r)
poly pCopyL2p(LObject H, kStrategy strat)
int idElem(const ideal F)
count non-zero elements
int dReportError(const char *fmt,...)
#define ALLOW_PROD_CRIT(A)
static poly p_Neg(poly p, const ring r)
static void p_LmDelete(poly p, const ring r)
BOOLEAN isInPairsetB(poly q, int *k, kStrategy strat)
long p_WTotaldegree(poly p, const ring r)
static poly redMora(poly h, int maxIndex, kStrategy strat)
void kMergeBintoL(kStrategy strat)
void p_wrp(poly p, ring lmRing, ring tailRing)
void p_Write(poly p, ring lmRing, ring tailRing)
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
int kFindDivisibleByInT(const kStrategy strat, const LObject *L, const int start)
return -1 if no divisor is found number of first divisor in T, otherwise
BOOLEAN newHEdge(kStrategy strat)
int posInT19(const TSet set, const int length, LObject &p)
poly redtailBbaShift(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
void initEcartNormal(TObject *h)
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r1, const ring r2)
static LSet initL(int nr=setmaxL)
static poly p_Add_q(poly p, poly q, const ring r)
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
int posInT_EcartpLength(const TSet set, const int length, LObject &p)
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
KINLINE poly kNoetherTail()
static BOOLEAN sugarDivisibleBy(int ecart1, int ecart2)
void enterOnePairManyShifts(int i, poly p, int ecart, int isFromQ, kStrategy strat, int, int uptodeg, int lV)
poly p_Cleardenom(poly p, const ring r)
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
void chainCritPart(poly p, int ecart, kStrategy strat)
void nKillChar(coeffs r)
undo all initialisations
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static poly p_Mult_q(poly p, poly q, const ring r)
void enterOnePairSelfShifts(poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int, int uptodeg, int lV)
void exitBuchMora(kStrategy strat)
pFDegProc pOrigFDeg_TailRing
#define ENTER_USE_MEMMOVE
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
void initenterstrongPairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void enterOnePairSigRing(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
static int p_LtCmpNoAbs(poly p, poly q, const ring r)
int posInT17_cRing(const TSet set, const int length, LObject &p)
int posInT13(const TSet set, const int length, LObject &p)
void enterSyz(LObject &p, kStrategy strat, int atT)
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
BOOLEAN p_OneComp(poly p, const ring r)
return TRUE if all monoms have the same component
#define pCopy(p)
return a copy of the poly
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
void kBucket_Add_q(kBucket_pt bucket, poly q, int *l)
Add to Bucket a poly ,i.e. Bpoly == q+Bpoly.
poly p_GetMaxExpP(poly p, const ring r)
return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0...
int posInLSigRing(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN pCompareChainPart(poly p, poly p1, poly p2, poly lcm, const ring R)
KINLINE long GetpFDeg() const