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);
415 printf(
"\nDoes not divide\n");
420 printf(
"\nDivides. Go On\n");
434 number eins=
nInit(1);
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_exp !=
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_exp !=
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')
806 if (
T->max_exp !=
NULL)
807 return dReportError(
"%c[%d].max_exp is not NULL as it should be", TN,
i);
811 if (
T->max_exp ==
NULL)
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 if (testp!=2) 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) && (testp!=2))
928 -1, strat->
T, strat->
tl));
931 if (strat->
T !=
NULL)
933 for (i=0; i<=strat->
tl; i++)
942 if (strat->
L !=
NULL)
947 for (i=0; i<=strat->
Ll; i++)
951 strat->
T, strat->
tl));
956 for (i=0; i<=strat->
Ll; i++)
959 strat->
L[i].Next() != strat->
tail,
i,
960 strat->
T, strat->
tl));
971 if (strat->
S !=
NULL)
981 for (i=0; i<=strat->
sl; i++)
983 if (strat->
S[i] !=
NULL &&
986 return dReportError(
"S[%d] wrong sev: has %o, specified to have %o",
999 kFalseReturn(
kTest(strat));
1002 for (i=0; i<=strat->
tl; i++)
1004 if (strat->
T[i].i_r < 0 || strat->
T[i].i_r > strat->
tl)
1005 return dReportError(
"strat->T[%d].i_r == %d out of bounds", i,
1007 if (strat->
R[strat->
T[i].i_r] != &(strat->
T[i]))
1008 return dReportError(
"T[%d].i_r with R out of sync", i);
1011 if (strat->
S !=
NULL)
1013 for (i=0; i<=strat->
sl; i++)
1018 if (strat->
S_2_R[i] != strat->
T[j].i_r)
1020 i, strat->
S_2_R[i], j, strat->
T[j].i_r);
1024 #ifdef HAVE_SHIFTBBA 1027 for (i=0; i<=strat->
Ll; i++)
1029 if (strat->
L[i].p1 !=
NULL && strat->
L[i].p2)
1031 if (strat->
L[i].i_r1 < 0 ||
1032 strat->
L[i].i_r1 > strat->
tl ||
1033 strat->
L[i].T_1(strat)->p != strat->
L[
i].p1)
1035 if (strat->
L[i].i_r2 < 0 ||
1036 strat->
L[i].i_r2 > strat->
tl ||
1037 strat->
L[i].T_2(strat)->p != strat->
L[
i].p2)
1042 if (strat->
L[i].i_r1 != -1)
1044 if (strat->
L[i].i_r2 != -1)
1047 if (strat->
L[i].i_r != -1)
1060 #ifdef ENTER_USE_MEMMOVE 1061 memmove(&(strat->
S[i]), &(strat->
S[i+1]), (strat->
sl - i)*
sizeof(
poly));
1062 memmove(&(strat->
ecartS[i]),&(strat->
ecartS[i+1]),(strat->
sl - i)*
sizeof(
int));
1063 memmove(&(strat->
sevS[i]),&(strat->
sevS[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1064 memmove(&(strat->
S_2_R[i]),&(strat->
S_2_R[i+1]),(strat->
sl - i)*
sizeof(
int));
1067 for (j=i; j<strat->
sl; j++)
1069 strat->
S[
j] = strat->
S[j+1];
1077 #ifdef ENTER_USE_MEMMOVE 1078 memmove(&(strat->
lenS[i]),&(strat->
lenS[i+1]),(strat->
sl - i)*
sizeof(
int));
1080 for (j=i; j<strat->
sl; j++) strat->
lenS[j] = strat->
lenS[j+1];
1085 #ifdef ENTER_USE_MEMMOVE 1088 for (j=i; j<strat->
sl; j++) strat->
lenSw[j] = strat->
lenSw[j+1];
1093 #ifdef ENTER_USE_MEMMOVE 1094 memmove(&(strat->
fromQ[i]),&(strat->
fromQ[i+1]),(strat->
sl - i)*
sizeof(
int));
1096 for (j=i; j<strat->
sl; j++)
1112 #ifdef ENTER_USE_MEMMOVE 1113 memmove(&(strat->
S[i]), &(strat->
S[i+1]), (strat->
sl - i)*
sizeof(
poly));
1114 memmove(&(strat->
sig[i]), &(strat->
sig[i+1]), (strat->
sl - i)*
sizeof(
poly));
1115 memmove(&(strat->
ecartS[i]),&(strat->
ecartS[i+1]),(strat->
sl - i)*
sizeof(
int));
1116 memmove(&(strat->
sevS[i]),&(strat->
sevS[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1117 memmove(&(strat->
sevSig[i]),&(strat->
sevSig[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1118 memmove(&(strat->
S_2_R[i]),&(strat->
S_2_R[i+1]),(strat->
sl - i)*
sizeof(
int));
1121 for (j=i; j<strat->
sl; j++)
1123 strat->
S[
j] = strat->
S[j+1];
1124 strat->
sig[
j] = strat->
sig[j+1];
1133 #ifdef ENTER_USE_MEMMOVE 1134 memmove(&(strat->
lenS[i]),&(strat->
lenS[i+1]),(strat->
sl - i)*
sizeof(
int));
1136 for (j=i; j<strat->
sl; j++) strat->
lenS[j] = strat->
lenS[j+1];
1141 #ifdef ENTER_USE_MEMMOVE 1144 for (j=i; j<strat->
sl; j++) strat->
lenSw[j] = strat->
lenSw[j+1];
1149 #ifdef ENTER_USE_MEMMOVE 1150 memmove(&(strat->
fromQ[i]),&(strat->
fromQ[i+1]),(strat->
sl - i)*
sizeof(
int));
1152 for (j=i; j<strat->
sl; j++)
1208 if (*length > 0 && j < *length)
1210 #ifdef ENTER_USE_MEMMOVE 1211 memmove(&(
set[j]), &(
set[j+1]), (*length - j)*
sizeof(
LObject));
1214 for (i=j; i < (*length); i++)
1219 memset(&(
set[*length]),0,
sizeof(
LObject));
1230 assume(p.FDeg == p.pFDeg());
1235 if (at <= (*length))
1237 memmove(&((*
set)[at+1]), &((*set)[at]), ((*length)-at+1)*
sizeof(
LObject));
1239 for (
i=(*length)+1;
i>=at+1;
i--) (*
set)[
i] = (*set)[
i-1];
1253 h->FDeg = h->pFDeg();
1254 h->ecart = h->pLDeg() - h->FDeg;
1256 h->length=h->pLength=
pLength(h->p);
1261 h->FDeg = h->pFDeg();
1263 h->length=h->pLength=
pLength(h->p);
1268 Lp->FDeg = Lp->pFDeg();
1275 Lp->FDeg = Lp->pFDeg();
1276 (*Lp).ecart =
si_max(ecartF,ecartG);
1277 (*Lp).ecart = (*Lp).ecart- (Lp->FDeg -
p_FDeg((*Lp).lcm,
currRing));
1286 return (ecart1 <= ecart2);
1317 int j,compare,compareCoeff;
1321 h.ecart=0; h.length=0;
1340 for(j = strat->
Bl;j>=0;j--)
1345 printf(
"\nChainCrit in enteronepairring\n");
1351 printf(
"\nh - neue Paar\n");
1356 printf(
"\ncompare = %i\ncompareCoeff = %i\n",compare,compareCoeff);
1363 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1366 printf(
"\nGelöscht h\n");
1377 printf(
"\nGelöscht: B[j]\n");
1384 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1387 printf(
"\nGelöscht h\n");
1400 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1403 printf(
"\nGelöscht h\n");
1414 printf(
"\nGelöscht: B[j]\n");
1424 printf(
"\nTrying to add spair S[%i] und p\n",i);
pWrite(strat->
S[i]);
pWrite(p);
1496 printf(
"\nThis is afterwards:\n");
1499 h.i_r1 = -1;h.i_r2 = -1;
1509 h.i_r2 = strat->
S_2_R[
i];
1515 posx = strat->
posInL(strat->
B,strat->
Bl,&h,strat);
1520 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);
1591 PrintS(
"\n--- create strong gcd poly: ");
1592 Print(
"\n p: %d", i);
1594 Print(
"\n strat->S[%d]: ", i);
1618 h.i_r1 = -1;h.i_r2 = -1;
1624 h.p1 =
p;h.p2 = strat->
S[
i];
1628 h.i_r2 = strat->
S_2_R[
i];
1639 posx = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
1644 if(h.IsNull())
return FALSE;
1658 printf(
"\nThis strong poly was added to L:\n");
pWrite(h.p);
pWrite(h.p1);
pWrite(h.p2);
1665 if(strat->
sl < 0)
return FALSE;
1667 for(i=0;i<strat->
sl;i++)
1693 if(pairsig!=
NULL &&
pLtCmp(pairsig,h->sig) == 0)
1696 printf(
"\nCan replace * (sig = *) with * (sig = *) since of * with sig *\n");
1708 h->i_r1 = -1;h->i_r2 = -1;
1778 PrintS(
"\n--- create strong gcd poly: ");
1779 Print(
"\n p: %d", i);
1781 Print(
"\n strat->S[%d]: ", i);
1805 if(
pLmCmp(pSigMult,sSigMult) == 0)
1814 if(
pLtCmp(pSigMult,sSigMult)==1)
1834 h.i_r1 = -1;h.i_r2 = -1;
1840 printf(
"\nPossible sigdrop in enterpairstrongSig (due to lost of sig)\n");
1845 int red_result =
redRing(&h,strat);
1847 printf(
"\nAfter redRing reduce:\n");
pWrite(h.p);
1853 printf(
"\nCancel the sigdrop. It reduced to 0\n");
1862 printf(
"\nSigdrop. end\n");
1864 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1866 strat->
enterS(h,0,strat,strat->
tl);
1873 h.sig =
pNeg(h.sig);
1880 printf(
"\nSigDrop in enteronestrongpolySig\n");
1887 int red_result =
redRing(&h,strat);
1892 printf(
"\nCancel the sigdrop after redRing (=0)\n");
1901 printf(
"\nAfter redRing still sigdrop:\n");
pWrite(h.p);
1903 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1906 strat->
enterS(h,0,strat, strat->
tl+1);
1918 printf(
"\nSigDrop in strongpair\noriginals: ");
pWrite(sig);
pWrite(strat->
sig[i]);
1919 printf(
"\nnow: ");
pWrite(pairsig);
1923 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1924 strat->
enterS(h,strat->
sl+1,strat,strat->
tl+1);
1927 h.p1 =
p;h.p2 = strat->
S[
i];
1931 h.i_r2 = strat->
S_2_R[
i];
1961 Lp.ecart=0; Lp.length=0;
1966 #ifndef HAVE_RATGRING 1967 pLcm(p,strat->
S[i],Lp.lcm);
1968 #elif defined(HAVE_RATGRING) 1972 pLcm(p,strat->
S[i],Lp.lcm);
1979 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
2019 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2024 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2079 for(j = strat->
Bl;j>=0;j--)
2081 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2085 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2111 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2178 Lp.p1 = strat->
S[
i];
2192 Lp.i_r1 = strat->
S_2_R[
i];
2208 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2246 Lp.ecart=0; Lp.length=0;
2253 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
2293 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2298 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2349 for(j = strat->
Bl;j>=0;j--)
2351 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2355 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2377 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2405 Lp.p1 = strat->
S[
i];
2412 Lp.i_r1 = strat->
S_2_R[
i];
2427 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2451 unsigned long pSigMultNegSev,sSigMultNegSev;
2455 Lp.ecart=0; Lp.length=0;
2460 #ifndef HAVE_RATGRING 2461 pLcm(p,strat->
S[i],Lp.lcm);
2462 #elif defined(HAVE_RATGRING) 2466 pLcm(p,strat->
S[i],Lp.lcm);
2492 PrintS(
"----------------\n");
2495 PrintS(
"----------------\n");
2501 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2522 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2523 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2524 || strat->
rewCrit1(sSigMult,sSigMultNegSev,Lp.lcm,strat,i+1)
2547 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2601 Lp.sevSig = ~pSigMultNegSev;
2608 Lp.sevSig = ~sSigMultNegSev;
2619 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
2633 Lp.checked = strat->
sl+1;
2640 Lp.prod_crit =
TRUE;
2652 PrintS(
"SIGNATURE OF PAIR: ");
2656 Lp.p1 = strat->
S[
i];
2670 Lp.i_r1 = strat->
S_2_R[
i];
2699 printf(
"\nTrying to add p and S[%i]\n",i);
2729 unsigned long pSigMultNegSev,sSigMultNegSev;
2733 Lp.ecart=0; Lp.length=0;
2738 #ifndef HAVE_RATGRING 2739 pLcm(p,strat->
S[i],Lp.lcm);
2740 #elif defined(HAVE_RATGRING) 2744 pLcm(p,strat->
S[i],Lp.lcm);
2758 printf(
"\nIn Spoly: m1, m2 :\n");
pWrite(m1);
pWrite(m2);
2779 if(pSigMult !=
NULL)
2782 if(sSigMult !=
NULL)
2786 Print(
"----------------\n");
2789 Print(
"----------------\n");
2793 if(pSigMult !=
NULL && sSigMult !=
NULL)
2802 if(pSigMult ==
NULL)
2804 if(sSigMult ==
NULL)
2814 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2824 printf(
"\nPossible sigdrop in enterpairSig (due to lost of sig)\n");
2839 int red_result =
redRing(&Lp,strat);
2841 printf(
"\nAfter redRing reduce:\n");
pWrite(Lp.p);
2847 printf(
"\nCancel the sigdrop. It reduced to 0\n");
2856 printf(
"\nSigdrop. end\n");
2858 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
2860 strat->
enterS(Lp,0,strat,strat->
tl);
2874 Lp.sig =
pCopy(pSigMult);
2903 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2904 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2910 printf(
"\nDELETED!\n");
2932 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2989 Lp.sig =
pNeg(Lp.sig);
3000 Lp.sevSig = ~pSigMultNegSev;
3007 Lp.sevSig = ~sSigMultNegSev;
3019 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
3023 printf(
"\nrewCrit3 deletes it!\n");
3036 Lp.checked = strat->
sl+1;
3043 Lp.prod_crit =
TRUE;
3055 PrintS(
"SIGNATURE OF PAIR: ");
3059 Lp.p1 = strat->
S[
i];
3074 Lp.i_r1 = strat->
S_2_R[
i];
3093 printf(
"\nSigDrop in enteronepairSig\n");
pWrite(Lp.sig);
3099 int red_result =
redRing(&Lp,strat);
3104 printf(
"\nCancel the sigdrop after redRing (=0)\n");
3113 printf(
"\nAfter redRing still sigdrop:\n");
pWrite(Lp.p);
3115 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
3118 strat->
enterS(Lp,0,strat, strat->
tl+1);
3124 printf(
"\nThis spair was added to B:\n");
3177 Lp.p1 = strat->
S[
i];
3181 Lp.i_r1 = strat->
S_2_R[
i];
3196 l = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
3207 int j=strat->
Ll+strat->
Bl+1;
3215 for (i=strat->
Bl; i>=0; i--)
3217 j = strat->
posInL(strat->
L,j,&(strat->
B[i]),strat);
3228 int j=strat->
Ll+strat->
Bl+1;
3236 for (i=strat->
Bl; i>=0; i--)
3238 j = strat->
posInLSba(strat->
L,j,&(strat->
B[i]),strat);
3259 for (j=0; j<=strat->
sl; j++)
3263 for (i=strat->
Bl; i>=0; i--)
3285 for (j=strat->
Ll; j>=0; j--)
3291 if (strat->
L[j].p == strat->
tail)
3311 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3337 for (j=strat->
Ll; j>=0; j--)
3357 for(i=j-1; i>=0; i--)
3359 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3376 for (j=strat->
Ll; j>=0; j--)
3407 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3410 if (strat->
L[j].p2 == p)
3416 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3430 strat->
L[
i].p2 = strat->
tail;
3447 else if (strat->
L[j].p2 == strat->
tail)
3486 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3489 if (strat->
L[j].p2 == p)
3495 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3509 strat->
L[
i].p2 = strat->
tail;
3526 else if (strat->
L[j].p2 == strat->
tail)
3534 #ifdef HAVE_RATGRING 3547 for (j=0; j<=strat->
sl; j++)
3551 for (i=strat->
Bl; i>=0; i--)
3559 Print(
"chain-crit-part: S[%d]=",j);
3561 Print(
" divide B[%d].lcm=",i);
3583 for (j=strat->
Ll; j>=0; j--)
3589 if (strat->
L[j].p == strat->
tail)
3593 PrintS(
"chain-crit-part: pCompareChainPart p=");
3595 Print(
" delete L[%d]",j);
3617 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3624 Print(
"chain-crit-part: sugar B[%d].lcm=",j);
3626 Print(
" delete B[%d]",i);
3637 Print(
"chain-crit-part: sugar B[%d].lcm=",i);
3639 Print(
" delete B[%d]",j);
3659 for (j=strat->
Ll; j>=0; j--)
3667 PrintS(
"chain-crit-part: sugar:pCompareChainPart p=");
3669 Print(
" delete L[%d]",j);
3687 for(i=j-1; i>=0; i--)
3689 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3693 Print(
"chain-crit-part: equal lcm B[%d].lcm=",j);
3695 Print(
" delete B[%d]\n",i);
3712 for (j=strat->
Ll; j>=0; j--)
3720 PrintS(
"chain-crit-part: pCompareChainPart p=");
3722 Print(
" delete L[%d]",j);
3751 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3754 if (strat->
L[j].p2 == p)
3760 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3777 strat->
L[
i].p2 = strat->
tail;
3784 PrintS(
"chain-crit-part: divisible_by p=");
3786 Print(
" delete L[%d]",l);
3797 PrintS(
"chain-crit-part: divisible_by(2) p=");
3799 Print(
" delete L[%d]",i);
3810 else if (strat->
L[j].p2 == strat->
tail)
3838 for (j=0; j<=
k; j++)
3840 if (!strat->
fromQ[j])
3851 for (j=0; j<=
k; j++)
3854 PrintS(
"\n Trying to add spoly : \n");
3865 for (j=0; j<=
k; j++)
3878 #ifdef HAVE_RATGRING 3908 for (j=0; j<=
k; j++)
3910 if (!strat->
fromQ[j])
3921 for (j=0; j<=
k; j++)
3930 for (j=0; j<=
k; j++)
3944 #ifdef HAVE_RATGRING 3967 for (j=0; j<=k && !strat->
sigdrop; j++)
3969 if (!strat->
fromQ[j])
3978 for (j=0; j<=k && !strat->
sigdrop; j++)
3987 for (j=0; j<=k && !strat->
sigdrop; j++)
4001 #ifdef HAVE_RATGRING 4029 for (j=0; j<=strat->
sl; j++)
4033 for (i=strat->
Bl; i>=0; i--)
4040 PrintS(
"--- chain criterion func chainCritRing type 1\n");
4043 PrintS(
" strat->B[i].lcm:");
4048 wrp(strat->
B[i].lcm);
4053 printf(
"\nChainCrit1\n");
4069 for (j=strat->
Ll; j>=0; j--)
4078 printf(
"\nChainCrit2\n");
4088 PrintS(
"--- chain criterion func chainCritRing type 2\n");
4089 PrintS(
"strat->L[j].p:");
4120 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
4123 if (strat->
L[j].p2 == p)
4131 &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
4138 PrintS(
"--- chain criterion func chainCritRing type 3\n");
4139 PrintS(
"strat->L[j].lcm:");
4140 wrp(strat->
L[j].lcm);
4141 PrintS(
" strat->L[i].lcm:");
4142 wrp(strat->
L[i].lcm);
4147 printf(
"\nChainCrit3\n");
4162 strat->
L[
i].p2 = strat->
tail;
4179 else if (strat->
L[j].p2 == strat->
tail)
4193 if (arg <= 0)
return 0;
4205 if (arg <= 0)
return 0;
4206 if (arg%2 == 1) { arg--; }
4216 #ifdef HAVE_VANIDEAL 4227 int l,
j,compare,compareCoeff;
4231 Lp.ecart=0; Lp.length=0;
4244 for(j = strat->
Bl;j>=0;j--)
4248 if (compareCoeff == 0 || compare == compareCoeff)
4266 if (compareCoeff == 1)
4273 if (compareCoeff == -1)
4284 if ((f==
NULL) || (p==
NULL))
return;
4316 tmp_h.SetShortExpVector();
4321 enterT(tmp_h, strat, strat->
tl + 1);
4326 Lp.i_r1 = strat->
tl;
4330 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
4344 if ((*cabsind < bound) && (*cabsind - step[1] + add < bound))
4353 if (N == 1)
return 0;
4355 while (exp[i] == cexp[i] && i <= N) i++;
4357 *cabsind -= cind[
i];
4360 *cabsind += cind[
i];
4363 if (i > N)
return 0;
4367 for (
int j = i + 1;
j <=
N;
j++)
4369 if (step[1] > step[
j]) step[1] = step[
j];
4371 add =
ind2(cexp[i] + 2);
4372 if (*cabsind - step[1] + add >= bound)
4375 *cabsind -= cind[
i];
4377 *cabsind += cind[
i];
4380 if (i > N)
return 0;
4383 }
while (step[1] != -1);
4388 if (add < step[i]) step[
i] =
add;
4389 for (i = 2; i <=
N; i++)
4391 if (step[1] > step[i]) step[1] = step[
i];
4417 for (
int i = 1; i <= leadRing->N; i++)
4423 if (cabsind < leadRing->ch)
4425 zeroPoly =
p_ISet(
twoPow(leadRing->ch - cabsind), tailRing);
4429 zeroPoly =
p_ISet(1, tailRing);
4431 for (
int i = 1; i <= leadRing->N; i++)
4433 for (
long j = 1;
j <= exp[
i];
j++)
4436 tmp2 =
p_ISet(1, tailRing);
4441 zeroPoly =
p_Mult_q(zeroPoly, tmp2, tailRing);
4446 zeroPoly =
p_Mult_q(zeroPoly,
p_Add_q(tmp3, tmp2, tailRing), tailRing);
4451 for (
int i = 1; i <= leadRing->N; i++)
4457 zeroPoly =
pNext(zeroPoly);
4459 pNext(tmp2) = zeroPoly;
4480 for (
int i = 1; i <=
currRing->N; i++)
4483 if (exp[i] & 1 != 0)
4485 exp[
i] = exp[
i] - 1;
4498 PrintS(
"-------------\npoly :");
4500 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
4501 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4502 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4504 Print(
"cind : %d\n", cabsind);
4521 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4546 for (
int i = 1; i <=
currRing->N; i++)
4557 PrintS(
"-------------\npoly :");
4559 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
4560 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4561 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4562 Print(
"bound : %d\n", bound);
4563 Print(
"cind : %d\n", cabsind);
4581 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4589 G0->m[
IDELEMS(G0) - 1] = zeroPoly;
4608 for (j=0; j<=
k; j++)
4630 for (j=0; j<=k && !strat->
sigdrop; j++)
4684 PrintS(
"--- create zero spoly: ");
4713 posx = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
4766 PrintS(
"--- create zero spoly: ");
4793 printf(
"\nSigdrop in enterextended spoly\n");
pWrite(h);
pWrite(hSig);
4797 int red_result =
redRing(&Lp,strat);
4799 printf(
"\nAfter redRing reduce:\n");
pWrite(Lp.p);
4805 printf(
"\nCancel the sigdrop. It reduced to 0\n");
4814 printf(
"\nSigdrop. end\n");
4816 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
4818 strat->
enterS(Lp,0,strat,strat->
tl);
4866 if ( (!strat->
fromT)
4876 clearS(h,h_sev, &j,&k,strat);
4904 printf(
"\n Trying to add extended spolys\n");
4909 printf(
"\n Trying to add spolys\n");
4914 printf(
"\n Trying to add gcd-polys\n");
4932 if ( (!strat->
fromT)
4940 clearS(h,h_sev, &j,&k,strat);
4957 if ( (!strat->
fromT)
4965 clearS(h,h_sev, &j,&k,strat);
4982 for (j=0; j<=
k; j++)
4984 const int iCompSj =
pGetComp(strat->
S[j]);
4985 if ((iCompH==iCompSj)
4996 for (j=0; j<=
k; j++)
4998 const int iCompSj =
pGetComp(strat->
S[j]);
4999 if ((iCompH==iCompSj)
5038 clearS(h,h_sev,&j,&k,strat);
5055 int new_suc=strat->
sl+1;
5059 for (; i<=strat->
sl; i++)
5064 if (new_suc > at) new_suc = at;
5067 sev = strat->
sevS[
i];
5070 for (j=i; j>=at+1; j--)
5072 strat->
S[
j] = strat->
S[j-1];
5079 strat->
sevS[at] = sev;
5080 strat->
S_2_R[at] = s2r;
5083 for (j=i; j>=at+1; j--)
5087 strat->
fromQ[at]=fq;
5091 if (new_suc <= strat->sl) *suc=new_suc;
5105 if(length==-1)
return 0;
5124 || ((o==oo) && (
pLmCmp(
set[length],p)!= cmp_int)))
5146 if (
pLmCmp(
set[length],p)== -cmp_int)
5154 if (cmp == cmp_int)
return an;
5155 if (cmp == -cmp_int)
return en;
5161 if (cmp == cmp_int) en =
i;
5162 else if (cmp == -cmp_int) an =
i;
5171 if (
pLmCmp(
set[length],p)== -cmp_int)
5178 if (
pLmCmp(
set[an],p) == cmp_int)
return an;
5179 if (
pLmCmp(
set[an],p) == -cmp_int)
return en;
5181 && ((strat->
ecartS[an])>ecart_p))
5186 if (
pLmCmp(
set[i],p) == cmp_int) en=i;
5187 else if (
pLmCmp(
set[i],p) == -cmp_int) an=i;
5191 &&((strat->
ecartS[
i])<ecart_p))
5205 if (length<0)
return 0;
5210 for(
int i = 0;i<=
length;i++)
5219 || ((op == o) && (
pLtCmp(
set[mon],p) == -1)))
5230 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5237 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5249 || ((op == o) && (
pLtCmp(
set[length],p) == -1)))
5263 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5270 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5282 if(end < 0 || end >=
IDELEMS(F))
5284 if (end<0)
return 0;
5291 for(i=start;i<end;i++)
5305 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5312 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5337 if (length==-1)
return 0;
5339 if (
pLmCmp(
set[length].p,p.p)!=
currRing->OrdSgn)
return length+1;
5368 if (
set[length].length<p.length)
5379 if (
set[an].length>p.length)
return an;
5383 if (
set[i].length>p.length) en=
i;
5395 if (length==-1)
return 0;
5397 int o = p.GetpFDeg();
5398 int op =
set[
length].GetpFDeg();
5401 || ((op == o) && (
pLmCmp(
set[length].p,p.p) !=
currRing->OrdSgn)))
5412 op=
set[an].GetpFDeg();
5419 op =
set[
i].GetpFDeg();
5431 if (length==-1)
return 0;
5433 int o = p.GetpFDeg();
5434 int op =
set[
length].GetpFDeg();
5448 op=
set[an].GetpFDeg();
5455 op =
set[
i].GetpFDeg();
5472 if (length==-1)
return 0;
5473 int o = p.GetpFDeg();
5474 int op =
set[
length].GetpFDeg();
5479 if ((op < o) || (
pLmCmp(
set[length].p,p.p)== -cmp_int))
5486 op =
set[an].GetpFDeg();
5487 if (op > o)
return an;
5488 if (op < 0)
return en;
5489 cmp =
pLmCmp(
set[an].p,p.p);
5490 if (cmp == cmp_int)
return an;
5491 if (cmp == -cmp_int)
return en;
5496 op =
set[
i].GetpFDeg();
5498 else if (op < o) an =
i;
5501 cmp =
pLmCmp(
set[i].p,p.p);
5502 if (cmp == cmp_int) en =
i;
5503 else if (cmp == -cmp_int) an =
i;
5549 if (length==-1)
return 0;
5551 int o = p.GetpFDeg();
5552 int op =
set[
length].GetpFDeg();
5555 || (( op == o) && (
set[length].length<p.length))
5556 || (( op == o) && (
set[length].length == p.length)
5567 op =
set[an].GetpFDeg();
5569 || (( op == o) && (
set[an].length > p.length))
5570 || (( op == o) && (
set[an].length == p.length)
5576 op =
set[
i].GetpFDeg();
5578 || (( op == o) && (
set[i].length > p.length))
5579 || (( op == o) && (
set[i].length == p.length)
5591 if (length==-1)
return 0;
5593 int o = p.GetpFDeg();
5594 int op =
set[
length].GetpFDeg();
5597 || (( op == o) && (
set[length].length<p.length))
5598 || (( op == o) && (
set[length].length == p.length)
5609 op =
set[an].GetpFDeg();
5611 || (( op == o) && (
set[an].length > p.length))
5612 || (( op == o) && (
set[an].length == p.length)
5618 op =
set[
i].GetpFDeg();
5620 || (( op == o) && (
set[i].length > p.length))
5621 || (( op == o) && (
set[i].length == p.length)
5637 if (length==-1)
return 0;
5639 int o = p.GetpFDeg();
5666 int ol = p.GetpLength();
5667 if (length==-1)
return 0;
5671 int oo=
set[
length].ecart;
5672 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
5682 int oo=
set[an].ecart;
5684 || ((oo==op) && (
set[an].
pLength > ol)))
5689 int oo=
set[
i].ecart;
5691 || ((oo == op) && (
set[i].
pLength > ol)))
5723 if (length==-1)
return 0;
5725 int o = p.GetpFDeg() + p.ecart;
5740 op =
set[an].GetpFDeg()+
set[an].ecart;
5747 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5759 if (length==-1)
return 0;
5761 int o = p.GetpFDeg() + p.ecart;
5776 op =
set[an].GetpFDeg()+
set[an].ecart;
5783 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5820 if (length==-1)
return 0;
5822 int o = p.GetpFDeg() + p.ecart;
5826 || (( op == o) && (
set[length].ecart > p.ecart))
5827 || (( op == o) && (
set[length].ecart==p.ecart)
5838 op =
set[an].GetpFDeg()+
set[an].ecart;
5840 || (( op == o) && (
set[an].ecart < p.ecart))
5841 || (( op == o) && (
set[an].ecart==p.ecart)
5847 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5849 || (( op == o) && (
set[i].ecart < p.ecart))
5850 || (( op == o) && (
set[i].ecart == p.ecart)
5861 if (length==-1)
return 0;
5863 int o = p.GetpFDeg() + p.ecart;
5867 || (( op == o) && (
set[length].ecart > p.ecart))
5868 || (( op == o) && (
set[length].ecart==p.ecart)
5879 op =
set[an].GetpFDeg()+
set[an].ecart;
5881 || (( op == o) && (
set[an].ecart < p.ecart))
5882 || (( op == o) && (
set[an].ecart==p.ecart)
5888 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5890 || (( op == o) && (
set[i].ecart < p.ecart))
5891 || (( op == o) && (
set[i].ecart == p.ecart)
5907 if (length==-1)
return 0;
5911 int o = p.GetpFDeg() + p.ecart;
5914 if (
pGetComp(
set[length].p)*cc < c)
5916 if (
pGetComp(
set[length].p)*cc == c)
5920 || ((op == o) && (
set[length].ecart > p.ecart))
5921 || ((op == o) && (
set[length].ecart==p.ecart)
5937 int op =
set[an].GetpFDeg()+
set[an].ecart;
5939 || ((op == o) && (
set[an].ecart < p.ecart))
5940 || ((op == o) && (
set[an].ecart==p.ecart)
5949 else if (
pGetComp(
set[i].p)*cc == c)
5951 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
5953 || ((op == o) && (
set[i].ecart < p.ecart))
5954 || ((op == o) && (
set[i].ecart == p.ecart)
5968 if (length==-1)
return 0;
5972 int o = p.GetpFDeg() + p.ecart;
5975 if (
pGetComp(
set[length].p)*cc < c)
5977 if (
pGetComp(
set[length].p)*cc == c)
5981 || ((op == o) && (
set[length].ecart > p.ecart))
5982 || ((op == o) && (
set[length].ecart==p.ecart)
5998 int op =
set[an].GetpFDeg()+
set[an].ecart;
6000 || ((op == o) && (
set[an].ecart < p.ecart))
6001 || ((op == o) && (
set[an].ecart==p.ecart)
6010 else if (
pGetComp(
set[i].p)*cc == c)
6012 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
6014 || ((op == o) && (
set[i].ecart < p.ecart))
6015 || ((op == o) && (
set[i].ecart == p.ecart)
6035 if (length==-1)
return 0;
6038 int op=p.GetpFDeg();
6040 if (
set[length].ecart < o)
6042 if (
set[length].ecart == o)
6044 int oo=
set[
length].GetpFDeg();
6045 if ((oo < op) || ((oo==op) && (
set[length].length < p.length)))
6056 if (
set[an].ecart > o)
6058 if (
set[an].ecart == o)
6060 int oo=
set[an].GetpFDeg();
6062 || ((oo==op) && (
set[an].length > p.length)))
6068 if (
set[i].ecart > o)
6070 else if (
set[i].ecart == o)
6072 int oo=
set[
i].GetpFDeg();
6074 || ((oo == op) && (
set[i].length > p.length)))
6092 if (length<0)
return 0;
6094 int d=p->GetpFDeg();
6095 int op=
set[
length].GetpFDeg();
6098 || ((op == d) && (p->p1!=
NULL)&&(
set[length].p1==
NULL))
6109 op=
set[an].GetpFDeg();
6111 || ((op == d) && (p->p1!=
NULL) && (
set[an].p1==
NULL))
6117 op=
set[
i].GetpFDeg();
6119 || ((op==d) && (p->p1!=
NULL) && (
set[i].p1==
NULL))
6135 if (length<0)
return 0;
6161 if (length<0)
return 0;
6193 if (length<0)
return 0;
6218 if (length<0)
return 0;
6232 cmp =
pLtCmp(
set[an].sig,p->sig);
6239 if (
set[an].
FDeg > p->FDeg)
6241 if (
set[an].FDeg < p->
FDeg)
6243 if (
set[an].FDeg == p->FDeg)
6245 cmp =
pLtCmp(
set[an].p,p->p);
6254 cmp =
pLtCmp(
set[i].sig,p->sig);
6261 if (
set[i].
FDeg > p->FDeg)
6263 if (
set[i].FDeg < p->
FDeg)
6265 if (
set[i].FDeg == p->FDeg)
6267 cmp =
pLtCmp(
set[i].p,p->p);
6280 if (length < 0)
return 0;
6281 if (
set[length].
FDeg > p->FDeg)
6283 if (
set[length].
FDeg == p->FDeg)
6284 if(
set[length].
GetpLength() > p->GetpLength())
6295 if (
set[an].
FDeg > p->FDeg)
6297 if(
set[an].
FDeg == p->FDeg)
6305 if(
nGreater(
set[an].p->coef, p->p->coef))
6320 if (
set[i].
FDeg > p->FDeg)
6324 if(
set[i].
FDeg == p->FDeg)
6332 if(
nGreater(
set[i].p->coef, p->p->coef))
6352 if (strat->
syzl==0)
return 0;
6357 int en= strat->
syzl-1;
6393 if (length<0)
return 0;
6395 int o = p->GetpFDeg();
6396 int op =
set[
length].GetpFDeg();
6399 || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6408 op =
set[an].GetpFDeg();
6415 op =
set[
i].GetpFDeg();
6435 if (length<0)
return 0;
6437 int o = p->GetpFDeg();
6438 int op =
set[
length].GetpFDeg();
6450 op =
set[an].GetpFDeg();
6457 op =
set[
i].GetpFDeg();
6469 if (length<0)
return 0;
6470 if(start == (length +1))
return (length+1);
6471 int o = p->GetpFDeg();
6472 int op =
set[
length].GetpFDeg();
6484 op =
set[an].GetpFDeg();
6491 op =
set[
i].GetpFDeg();
6505 if (length < 0)
return 0;
6515 if (
set[an].
FDeg > p->FDeg)
6517 if (
set[an].FDeg < p->
FDeg)
6519 if (
set[an].FDeg == p->FDeg)
6549 if (
set[i].
FDeg > p->FDeg)
6551 if (
set[i].FDeg < p->
FDeg)
6553 if (
set[i].FDeg == p->FDeg)
6593 if (coeff == 0)
return -1;
6596 while (tmp % 2 == 0)
6615 if (length < 0)
return 0;
6617 int o = p->GetpFDeg();
6618 int op =
set[
length].GetpFDeg();
6620 if ((op > o) || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6629 op =
set[an].GetpFDeg();
6630 if ((op > o) || ((op == o) && (
pLmCmp(
set[an].p,p->p) != -
currRing->OrdSgn)))
6635 op =
set[
i].GetpFDeg();
6636 if ((op > o) || ((op == o) && (
pLmCmp(
set[i].p,p->p) != -
currRing->OrdSgn)))
6691 if (length<0)
return 0;
6693 int o = p->GetpFDeg();
6694 int op =
set[
length].GetpFDeg();
6697 || ((op == o) && (
set[length].length >p->length))
6698 || ((op == o) && (
set[length].length <= p->length)
6708 op =
set[an].GetpFDeg();
6710 || ((op == o) && (
set[an].length >p->length))
6711 || ((op == o) && (
set[an].length <=p->length)
6717 op =
set[
i].GetpFDeg();
6719 || ((op == o) && (
set[i].length > p->length))
6720 || ((op == o) && (
set[i].length <= p->length)
6732 if (length<0)
return 0;
6734 int o = p->GetpFDeg();
6735 int op =
set[
length].GetpFDeg();
6738 || ((op == o) && (
set[length].length >p->length))
6739 || ((op == o) && (
set[length].length <= p->length)
6749 op =
set[an].GetpFDeg();
6751 || ((op == o) && (
set[an].length >p->length))
6752 || ((op == o) && (
set[an].length <=p->length)
6758 op =
set[
i].GetpFDeg();
6760 || ((op == o) && (
set[i].length > p->length))
6761 || ((op == o) && (
set[i].length <= p->length)
6779 if (length<0)
return 0;
6781 int o = p->GetpFDeg();
6814 if (length<0)
return 0;
6816 int o = p->GetpFDeg() + p->ecart;
6820 || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6829 op =
set[an].GetpFDeg() +
set[an].ecart;
6836 op =
set[
i].GetpFDeg() +
set[
i].ecart;
6849 if (length<0)
return 0;
6851 int o = p->GetpFDeg() + p->ecart;
6864 op =
set[an].GetpFDeg() +
set[an].ecart;
6871 op =
set[
i].GetpFDeg() +
set[
i].ecart;
6890 if (length<0)
return 0;
6892 int o = p->GetpFDeg() + p->ecart;
6894 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6895 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6896 && (
set[length].ecart > p->ecart))
6897 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6898 && (
set[length].ecart == p->ecart)
6908 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
6909 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6910 && (
set[an].ecart > p->ecart))
6911 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6912 && (
set[an].ecart == p->ecart)
6918 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
6919 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6920 && (
set[i].ecart > p->ecart))
6921 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6922 && (
set[i].ecart == p->ecart)
6934 if (length<0)
return 0;
6936 int o = p->GetpFDeg() + p->ecart;
6938 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6939 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6940 && (
set[length].ecart > p->ecart))
6941 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6942 && (
set[length].ecart == p->ecart)
6952 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
6953 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6954 && (
set[an].ecart > p->ecart))
6955 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6956 && (
set[an].ecart == p->ecart)
6962 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
6963 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6964 && (
set[i].ecart > p->ecart))
6965 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6966 && (
set[i].ecart == p->ecart)
6984 if (length<0)
return 0;
6988 unsigned long c =
pGetComp(p->p)*cc;
6989 int o = p->GetpFDeg() + p->ecart;
6991 if (
pGetComp(
set[length].p)*cc > c)
6993 if (
pGetComp(
set[length].p)*cc == c)
6995 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6996 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6997 && (
set[length].ecart > p->ecart))
6998 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6999 && (
set[length].ecart == p->ecart)
7014 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
7015 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7016 && (
set[an].ecart > p->ecart))
7017 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7018 && (
set[an].ecart == p->ecart)
7027 else if (
pGetComp(
set[i].p)*cc == c)
7029 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
7030 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7031 && (
set[i].ecart > p->ecart))
7032 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7033 && (
set[i].ecart == p->ecart)
7048 if (length<0)
return 0;
7052 unsigned long c =
pGetComp(p->p)*cc;
7053 int o = p->GetpFDeg() + p->ecart;
7055 if (
pGetComp(
set[length].p)*cc > c)
7057 if (
pGetComp(
set[length].p)*cc == c)
7059 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
7060 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
7061 && (
set[length].ecart > p->ecart))
7062 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
7063 && (
set[length].ecart == p->ecart)
7078 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
7079 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7080 && (
set[an].ecart > p->ecart))
7081 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7082 && (
set[an].ecart == p->ecart)
7091 else if (
pGetComp(
set[i].p)*cc == c)
7093 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
7094 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7095 && (
set[i].ecart > p->ecart))
7096 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7097 && (
set[i].ecart == p->ecart)
7116 PrintS(
"syzygy criterion checks: ");
7119 for (
int k=0;
k<strat->
syzl;
k++)
7124 Print(
"checking with: %d / %d -- \n",
k,strat->
syzl);
7156 PrintS(
"--- syzygy criterion checks: ");
7165 min = strat->
syzIdx[comp-2];
7175 max = strat->
syzIdx[comp-1];
7177 for (
int k=min;
k<
max;
k++)
7180 Print(
"COMP %d/%d - MIN %d - MAX %d - SYZL %ld\n",comp,strat->
currIdx,min,max,strat->
syzl);
7181 Print(
"checking with: %d -- ",
k);
7209 PrintS(
"rewritten criterion checks: ");
7212 for(
int k = strat->
sl;
k>=start;
k--)
7216 PrintS(
"checking with: ");
7227 printf(
"\nFaugere RewCrit: * divisible by *\n");
pWrite(sig);
pWrite(strat->
sig[
k]);
7235 PrintS(
"ALL ELEMENTS OF S\n----------------------------------------\n");
7236 for(
int kk = 0; kk<strat->
sl+1; kk++)
7240 PrintS(
"------------------------------\n");
7267 printf(
"\narriRewCrit\n");
7273 for (
int ii=strat->
sl; ii>start; ii--)
7279 if (!(
pLmCmp(p1,p2) == 1))
7282 printf(
"\narriRewCrit deleted: sig, P.sig\n");
7298 printf(
"\narriRewCritPre\n");
7304 for (
int i=strat->
Bl; i>-1; i--) {
7313 if (
pLmCmp(lm,strat->
B[found].GetLmCurrRing()) == -1)
7317 printf(
"\nDelete!\n");
7323 printf(
"\nDelete this one!\n");
7330 for (
int ii=strat->
sl; ii>-1; ii--)
7336 if (!(
pLmCmp(p1,p2) == 1))
7341 printf(
"\nDelete this one!\n");
7362 const unsigned long not_sev = ~L->sev;
7363 const unsigned long* sev = strat->
sevS;
7376 if (j > pos)
return NULL;
7377 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7379 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7384 if (!(sev[j] & not_sev) &&
7385 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]) &&
7399 if (j > pos)
return NULL;
7400 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7407 if (!(sev[j] & not_sev) &&
7408 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]) &&
7419 if (strat->
tl < 0 || strat->
S_2_R[j] == -1)
7421 T->Set(strat->
S[j], r, strat->
tailRing);
7429 return strat->
S_2_T(j);
7439 if (j > pos)
return NULL;
7441 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7442 t = strat->
S_2_T(j);
7445 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7450 if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7452 t = strat->
S_2_T(j);
7453 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[j]);
7468 if (j > pos)
return NULL;
7470 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7471 t = strat->
S_2_T(j);
7479 if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7481 t = strat->
S_2_T(j);
7482 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[j]);
7532 if (With ==
NULL)
break;
7542 return redtail(L, pos, strat);
7548 if (hn ==
NULL)
goto all_done;
7569 return redtail(&L, pos, strat);
7574 #define REDTAIL_CANONICALIZE 100 7578 p = h = L->GetLmTailRing();
7580 return L->GetLmCurrRing();
7587 Ln.pLength = L->GetpLength() - 1;
7611 Ln.SetShortExpVector();
7617 With = &(strat->
T[
j]);
7622 if (With ==
NULL)
break;
7649 pNext(h) = Ln.LmExtractAndIter();
7652 }
while (!Ln.IsNull());
7655 if (Ln.IsNull())
goto all_done;
7656 if (! withT) With_s.Init(
currRing);
7658 pNext(h) = Ln.LmExtractAndIter();
7677 return L->GetLmCurrRing();
7682 #define REDTAIL_CANONICALIZE 100 7686 p = h = L->GetLmTailRing();
7688 return L->GetLmCurrRing();
7695 Ln.pLength = L->GetpLength() - 1;
7719 Ln.SetShortExpVector();
7725 With = &(strat->
T[
j]);
7730 if (With ==
NULL)
break;
7757 pNext(h) = Ln.LmExtractAndIter();
7760 }
while (!Ln.IsNull());
7766 Ln.p =
pJet(Ln.p,bound);
7772 if (! withT) With_s.Init(
currRing);
7774 pNext(h) = Ln.LmExtractAndIter();
7793 return L->GetLmCurrRing();
7803 p = h = L->GetLmTailRing();
7805 return L->GetLmCurrRing();
7812 Ln.pLength = L->GetpLength() - 1;
7825 Ln.SetShortExpVector();
7827 if (With ==
NULL)
break;
7837 poly p_Ln=Ln.GetLmCurrRing();
7838 poly p_With=With->GetLmCurrRing();
7850 if (Ln.bucket!=
NULL)
7881 pNext(h) = Ln.LmExtractAndIter();
7884 }
while (!Ln.IsNull());
7887 if (Ln.IsNull())
goto all_done;
7890 pNext(h) = Ln.LmExtractAndIter();
7908 return L->GetLmCurrRing();
7924 if (strat->
Ll != *reduc)
7926 if (strat->
Ll != *reduc-1)
7938 if (red_result == 0)
7940 else if (red_result < 0)
7942 if ((red_result > 0) || ((strat->
Ll % 100)==99))
7944 if (strat->
Ll != *reduc && strat->
Ll > 0)
7961 Print(
"product criterion:%d chain criterion:%d\n",strat->
cp,strat->
c3);
7962 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7964 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7975 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7977 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7992 for (i=0; i<=strat->
sl; i++)
8002 for (i=0; i<=strat->
tl; i++)
8006 Print(
" o:%ld e:%d l:%d",
8007 strat->
T[i].pFDeg(),strat->
T[
i].ecart,strat->
T[
i].length);
8012 for (i=strat->
Ll; i>=0; i--)
8021 Print(
" o:%ld e:%d l:%d",
8022 strat->
L[i].pFDeg(),strat->
L[
i].ecart,strat->
L[
i].length);
8044 strat->
S=strat->
Shdl->m;
8049 memset(strat->
fromQ,0,i*
sizeof(
int));
8055 h.p =
pCopy(Q->m[i]);
8076 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8079 strat->
enterS(h,pos,strat,-1);
8080 strat->
fromQ[pos]=1;
8090 h.p =
pCopy(F->m[i]);
8112 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8114 strat->
enterS(h,pos,strat,-1);
8140 strat->
S=strat->
Shdl->m;
8145 memset(strat->
fromQ,0,i*
sizeof(
int));
8151 h.p =
pCopy(Q->m[i]);
8172 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8175 strat->
enterS(h,pos,strat,-1);
8176 strat->
fromQ[pos]=1;
8186 h.p =
pCopy(F->m[i]);
8209 pos = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
8239 strat->
S = strat->
Shdl->m;
8252 memset(strat->
fromQ,0,i*
sizeof(
int));
8258 h.p =
pCopy(Q->m[i]);
8279 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8282 strat->
enterS(h,pos,strat,-1);
8283 strat->
fromQ[pos]=1;
8293 h.p =
pCopy(F->m[i]);
8394 for(i=1; i<=strat->
sl; i++)
8410 #if defined(DEBUGF5) || defined(DEBUGF51) 8411 PrintS(
"------------- GENERATING SYZ RULES NEW ---------------\n");
8418 while (i <= strat->sl)
8430 diff = comp - comp_old - 1;
8448 for (k = 0; k<
i; k++)
8475 diff = comp - comp_old - 1;
8492 for (k = 0; k<strat->
sl+1; k++)
8513 PrintS(
"Principal syzygies:\n");
8516 Print(
"ps %d\n",ps);
8517 PrintS(
"--------------------------------\n");
8518 for(i=0;i<=strat->
syzl-1;i++)
8527 PrintS(
"--------------------------------\n");
8547 strat->
S=strat->
Shdl->m;
8553 memset(strat->
fromQ,0,i*
sizeof(
int));
8559 h.p =
pCopy(Q->m[i]);
8580 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8583 strat->
enterS(h,pos,strat, strat->
tl+1);
8585 strat->
fromQ[pos]=1;
8596 h.p =
pCopy(F->m[i]);
8611 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8613 strat->
enterS(h,pos,strat, strat->
tl+1);
8655 h.is_normalized = 0;
8660 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8662 strat->
enterS(h,pos,strat, strat->
tl+1);
8670 strat->
enterS(h,0,strat, strat->
tl+1);
8692 strat->
S=strat->
Shdl->m;
8698 memset(strat->
fromQ,0,i*
sizeof(
int));
8704 h.p =
pCopy(Q->m[i]);
8725 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8728 strat->
enterS(h,pos,strat, strat->
tl+1);
8730 strat->
fromQ[pos]=1;
8741 h.p =
pCopy(F->m[i]);
8756 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8758 strat->
enterS(h,pos,strat, strat->
tl+1);
8800 h.is_normalized = 0;
8805 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8807 strat->
enterS(h,pos,strat, strat->
tl+1);
8815 strat->
enterS(h,0,strat, strat->
tl+1);
8831 while (j <= maxIndex)
8848 if (!
pIsVector((*p).p) && ((*p).ecart != 0))
8857 h1 = r =
pCopy((*p).p);
8910 while ((j <= strat->sl) && (
pGetComp(strat->
S[j])!=0)) j++;
8912 while (j<=strat->sl)
8936 while (j <= maxIndex)
8990 while (j <= maxIndex);
9020 while (i<=strat->sl)
9027 redSi =
pHead(strat->
S[i]);
9028 strat->
S[
i] =
redBba(strat->
S[i],i-1,strat);
9031 if (
pCmp(redSi,strat->
S[i])!=0)
9044 if (strat->
S[i]==
NULL)
9052 if (strat->
S[i]==
NULL)
9070 DENOMINATOR_LIST=denom;
9089 if (any_change)
reorderS(&suc,strat);
9094 for (i=0; i<=strat->
sl; i++)
9115 h.sev = strat->
sevS[
i];
9128 while (i<=strat->sl)
9133 redSi=
pHead((strat->
S)[i]);
9140 else if (
pCmp((strat->
S)[i],redSi)!=0)
9157 DENOMINATOR_LIST=denom;
9172 strat->
sevS[
i] = h.sev;
9182 if (any_change)
reorderS(&suc,strat);
9183 else { suc=-1;
break; }
9194 for (i=0; i<=strat->
sl; i++)
9198 strat->
S[
i] = h.p =
redtail(strat->
S[i],strat->
sl,strat);
9202 strat->
sevS[
i] = h.sev;
9208 h.sev = strat->
sevS[
i];
9209 h.length = h.pLength =
pLength(h.p);
9218 if (suc!= -1)
updateS(toT,strat);
9238 *
sizeof(
unsigned long));
9265 strat->
Shdl->m=strat->
S;
9267 if (atS <= strat->sl)
9269 #ifdef ENTER_USE_MEMMOVE 9270 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9271 (strat->
sl - atS + 1)*
sizeof(
poly));
9272 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9273 (strat->
sl - atS + 1)*
sizeof(
int));
9274 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9275 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9276 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9277 (strat->
sl - atS + 1)*
sizeof(
int));
9279 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9280 (strat->
sl - atS + 1)*
sizeof(
int));
9282 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9285 for (i=strat->
sl+1; i>=atS+1; i--)
9287 strat->
S[
i] = strat->
S[i-1];
9293 for (i=strat->
sl+1; i>=atS+1; i--)
9296 for (i=strat->
sl+1; i>=atS+1; i--)
9302 #ifdef ENTER_USE_MEMMOVE 9303 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9304 (strat->
sl - atS + 1)*
sizeof(
int));
9306 for (i=strat->
sl+1; i>=atS+1; i--)
9311 strat->
fromQ[atS]=0;
9315 strat->
S[atS] = p.p;
9321 strat->
sevS[atS] = p.sev;
9322 strat->
ecartS[atS] = p.ecart;
9323 strat->
S_2_R[atS] = atR;
9340 *
sizeof(
unsigned long));
9344 *
sizeof(
unsigned long));
9372 strat->
Shdl->m=strat->
S;
9379 if (atS <= strat->sl)
9381 #ifdef ENTER_USE_MEMMOVE 9382 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9383 (strat->
sl - atS + 1)*
sizeof(
poly));
9384 memmove(&(strat->
sig[atS+1]), &(strat->
sig[atS]),
9385 (strat->
sl - atS + 1)*
sizeof(
poly));
9386 memmove(&(strat->
sevSig[atS+1]), &(strat->
sevSig[atS]),
9387 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9388 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9389 (strat->
sl - atS + 1)*
sizeof(
int));
9390 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9391 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9392 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9393 (strat->
sl - atS + 1)*
sizeof(
int));
9395 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9396 (strat->
sl - atS + 1)*
sizeof(
int));
9398 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9401 for (i=strat->
sl+1; i>=atS+1; i--)
9403 strat->
S[
i] = strat->
S[i-1];
9407 strat->
sig[
i] = strat->
sig[i-1];
9411 for (i=strat->
sl+1; i>=atS+1; i--)
9414 for (i=strat->
sl+1; i>=atS+1; i--)
9420 #ifdef ENTER_USE_MEMMOVE 9421 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9422 (strat->
sl - atS + 1)*
sizeof(
int));
9424 for (i=strat->
sl+1; i>=atS+1; i--)
9429 strat->
fromQ[atS]=0;
9433 strat->
S[atS] = p.p;
9434 strat->
sig[atS] = p.sig;
9440 strat->
sevS[atS] = p.sev;
9450 strat->
sevSig[atS] = p.sevSig;
9452 strat->
ecartS[atS] = p.ecart;
9453 strat->
S_2_R[atS] = atR;
9457 Print(
"--- LIST S: %d ---\n",strat->
sl);
9458 for(k=0;k<=strat->
sl;k++)
9462 PrintS(
"--- LIST S END ---\n");
9478 assume(p.FDeg == p.pFDeg());
9483 for(i=strat->
tl;i>=0;i--)
9485 if (p.p==strat->
T[i].p)
9487 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
9493 #ifdef HAVE_TAIL_RING 9496 p.t_p=p.GetLmTailRing();
9501 atT = strat->
posInT(strat->
T, strat->
tl, p);
9502 if (strat->
tl == strat->
tmax-1)
9504 if (atT <= strat->tl)
9506 #ifdef ENTER_USE_MEMMOVE 9507 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9509 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9510 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9512 for (i=strat->
tl+1; i>=atT+1; i--)
9514 #ifndef ENTER_USE_MEMMOVE 9515 strat->
T[
i] = strat->
T[i-1];
9518 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9532 printf(
"\nenterT: add in position %i\n",atT);
9540 strat->
T[atT].max_exp =
NULL;
9543 strat->
R[strat->
tl] = &(strat->
T[atT]);
9544 strat->
T[atT].i_r = strat->
tl;
9564 assume(p.FDeg == p.pFDeg());
9569 for(i=strat->
tl;i>=0;i--)
9571 if (p.p==strat->
T[i].p)
9573 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
9579 #ifdef HAVE_TAIL_RING 9582 p.t_p=p.GetLmTailRing();
9587 atT = strat->
posInT(strat->
T, strat->
tl, p);
9588 if (strat->
tl == strat->
tmax-1)
9590 if (atT <= strat->tl)
9592 #ifdef ENTER_USE_MEMMOVE 9593 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9595 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9596 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9598 for (i=strat->
tl+1; i>=atT+1; i--)
9600 #ifndef ENTER_USE_MEMMOVE 9601 strat->
T[
i] = strat->
T[i-1];
9604 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9618 printf(
"\nenterT_strong: add in position %i\n",atT);
9626 strat->
T[atT].max_exp =
NULL;
9629 strat->
R[strat->
tl] = &(strat->
T[atT]);
9630 strat->
T[atT].i_r = strat->
tl;
9638 printf(
"\nDas ist p:\n");
pWrite(p.p);
9640 for(i=strat->
tl;i>=0;i--)
9645 printf(
"\nFound one: %i\n",i);
pWrite(strat->
T[i].p);
9669 printf(
"\n Entersyz:\n");
pWrite(p.sig);
9677 (strat->
syzmax)*
sizeof(
unsigned long),
9679 *
sizeof(
unsigned long));
9682 if (atT < strat->syzl)
9684 #ifdef ENTER_USE_MEMMOVE 9685 memmove(&(strat->
syz[atT+1]), &(strat->
syz[atT]),
9687 memmove(&(strat->
sevSyz[atT+1]), &(strat->
sevSyz[atT]),
9688 (strat->
syzl-atT+1)*
sizeof(
unsigned long));
9690 for (i=strat->
syzl; i>=atT+1; i--)
9692 #ifndef ENTER_USE_MEMMOVE 9693 strat->
syz[
i] = strat->
syz[i-1];
9705 strat->
syz[atT] = p.sig;
9706 strat->
sevSyz[atT] = p.sevSig;
9709 Print(
"element in strat->syz: %d--%d ",atT+1,strat->
syzmax);
9719 strat->
L[cc].sig, ~strat->
L[cc].sevSig,
currRing)
9728 printf(
"\n syzCrit deleted!\n");
pWrite(strat->
L[cc].p);
pWrite(strat->
L[cc].sig);
9736 PrintS(
"--- Syzygies ---\n");
9739 PrintS(
"--------------------------------\n");
9740 for(i=0;i<=strat->
syzl-1;i++)
9745 PrintS(
"--------------------------------\n");
9781 #ifdef HAVE_RATGRING 9826 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9827 else PrintS(
"ideal/module is not homogeneous\n");
9858 #ifdef HAVE_RATGRING 9897 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9898 else PrintS(
"ideal/module is not homogeneous\n");
10120 strat->
P.pLength=0;
10406 for (l=
IDELEMS(r)-1;l>=0;l--)
10417 for (l=
IDELEMS(r)-1;l>=0;l--)
10419 if ((r->m[l]!=
NULL)
10424 for(q=
IDELEMS(Q)-1; q>=0;q--)
10426 if ((Q->m[q]!=
NULL)
10448 for (l=
IDELEMS(r)-1;l>=0;l--)
10450 if ((r->m[l]!=
NULL)
10455 for(q=
IDELEMS(Q)-1; q>=0;q--)
10457 if ((Q->m[q]!=
NULL)
10488 for (l=
IDELEMS(r)-1;l>=0;l--)
10492 for(q=
IDELEMS(Q)-1; q>=0;q--)
10501 reduction_found=
TRUE;
10517 for (l=
IDELEMS(r)-1;l>=0;l--)
10521 for(q=
IDELEMS(Q)-1; q>=0;q--)
10532 reduction_found=
TRUE;
10546 if ( reduction_found)
10551 for (l=
IDELEMS(r)-1;l>=0;l--)
10582 for (l=
IDELEMS(r)-1;l>=0;l--)
10636 for (i=strat->
sl; i>=low; i--)
10638 int end_pos=strat->
sl;
10640 if (strat->
ak==0) end_pos=i-1;
10642 if ((T_j !=
NULL)&&(T_j->p==strat->
S[i]))
10648 Print(
"test S[%d]:",i);
10660 Print(
"to (tailR) S[%d]:",i);
10672 T_j->max_exp =
NULL;
10675 T_j->pCleardenom();
10683 Print(
"test S[%d]:",i);
10689 strat->
S[
i] =
redtailBba(strat->
S[i], end_pos, strat, withT);
10703 DENOMINATOR_LIST=denom;
10716 Print(
"to (-tailR) S[%d]:",i);
10727 sloppy_max =
FALSE;
10763 if (j < strat->
HCord)
10807 assume(L->i_r1 >= -1 && L->i_r1 <= strat->
tl);
10808 assume(L->i_r2 >= -1 && L->i_r2 <= strat->
tl);
10814 if ((L->i_r1 == -1) || (L->i_r2 == -1) )
10868 ideal F =
idCopy(Forig);
10872 ideal monred =
idInit(1,1);
10873 for(
int i=0; i<
idElem(F); i++)
10879 if((posconst != -1) && (!
nIsZero(F->m[posconst]->coef)))
10889 for(
int i=0; i<idelemQ; i++)
10897 if((posconst != -1) && (!
nIsZero(monred->m[posconst]->coef)))
10899 pmon =
pCopy(monred->m[posconst]);
10913 for(
int i = 0, j = 0; i<
IDELEMS(F); i++)
10914 II->m[j++] =
prMapR(F->m[i], nMap, origR, QQ_ring);
10915 for(
int i = 0, j =
IDELEMS(F); i<idelemQ; i++)
10916 II->m[j++] =
prMapR(Q->m[i], nMap, origR, QQ_ring);
10922 for(
int i =
IDELEMS(II)-1; i>=0; i--)
10923 if(II->m[i] !=
NULL)
10924 II->m[i+1] = II->m[
i];
10928 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
10935 integer =
pHead(syz->m[i]);
10942 pmon =
prMapR(integer, nMap2, QQ_ring, origR);
10957 for(
int i = 0; i<
IDELEMS(one); i++)
10961 if(mindegmon ==
NULL)
10962 mindegmon =
pCopy(one->m[i]);
10965 if(
p_Deg(one->m[i], QQ_ring) <
p_Deg(mindegmon, QQ_ring))
10966 mindegmon =
pCopy(one->m[i]);
10970 if(mindegmon !=
NULL)
10972 for(
int i =
IDELEMS(II)-1; i>=0; i--)
10973 if(II->m[i] !=
NULL)
10974 II->m[i+1] = II->m[
i];
10975 II->m[0] =
pCopy(mindegmon);
10978 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
10992 if (found ==
FALSE)
11004 pmon =
prMapR(mindegmon, nMap2, QQ_ring, origR);
11035 poly pH = h->GetP();
11039 for(
int i = 0; i<=strat->
sl; i++)
11094 h->SetLmCurrRing();
11095 if((deleted)&&(h->p!=
NULL))
11103 poly hSig = h->sig;
11104 poly pH = h->GetP();
11108 for(
int i = 0; i<=strat->
sl; i++)
11119 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
11146 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
11177 h->SetLmCurrRing();
11193 for(
int j = 0; j<=strat->
sl; j++)
11197 for(
int i = 0; i<=strat->
sl; i++)
11199 if((i != j) && (strat->
S[i] !=
NULL))
11259 if (expbound == 0) expbound = strat->
tailRing->bitmask << 1;
11276 new_tailRing->pFDeg =
currRing->pFDeg;
11277 new_tailRing->pLDeg =
currRing->pLDeg;
11281 Print(
"[%lu:%d", (
unsigned long) new_tailRing->bitmask, new_tailRing->ExpL_Size);
11290 for (i=0; i<=strat->
tl; i++)
11292 strat->
T[
i].ShallowCopyDelete(new_tailRing, new_tailBin,
11293 p_shallow_copy_delete);
11295 for (i=0; i<=strat->
Ll; i++)
11299 strat->
L[
i].ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11301 if ((strat->
P.t_p !=
NULL) ||
11303 strat->
P.ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11305 if ((L !=
NULL) && (L->tailRing != new_tailRing))
11308 L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11314 L->tailRing = new_tailRing;
11317 L->max_exp = t_l->max_exp;
11321 if ((T !=
NULL) && (T->tailRing != new_tailRing && T->i_r < 0))
11322 T->ShallowCopyDelete(new_tailRing, new_tailBin, p_shallow_copy_delete);
11329 strat->
tailBin = new_tailBin;
11355 unsigned long l = 0;
11361 for (i=0; i<= strat->
Ll; i++)
11365 for (i=0; i<=strat->
tl; i++)
11392 res->block0 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11393 res->block1 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11394 int **wvhdl = (
int **)
omAlloc0((n+1)*
sizeof(
int*));
11395 res->wvhdl = wvhdl;
11396 for (
int i=1; i<n; i++)
11398 res->order[
i] = r->order[i-1];
11399 res->block0[
i] = r->block0[i-1];
11400 res->block1[
i] = r->block1[i-1];
11401 res->wvhdl[
i] = r->wvhdl[i-1];
11407 for (
int i=
rBlocks(res); i>0; --
i)
11420 #ifndef SING_NDEBUG 11421 WarnS(
"error in nc_rComplete");
11440 res->block0 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11441 res->block1 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11442 int **wvhdl = (
int **)
omAlloc0((n+2)*
sizeof(
int*));
11443 res->wvhdl = wvhdl;
11444 for (
int i=2; i<n+2; i++)
11446 res->order[
i] = r->order[i-2];
11447 res->block0[
i] = r->block0[i-2];
11448 res->block1[
i] = r->block1[i-2];
11449 res->wvhdl[
i] = r->wvhdl[i-2];
11454 res->block0[0] = 1;
11455 res->wvhdl[0] = (
int *)
omAlloc(res->N*
sizeof(
int));
11456 for (
int i=0; i<res->N; ++
i)
11457 res->wvhdl[0][i] = 1;
11461 res->wvhdl[1] =
NULL;
11463 for (
int i=
rBlocks(res); i>1; --
i)
11476 #ifndef SING_NDEBUG 11477 WarnS(
"error in nc_rComplete");
11614 #ifdef HAVE_TAIL_BIN 11626 if (tailBin !=
NULL)
11630 if (t_kHEdge !=
NULL)
11632 if (t_kNoether !=
NULL)
11641 Timings
for the different possibilities of posInT:
11642 T15 EDL DL EL L 1-2-3
11643 Gonnet 43.26 42.30 38.34 41.98 38.40 100.04
11644 Hairer_2_1 1.11 1.15 1.04 1.22 1.08 4.7
11645 Twomat3 1.62 1.69 1.70 1.65 1.54 11.32
11646 ahml 4.48 4.03 4.03 4.38 4.96 26.50
11647 c7 15.02 13.98 15.16 13.24 17.31 47.89
11648 c8 505.09 407.46 852.76 413.21 499.19 n/
a 11649 f855 12.65 9.27 14.97 8.78 14.23 33.12
11650 gametwo6 11.47 11.35 14.57 11.20 12.02 35.07
11651 gerhard_3 2.73 2.83 2.93 2.64 3.12 6.24
11652 ilias13 22.89 22.46 24.62 20.60 23.34 53.86
11653 noon8 40.68 37.02 37.99 36.82 35.59 877.16
11654 rcyclic_19 48.22 42.29 43.99 45.35 51.51 204.29
11655 rkat9 82.37 79.46 77.20 77.63 82.54 267.92
11656 schwarz_11 16.46 16.81 16.76 16.81 16.72 35.56
11657 test016 16.39 14.17 14.40 13.50 14.26 34.07
11658 test017 34.70 36.01 33.16 35.48 32.75 71.45
11659 test042 10.76 10.99 10.27 11.57 10.45 23.04
11660 test058 6.78 6.75 6.51 6.95 6.22 9.47
11661 test066 10.71 10.94 10.76 10.61 10.56 19.06
11662 test073 10.75 11.11 10.17 10.79 8.63 58.10
11663 test086 12.23 11.81 12.88 12.24 13.37 66.68
11664 test103 5.05 4.80 5.47 4.64 4.89 11.90
11665 test154 12.96 11.64 13.51 12.46 14.61 36.35
11666 test162 65.27 64.01 67.35 59.79 67.54 196.46
11667 test164 7.50 6.50 7.68 6.70 7.96 17.13
11668 virasoro 3.39 3.50 3.35 3.47 3.70 7.66
11678 if (length==-1)
return 0;
11681 int op=p.GetpFDeg();
11682 int ol = p.GetpLength();
11684 if (
set[length].ecart < o)
11686 if (
set[length].ecart == o)
11688 int oo=
set[
length].GetpFDeg();
11689 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
11700 if (
set[an].ecart > o)
11702 if (
set[an].ecart == o)
11704 int oo=
set[an].GetpFDeg();
11706 || ((oo==op) && (
set[an].
pLength > ol)))
11712 if (
set[i].ecart > o)
11714 else if (
set[i].ecart == o)
11716 int oo=
set[
i].GetpFDeg();
11718 || ((oo == op) && (
set[i].
pLength > ol)))
11732 if (length==-1)
return 0;
11734 int op=p.GetpFDeg();
11735 int ol = p.GetpLength();
11737 int oo=
set[
length].GetpFDeg();
11738 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
11748 int oo=
set[an].GetpFDeg();
11750 || ((oo==op) && (
set[an].
pLength > ol)))
11755 int oo=
set[
i].GetpFDeg();
11757 || ((oo == op) && (
set[i].
pLength > ol)))
11768 int ol = p.GetpLength();
11771 if (
set[length].length<p.length)
11782 if (
set[an].
pLength>ol)
return an;
11803 if (strat->
red==redFirst)
PrintS(
"redFirst\n");
11805 else if (strat->
red==redEcart)
PrintS(
"redEcart\n");
11807 else Print(
"%p\n",(
void*)strat->
red);
11826 #ifdef HAVE_MORE_POS_IN_T 11857 else if (strat->
enterS==enterSMora)
PrintS(
"enterSMora\n");
11858 else if (strat->
enterS==enterSMoraNF)
PrintS(
"enterSMoraNF\n");
11864 PrintS(
"initEcartPair: ");
11868 Print(
"homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
11870 Print(
"honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
11876 Print(
"posInLDependsOnLength=%d\n",
11908 PrintS(
"currRing->pFDeg: ");
11923 PrintS(
"ecartWeights: ");
11930 #ifndef SING_NDEBUG 11935 #ifdef HAVE_SHIFTBBA 11949 #ifdef HAVE_SHIFTBBA 11966 #ifdef HAVE_SHIFTBBA 12058 #ifdef HAVE_SHIFTBBA 12068 for (i=0; i<=strat->
sl; i++)
12070 memset(&h,0,
sizeof(h));
12073 h.sev = strat->
sevS[
i];
12087 #ifdef HAVE_SHIFTBBA 12163 #ifdef HAVE_SHIFTBBA 12203 qfromQ = strat->
fromQ[
i];
12215 enterOnePairShift(qq, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, 0, i, uptodeg, lV);
12217 for (j=1; j<= toInsert; j++)
12233 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, i, uptodeg, lV);
12238 #ifdef HAVE_SHIFTBBA 12280 for (; j<= toInsert; j++)
12297 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, -1, uptodeg, lV);
12302 #ifdef HAVE_SHIFTBBA 12306 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)
12330 int qfromQ = qisFromQ;
12339 Lp.ecart=0; Lp.length=0;
12345 if (!
isInV(Lp.lcm, lV))
12350 PrintS(
"V crit applied to q = ");
12365 if((!((ecartq>0)&&(ecart>0)))
12387 Lp.ecart =
si_max(ecart,ecartq);
12388 if (strat->
fromT && (ecartq>ecart))
12405 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
12410 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12453 if (strat->
fromT && (ecartq>ecart))
12465 for(j = strat->
Bl;j>=0;j--)
12467 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
12471 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12495 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (qfromQ!=0))
12562 if ( (atR >= 0) && (shiftcount==0) && (ifromS >=0) )
12581 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
12587 #ifdef HAVE_SHIFTBBA 12608 for (j=0; j<=
k; j++)
12610 if (!strat->
fromQ[j])
12623 for (j=0; j<=
k; j++)
12636 for (j=0; j<=
k; j++)
12661 #ifdef HAVE_SHIFTBBA 12674 if ( (!strat->
fromT)
12683 clearS(h,h_sev, &j,&k,strat);
12692 #ifdef HAVE_SHIFTBBA 12712 atT = strat->
posInT(strat->
T, strat->
tl, p);
12719 for (i=1; i<=toInsert; i++)
12730 atT = strat->
posInT(strat->
T, strat->
tl, qq);
12739 #ifdef HAVE_SHIFTBBA 12746 p = h = L->GetLmTailRing();
12748 return L->GetLmCurrRing();
12755 Ln.pLength = L->GetpLength() - 1;
12763 while(!Ln.IsNull())
12767 Ln.SetShortExpVector();
12773 With = &(strat->
T[
j]);
12778 if (With ==
NULL)
break;
12794 pNext(h) = Ln.LmExtractAndIter();
12797 }
while (!Ln.IsNull());
12800 if (Ln.IsNull())
goto all_done;
12801 if (! withT) With_s.Init(
currRing);
12803 pNext(h) = Ln.LmExtractAndIter();
12818 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)
static void enterOnePairSig(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
int getIndexRng(long coeff)
int posInL11(const LSet set, const int length, LObject *p, const kStrategy)
poly redtailBbaBound(LObject *L, int pos, kStrategy strat, int bound, BOOLEAN withT, BOOLEAN normalize)
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...
int posInSMonFirst(const kStrategy strat, const int length, const poly p)
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
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)
int posInL11Ring(const LSet set, const int length, LObject *p, const kStrategy)
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
int posInL11Ringls(const LSet set, const int length, LObject *p, const kStrategy)
pLDegProc pOrigLDeg_TailRing
#define idDelete(H)
delete an ideal
long pLDeg1c_Totaldegree(poly p, int *l, const ring r)
int posInLF5CRing(const LSet set, int start, const int length, LObject *p, const kStrategy)
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)
static void enterOnePairLift(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
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
static void enterOnePairManyShifts(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
#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)
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))) ...
void p_Lcm(const poly a, const poly b, poly m, const ring r)
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)
static BOOLEAN enterOneStrongPolySig(int i, poly p, poly sig, int, int, kStrategy strat, int atR)
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
static void enterOnePairSigRing(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
#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 void enterOnePairRing(int i, poly p, int, int isFromQ, kStrategy strat, int atR)
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 &)
int redFirstShift(LObject *h, kStrategy strat)
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.
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)
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)
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:
static int max(int a, int b)
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 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)
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
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)
static BOOLEAN enterOneStrongPoly(int i, poly p, int, int, kStrategy strat, int atR, bool enterTstrong)
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)
int posInT110(const TSet set, const int length, LObject &p)
#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)
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)
static void initenterstrongPairsSig(poly h, poly hSig, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
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)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
KINLINE poly kNoetherTail()
static BOOLEAN sugarDivisibleBy(int ecart1, int ecart2)
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)
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