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;
1333 pLcm(p,strat->
S[i],h.lcm);
1342 for(j = strat->
Bl;j>=0;j--)
1347 printf(
"\nChainCrit in enteronepairring\n");
1353 printf(
"\nh - neue Paar\n");
1358 printf(
"\ncompare = %i\ncompareCoeff = %i\n",compare,compareCoeff);
1365 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1368 printf(
"\nGelöscht h\n");
1379 printf(
"\nGelöscht: B[j]\n");
1386 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1389 printf(
"\nGelöscht h\n");
1402 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1405 printf(
"\nGelöscht h\n");
1416 printf(
"\nGelöscht: B[j]\n");
1426 printf(
"\nTrying to add spair S[%i] und p\n",i);
pWrite(strat->
S[i]);
pWrite(p);
1498 printf(
"\nThis is afterwards:\n");
1501 h.i_r1 = -1;h.i_r2 = -1;
1511 h.i_r2 = strat->
S_2_R[
i];
1517 posx = strat->
posInL(strat->
B,strat->
Bl,&h,strat);
1522 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);
1593 PrintS(
"\n--- create strong gcd poly: ");
1594 Print(
"\n p: %d", i);
1596 Print(
"\n strat->S[%d]: ", i);
1620 h.i_r1 = -1;h.i_r2 = -1;
1626 h.p1 =
p;h.p2 = strat->
S[
i];
1630 h.i_r2 = strat->
S_2_R[
i];
1641 posx = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
1646 if(h.IsNull())
return FALSE;
1660 printf(
"\nThis strong poly was added to L:\n");
pWrite(h.p);
pWrite(h.p1);
pWrite(h.p2);
1667 if(strat->
sl < 0)
return FALSE;
1669 for(i=0;i<strat->
sl;i++)
1695 if(pairsig!=
NULL &&
pLtCmp(pairsig,h->sig) == 0)
1698 printf(
"\nCan replace * (sig = *) with * (sig = *) since of * with sig *\n");
1710 h->i_r1 = -1;h->i_r2 = -1;
1780 PrintS(
"\n--- create strong gcd poly: ");
1781 Print(
"\n p: %d", i);
1783 Print(
"\n strat->S[%d]: ", i);
1807 if(
pLmCmp(pSigMult,sSigMult) == 0)
1816 if(
pLtCmp(pSigMult,sSigMult)==1)
1836 h.i_r1 = -1;h.i_r2 = -1;
1842 printf(
"\nPossible sigdrop in enterpairstrongSig (due to lost of sig)\n");
1847 int red_result =
redRing(&h,strat);
1849 printf(
"\nAfter redRing reduce:\n");
pWrite(h.p);
1855 printf(
"\nCancel the sigdrop. It reduced to 0\n");
1864 printf(
"\nSigdrop. end\n");
1866 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1868 strat->
enterS(h,0,strat,strat->
tl);
1875 h.sig =
pNeg(h.sig);
1882 printf(
"\nSigDrop in enteronestrongpolySig\n");
1889 int red_result =
redRing(&h,strat);
1894 printf(
"\nCancel the sigdrop after redRing (=0)\n");
1903 printf(
"\nAfter redRing still sigdrop:\n");
pWrite(h.p);
1905 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1908 strat->
enterS(h,0,strat, strat->
tl+1);
1920 printf(
"\nSigDrop in strongpair\noriginals: ");
pWrite(sig);
pWrite(strat->
sig[i]);
1921 printf(
"\nnow: ");
pWrite(pairsig);
1925 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1926 strat->
enterS(h,strat->
sl+1,strat,strat->
tl+1);
1929 h.p1 =
p;h.p2 = strat->
S[
i];
1933 h.i_r2 = strat->
S_2_R[
i];
1963 Lp.ecart=0; Lp.length=0;
1968 #ifndef HAVE_RATGRING 1969 pLcm(p,strat->
S[i],Lp.lcm);
1970 #elif defined(HAVE_RATGRING) 1974 pLcm(p,strat->
S[i],Lp.lcm);
1981 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
2023 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2028 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2085 for(j = strat->
Bl;j>=0;j--)
2087 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2091 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2117 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2184 Lp.p1 = strat->
S[
i];
2198 Lp.i_r1 = strat->
S_2_R[
i];
2214 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2249 Lp.ecart=0; Lp.length=0;
2254 pLcm(p,strat->
S[i],Lp.lcm);
2259 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
2301 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2306 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2359 for(j = strat->
Bl;j>=0;j--)
2361 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2365 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2390 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2418 Lp.p1 = strat->
S[
i];
2425 Lp.i_r1 = strat->
S_2_R[
i];
2440 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2464 unsigned long pSigMultNegSev,sSigMultNegSev;
2468 Lp.ecart=0; Lp.length=0;
2473 #ifndef HAVE_RATGRING 2474 pLcm(p,strat->
S[i],Lp.lcm);
2475 #elif defined(HAVE_RATGRING) 2503 PrintS(
"----------------\n");
2506 PrintS(
"----------------\n");
2512 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2534 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2535 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2536 || strat->
rewCrit1(sSigMult,sSigMultNegSev,Lp.lcm,strat,i+1)
2560 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2614 Lp.sevSig = ~pSigMultNegSev;
2621 Lp.sevSig = ~sSigMultNegSev;
2632 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
2647 Lp.checked = strat->
sl+1;
2654 Lp.prod_crit =
TRUE;
2667 PrintS(
"SIGNATURE OF PAIR: ");
2671 Lp.p1 = strat->
S[
i];
2685 Lp.i_r1 = strat->
S_2_R[
i];
2714 printf(
"\nTrying to add p and S[%i]\n",i);
2744 unsigned long pSigMultNegSev,sSigMultNegSev;
2748 Lp.ecart=0; Lp.length=0;
2753 #ifndef HAVE_RATGRING 2754 pLcm(p,strat->
S[i],Lp.lcm);
2755 #elif defined(HAVE_RATGRING) 2771 printf(
"\nIn Spoly: m1, m2 :\n");
pWrite(m1);
pWrite(m2);
2792 if(pSigMult !=
NULL)
2795 if(sSigMult !=
NULL)
2799 Print(
"----------------\n");
2802 Print(
"----------------\n");
2806 if(pSigMult !=
NULL && sSigMult !=
NULL)
2815 if(pSigMult ==
NULL)
2817 if(sSigMult ==
NULL)
2827 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2837 printf(
"\nPossible sigdrop in enterpairSig (due to lost of sig)\n");
2852 int red_result =
redRing(&Lp,strat);
2854 printf(
"\nAfter redRing reduce:\n");
pWrite(Lp.p);
2860 printf(
"\nCancel the sigdrop. It reduced to 0\n");
2869 printf(
"\nSigdrop. end\n");
2871 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
2873 strat->
enterS(Lp,0,strat,strat->
tl);
2887 Lp.sig =
pCopy(pSigMult);
2917 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2918 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2924 printf(
"\nDELETED!\n");
2947 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
3004 Lp.sig =
pNeg(Lp.sig);
3015 Lp.sevSig = ~pSigMultNegSev;
3022 Lp.sevSig = ~sSigMultNegSev;
3034 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
3038 printf(
"\nrewCrit3 deletes it!\n");
3052 Lp.checked = strat->
sl+1;
3059 Lp.prod_crit =
TRUE;
3072 PrintS(
"SIGNATURE OF PAIR: ");
3076 Lp.p1 = strat->
S[
i];
3091 Lp.i_r1 = strat->
S_2_R[
i];
3110 printf(
"\nSigDrop in enteronepairSig\n");
pWrite(Lp.sig);
3116 int red_result =
redRing(&Lp,strat);
3121 printf(
"\nCancel the sigdrop after redRing (=0)\n");
3130 printf(
"\nAfter redRing still sigdrop:\n");
pWrite(Lp.p);
3132 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
3135 strat->
enterS(Lp,0,strat, strat->
tl+1);
3141 printf(
"\nThis spair was added to B:\n");
3175 pLcm(p,strat->
S[i],Lp.lcm);
3196 Lp.p1 = strat->
S[
i];
3200 Lp.i_r1 = strat->
S_2_R[
i];
3215 l = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
3226 int j=strat->
Ll+strat->
Bl+1;
3236 for (i=strat->
Bl; i>=0; i--)
3238 j = strat->
posInL(strat->
L,j,&(strat->
B[i]),strat);
3249 int j=strat->
Ll+strat->
Bl+1;
3259 for (i=strat->
Bl; i>=0; i--)
3261 j = strat->
posInLSba(strat->
L,j,&(strat->
B[i]),strat);
3282 for (j=0; j<=strat->
sl; j++)
3286 for (i=strat->
Bl; i>=0; i--)
3308 for (j=strat->
Ll; j>=0; j--)
3314 if (strat->
L[j].p == strat->
tail)
3334 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3360 for (j=strat->
Ll; j>=0; j--)
3380 for(i=j-1; i>=0; i--)
3382 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3399 for (j=strat->
Ll; j>=0; j--)
3430 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3433 if (strat->
L[j].p2 == p)
3439 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3453 strat->
L[
i].p2 = strat->
tail;
3470 else if (strat->
L[j].p2 == strat->
tail)
3509 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3512 if (strat->
L[j].p2 == p)
3518 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3532 strat->
L[
i].p2 = strat->
tail;
3549 else if (strat->
L[j].p2 == strat->
tail)
3557 #ifdef HAVE_RATGRING 3570 for (j=0; j<=strat->
sl; j++)
3574 for (i=strat->
Bl; i>=0; i--)
3582 Print(
"chain-crit-part: S[%d]=",j);
3584 Print(
" divide B[%d].lcm=",i);
3606 for (j=strat->
Ll; j>=0; j--)
3612 if (strat->
L[j].p == strat->
tail)
3616 PrintS(
"chain-crit-part: pCompareChainPart p=");
3618 Print(
" delete L[%d]",j);
3640 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3647 Print(
"chain-crit-part: sugar B[%d].lcm=",j);
3649 Print(
" delete B[%d]",i);
3660 Print(
"chain-crit-part: sugar B[%d].lcm=",i);
3662 Print(
" delete B[%d]",j);
3682 for (j=strat->
Ll; j>=0; j--)
3690 PrintS(
"chain-crit-part: sugar:pCompareChainPart p=");
3692 Print(
" delete L[%d]",j);
3710 for(i=j-1; i>=0; i--)
3712 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3716 Print(
"chain-crit-part: equal lcm B[%d].lcm=",j);
3718 Print(
" delete B[%d]\n",i);
3735 for (j=strat->
Ll; j>=0; j--)
3743 PrintS(
"chain-crit-part: pCompareChainPart p=");
3745 Print(
" delete L[%d]",j);
3774 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3777 if (strat->
L[j].p2 == p)
3783 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3800 strat->
L[
i].p2 = strat->
tail;
3807 PrintS(
"chain-crit-part: divisible_by p=");
3809 Print(
" delete L[%d]",l);
3820 PrintS(
"chain-crit-part: divisible_by(2) p=");
3822 Print(
" delete L[%d]",i);
3833 else if (strat->
L[j].p2 == strat->
tail)
3861 for (j=0; j<=
k; j++)
3863 if (!strat->
fromQ[j])
3874 for (j=0; j<=
k; j++)
3877 PrintS(
"\n Trying to add spoly : \n");
3888 for (j=0; j<=
k; j++)
3901 #ifdef HAVE_RATGRING 3931 for (j=0; j<=
k; j++)
3933 if (!strat->
fromQ[j])
3944 for (j=0; j<=
k; j++)
3953 for (j=0; j<=
k; j++)
3967 #ifdef HAVE_RATGRING 3990 for (j=0; j<=k && !strat->
sigdrop; j++)
3992 if (!strat->
fromQ[j])
4001 for (j=0; j<=k && !strat->
sigdrop; j++)
4010 for (j=0; j<=k && !strat->
sigdrop; j++)
4024 #ifdef HAVE_RATGRING 4052 for (j=0; j<=strat->
sl; j++)
4056 for (i=strat->
Bl; i>=0; i--)
4063 PrintS(
"--- chain criterion func chainCritRing type 1\n");
4066 PrintS(
" strat->B[i].lcm:");
4071 wrp(strat->
B[i].lcm);
4076 printf(
"\nChainCrit1\n");
4092 for (j=strat->
Ll; j>=0; j--)
4101 printf(
"\nChainCrit2\n");
4111 PrintS(
"--- chain criterion func chainCritRing type 2\n");
4112 PrintS(
"strat->L[j].p:");
4143 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
4146 if (strat->
L[j].p2 == p)
4154 &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
4161 PrintS(
"--- chain criterion func chainCritRing type 3\n");
4162 PrintS(
"strat->L[j].lcm:");
4163 wrp(strat->
L[j].lcm);
4164 PrintS(
" strat->L[i].lcm:");
4165 wrp(strat->
L[i].lcm);
4170 printf(
"\nChainCrit3\n");
4185 strat->
L[
i].p2 = strat->
tail;
4202 else if (strat->
L[j].p2 == strat->
tail)
4216 if (arg <= 0)
return 0;
4228 if (arg <= 0)
return 0;
4229 if (arg%2 == 1) { arg--; }
4239 #ifdef HAVE_VANIDEAL 4250 int l,
j,compare,compareCoeff;
4254 Lp.ecart=0; Lp.length=0;
4270 for(j = strat->
Bl;j>=0;j--)
4274 if (compareCoeff == 0 || compare == compareCoeff)
4292 if (compareCoeff == 1)
4299 if (compareCoeff == -1)
4310 if ((f==
NULL) || (p==
NULL))
return;
4342 tmp_h.SetShortExpVector();
4347 enterT(tmp_h, strat, strat->
tl + 1);
4352 Lp.i_r1 = strat->
tl;
4356 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
4370 if ((*cabsind < bound) && (*cabsind - step[1] + add < bound))
4379 if (N == 1)
return 0;
4381 while (exp[i] == cexp[i] && i <= N) i++;
4383 *cabsind -= cind[
i];
4386 *cabsind += cind[
i];
4389 if (i > N)
return 0;
4393 for (
int j = i + 1;
j <=
N;
j++)
4395 if (step[1] > step[
j]) step[1] = step[
j];
4397 add =
ind2(cexp[i] + 2);
4398 if (*cabsind - step[1] + add >= bound)
4401 *cabsind -= cind[
i];
4403 *cabsind += cind[
i];
4406 if (i > N)
return 0;
4409 }
while (step[1] != -1);
4414 if (add < step[i]) step[
i] =
add;
4415 for (i = 2; i <=
N; i++)
4417 if (step[1] > step[i]) step[1] = step[
i];
4443 for (
int i = 1; i <= leadRing->N; i++)
4449 if (cabsind < leadRing->ch)
4451 zeroPoly =
p_ISet(
twoPow(leadRing->ch - cabsind), tailRing);
4455 zeroPoly =
p_ISet(1, tailRing);
4457 for (
int i = 1; i <= leadRing->N; i++)
4459 for (
long j = 1;
j <= exp[
i];
j++)
4462 tmp2 =
p_ISet(1, tailRing);
4467 zeroPoly =
p_Mult_q(zeroPoly, tmp2, tailRing);
4472 zeroPoly =
p_Mult_q(zeroPoly,
p_Add_q(tmp3, tmp2, tailRing), tailRing);
4477 for (
int i = 1; i <= leadRing->N; i++)
4483 zeroPoly =
pNext(zeroPoly);
4485 pNext(tmp2) = zeroPoly;
4506 for (
int i = 1; i <=
currRing->N; i++)
4509 if (exp[i] & 1 != 0)
4511 exp[
i] = exp[
i] - 1;
4524 PrintS(
"-------------\npoly :");
4526 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
4527 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4528 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4530 Print(
"cind : %d\n", cabsind);
4547 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4572 for (
int i = 1; i <=
currRing->N; i++)
4583 PrintS(
"-------------\npoly :");
4585 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
4586 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4587 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4588 Print(
"bound : %d\n", bound);
4589 Print(
"cind : %d\n", cabsind);
4607 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4615 G0->m[
IDELEMS(G0) - 1] = zeroPoly;
4634 for (j=0; j<=
k; j++)
4656 for (j=0; j<=k && !strat->
sigdrop; j++)
4710 PrintS(
"--- create zero spoly: ");
4739 posx = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
4792 PrintS(
"--- create zero spoly: ");
4819 printf(
"\nSigdrop in enterextended spoly\n");
pWrite(h);
pWrite(hSig);
4823 int red_result =
redRing(&Lp,strat);
4825 printf(
"\nAfter redRing reduce:\n");
pWrite(Lp.p);
4831 printf(
"\nCancel the sigdrop. It reduced to 0\n");
4840 printf(
"\nSigdrop. end\n");
4842 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
4844 strat->
enterS(Lp,0,strat,strat->
tl);
4892 if ( (!strat->
fromT)
4902 clearS(h,h_sev, &j,&k,strat);
4930 printf(
"\n Trying to add extended spolys\n");
4935 printf(
"\n Trying to add spolys\n");
4940 printf(
"\n Trying to add gcd-polys\n");
4958 if ( (!strat->
fromT)
4966 clearS(h,h_sev, &j,&k,strat);
4983 if ( (!strat->
fromT)
4991 clearS(h,h_sev, &j,&k,strat);
5008 for (j=0; j<=
k; j++)
5010 const int iCompSj =
pGetComp(strat->
S[j]);
5011 if ((iCompH==iCompSj)
5022 for (j=0; j<=
k; j++)
5024 const int iCompSj =
pGetComp(strat->
S[j]);
5025 if ((iCompH==iCompSj)
5064 clearS(h,h_sev,&j,&k,strat);
5081 int new_suc=strat->
sl+1;
5085 for (; i<=strat->
sl; i++)
5090 if (new_suc > at) new_suc = at;
5093 sev = strat->
sevS[
i];
5096 for (j=i; j>=at+1; j--)
5098 strat->
S[
j] = strat->
S[j-1];
5105 strat->
sevS[at] = sev;
5106 strat->
S_2_R[at] = s2r;
5109 for (j=i; j>=at+1; j--)
5113 strat->
fromQ[at]=fq;
5117 if (new_suc <= strat->sl) *suc=new_suc;
5131 if(length==-1)
return 0;
5150 || ((o==oo) && (
pLmCmp(
set[length],p)!= cmp_int)))
5172 if (
pLmCmp(
set[length],p)== -cmp_int)
5180 if (cmp == cmp_int)
return an;
5181 if (cmp == -cmp_int)
return en;
5187 if (cmp == cmp_int) en =
i;
5188 else if (cmp == -cmp_int) an =
i;
5197 if (
pLmCmp(
set[length],p)== -cmp_int)
5204 if (
pLmCmp(
set[an],p) == cmp_int)
return an;
5205 if (
pLmCmp(
set[an],p) == -cmp_int)
return en;
5207 && ((strat->
ecartS[an])>ecart_p))
5212 if (
pLmCmp(
set[i],p) == cmp_int) en=i;
5213 else if (
pLmCmp(
set[i],p) == -cmp_int) an=i;
5217 &&((strat->
ecartS[
i])<ecart_p))
5231 if (length<0)
return 0;
5236 for(
int i = 0;i<=
length;i++)
5245 || ((op == o) && (
pLtCmp(
set[mon],p) == -1)))
5256 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5263 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5275 || ((op == o) && (
pLtCmp(
set[length],p) == -1)))
5289 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5296 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5308 if(end < 0 || end >=
IDELEMS(F))
5310 if (end<0)
return 0;
5317 for(i=start;i<end;i++)
5331 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5338 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5363 if (length==-1)
return 0;
5365 if (
pLmCmp(
set[length].p,p.p)!=
currRing->OrdSgn)
return length+1;
5394 if (
set[length].length<p.length)
5405 if (
set[an].length>p.length)
return an;
5409 if (
set[i].length>p.length) en=
i;
5421 if (length==-1)
return 0;
5423 int o = p.GetpFDeg();
5424 int op =
set[
length].GetpFDeg();
5427 || ((op == o) && (
pLmCmp(
set[length].p,p.p) !=
currRing->OrdSgn)))
5438 op=
set[an].GetpFDeg();
5445 op =
set[
i].GetpFDeg();
5457 if (length==-1)
return 0;
5459 int o = p.GetpFDeg();
5460 int op =
set[
length].GetpFDeg();
5474 op=
set[an].GetpFDeg();
5481 op =
set[
i].GetpFDeg();
5498 if (length==-1)
return 0;
5499 int o = p.GetpFDeg();
5500 int op =
set[
length].GetpFDeg();
5505 if ((op < o) || (
pLmCmp(
set[length].p,p.p)== -cmp_int))
5512 op =
set[an].GetpFDeg();
5513 if (op > o)
return an;
5514 if (op < 0)
return en;
5515 cmp =
pLmCmp(
set[an].p,p.p);
5516 if (cmp == cmp_int)
return an;
5517 if (cmp == -cmp_int)
return en;
5522 op =
set[
i].GetpFDeg();
5524 else if (op < o) an =
i;
5527 cmp =
pLmCmp(
set[i].p,p.p);
5528 if (cmp == cmp_int) en =
i;
5529 else if (cmp == -cmp_int) an =
i;
5575 if (length==-1)
return 0;
5577 int o = p.GetpFDeg();
5578 int op =
set[
length].GetpFDeg();
5581 || (( op == o) && (
set[length].length<p.length))
5582 || (( op == o) && (
set[length].length == p.length)
5593 op =
set[an].GetpFDeg();
5595 || (( op == o) && (
set[an].length > p.length))
5596 || (( op == o) && (
set[an].length == p.length)
5602 op =
set[
i].GetpFDeg();
5604 || (( op == o) && (
set[i].length > p.length))
5605 || (( op == o) && (
set[i].length == p.length)
5617 if (length==-1)
return 0;
5619 int o = p.GetpFDeg();
5620 int op =
set[
length].GetpFDeg();
5623 || (( op == o) && (
set[length].length<p.length))
5624 || (( op == o) && (
set[length].length == p.length)
5635 op =
set[an].GetpFDeg();
5637 || (( op == o) && (
set[an].length > p.length))
5638 || (( op == o) && (
set[an].length == p.length)
5644 op =
set[
i].GetpFDeg();
5646 || (( op == o) && (
set[i].length > p.length))
5647 || (( op == o) && (
set[i].length == p.length)
5663 if (length==-1)
return 0;
5665 int o = p.GetpFDeg();
5692 int ol = p.GetpLength();
5693 if (length==-1)
return 0;
5697 int oo=
set[
length].ecart;
5698 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
5708 int oo=
set[an].ecart;
5710 || ((oo==op) && (
set[an].
pLength > ol)))
5715 int oo=
set[
i].ecart;
5717 || ((oo == op) && (
set[i].
pLength > ol)))
5749 if (length==-1)
return 0;
5751 int o = p.GetpFDeg() + p.ecart;
5766 op =
set[an].GetpFDeg()+
set[an].ecart;
5773 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5785 if (length==-1)
return 0;
5787 int o = p.GetpFDeg() + p.ecart;
5802 op =
set[an].GetpFDeg()+
set[an].ecart;
5809 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5846 if (length==-1)
return 0;
5848 int o = p.GetpFDeg() + p.ecart;
5852 || (( op == o) && (
set[length].ecart > p.ecart))
5853 || (( op == o) && (
set[length].ecart==p.ecart)
5864 op =
set[an].GetpFDeg()+
set[an].ecart;
5866 || (( op == o) && (
set[an].ecart < p.ecart))
5867 || (( op == o) && (
set[an].ecart==p.ecart)
5873 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5875 || (( op == o) && (
set[i].ecart < p.ecart))
5876 || (( op == o) && (
set[i].ecart == p.ecart)
5887 if (length==-1)
return 0;
5889 int o = p.GetpFDeg() + p.ecart;
5893 || (( op == o) && (
set[length].ecart > p.ecart))
5894 || (( op == o) && (
set[length].ecart==p.ecart)
5905 op =
set[an].GetpFDeg()+
set[an].ecart;
5907 || (( op == o) && (
set[an].ecart < p.ecart))
5908 || (( op == o) && (
set[an].ecart==p.ecart)
5914 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5916 || (( op == o) && (
set[i].ecart < p.ecart))
5917 || (( op == o) && (
set[i].ecart == p.ecart)
5933 if (length==-1)
return 0;
5937 int o = p.GetpFDeg() + p.ecart;
5940 if (
pGetComp(
set[length].p)*cc < c)
5942 if (
pGetComp(
set[length].p)*cc == c)
5946 || ((op == o) && (
set[length].ecart > p.ecart))
5947 || ((op == o) && (
set[length].ecart==p.ecart)
5963 int op =
set[an].GetpFDeg()+
set[an].ecart;
5965 || ((op == o) && (
set[an].ecart < p.ecart))
5966 || ((op == o) && (
set[an].ecart==p.ecart)
5975 else if (
pGetComp(
set[i].p)*cc == c)
5977 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
5979 || ((op == o) && (
set[i].ecart < p.ecart))
5980 || ((op == o) && (
set[i].ecart == p.ecart)
5994 if (length==-1)
return 0;
5998 int o = p.GetpFDeg() + p.ecart;
6001 if (
pGetComp(
set[length].p)*cc < c)
6003 if (
pGetComp(
set[length].p)*cc == c)
6007 || ((op == o) && (
set[length].ecart > p.ecart))
6008 || ((op == o) && (
set[length].ecart==p.ecart)
6024 int op =
set[an].GetpFDeg()+
set[an].ecart;
6026 || ((op == o) && (
set[an].ecart < p.ecart))
6027 || ((op == o) && (
set[an].ecart==p.ecart)
6036 else if (
pGetComp(
set[i].p)*cc == c)
6038 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
6040 || ((op == o) && (
set[i].ecart < p.ecart))
6041 || ((op == o) && (
set[i].ecart == p.ecart)
6061 if (length==-1)
return 0;
6064 int op=p.GetpFDeg();
6066 if (
set[length].ecart < o)
6068 if (
set[length].ecart == o)
6070 int oo=
set[
length].GetpFDeg();
6071 if ((oo < op) || ((oo==op) && (
set[length].length < p.length)))
6082 if (
set[an].ecart > o)
6084 if (
set[an].ecart == o)
6086 int oo=
set[an].GetpFDeg();
6088 || ((oo==op) && (
set[an].length > p.length)))
6094 if (
set[i].ecart > o)
6096 else if (
set[i].ecart == o)
6098 int oo=
set[
i].GetpFDeg();
6100 || ((oo == op) && (
set[i].length > p.length)))
6118 if (length<0)
return 0;
6120 int d=p->GetpFDeg();
6121 int op=
set[
length].GetpFDeg();
6124 || ((op == d) && (p->p1!=
NULL)&&(
set[length].p1==
NULL))
6135 op=
set[an].GetpFDeg();
6137 || ((op == d) && (p->p1!=
NULL) && (
set[an].p1==
NULL))
6143 op=
set[
i].GetpFDeg();
6145 || ((op==d) && (p->p1!=
NULL) && (
set[i].p1==
NULL))
6161 if (length<0)
return 0;
6187 if (length<0)
return 0;
6219 if (length<0)
return 0;
6244 if (length<0)
return 0;
6258 cmp =
pLtCmp(
set[an].sig,p->sig);
6265 if (
set[an].
FDeg > p->FDeg)
6267 if (
set[an].FDeg < p->
FDeg)
6269 if (
set[an].FDeg == p->FDeg)
6271 cmp =
pLtCmp(
set[an].p,p->p);
6280 cmp =
pLtCmp(
set[i].sig,p->sig);
6287 if (
set[i].
FDeg > p->FDeg)
6289 if (
set[i].FDeg < p->
FDeg)
6291 if (
set[i].FDeg == p->FDeg)
6293 cmp =
pLtCmp(
set[i].p,p->p);
6306 if (length < 0)
return 0;
6307 if (
set[length].
FDeg > p->FDeg)
6309 if (
set[length].
FDeg == p->FDeg)
6310 if(
set[length].
GetpLength() > p->GetpLength())
6321 if (
set[an].
FDeg > p->FDeg)
6323 if(
set[an].
FDeg == p->FDeg)
6331 if(
nGreater(
set[an].p->coef, p->p->coef))
6346 if (
set[i].
FDeg > p->FDeg)
6350 if(
set[i].
FDeg == p->FDeg)
6358 if(
nGreater(
set[i].p->coef, p->p->coef))
6378 if (strat->
syzl==0)
return 0;
6383 int en= strat->
syzl-1;
6419 if (length<0)
return 0;
6421 int o = p->GetpFDeg();
6422 int op =
set[
length].GetpFDeg();
6425 || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6434 op =
set[an].GetpFDeg();
6441 op =
set[
i].GetpFDeg();
6461 if (length<0)
return 0;
6463 int o = p->GetpFDeg();
6464 int op =
set[
length].GetpFDeg();
6476 op =
set[an].GetpFDeg();
6483 op =
set[
i].GetpFDeg();
6495 if (length<0)
return 0;
6496 if(start == (length +1))
return (length+1);
6497 int o = p->GetpFDeg();
6498 int op =
set[
length].GetpFDeg();
6510 op =
set[an].GetpFDeg();
6517 op =
set[
i].GetpFDeg();
6531 if (length < 0)
return 0;
6541 if (
set[an].
FDeg > p->FDeg)
6543 if (
set[an].FDeg < p->
FDeg)
6545 if (
set[an].FDeg == p->FDeg)
6575 if (
set[i].
FDeg > p->FDeg)
6577 if (
set[i].FDeg < p->
FDeg)
6579 if (
set[i].FDeg == p->FDeg)
6619 if (coeff == 0)
return -1;
6622 while (tmp % 2 == 0)
6641 if (length < 0)
return 0;
6643 int o = p->GetpFDeg();
6644 int op =
set[
length].GetpFDeg();
6646 if ((op > o) || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6655 op =
set[an].GetpFDeg();
6656 if ((op > o) || ((op == o) && (
pLmCmp(
set[an].p,p->p) != -
currRing->OrdSgn)))
6661 op =
set[
i].GetpFDeg();
6662 if ((op > o) || ((op == o) && (
pLmCmp(
set[i].p,p->p) != -
currRing->OrdSgn)))
6717 if (length<0)
return 0;
6719 int o = p->GetpFDeg();
6720 int op =
set[
length].GetpFDeg();
6723 || ((op == o) && (
set[length].length >p->length))
6724 || ((op == o) && (
set[length].length <= p->length)
6734 op =
set[an].GetpFDeg();
6736 || ((op == o) && (
set[an].length >p->length))
6737 || ((op == o) && (
set[an].length <=p->length)
6743 op =
set[
i].GetpFDeg();
6745 || ((op == o) && (
set[i].length > p->length))
6746 || ((op == o) && (
set[i].length <= p->length)
6758 if (length<0)
return 0;
6760 int o = p->GetpFDeg();
6761 int op =
set[
length].GetpFDeg();
6764 || ((op == o) && (
set[length].length >p->length))
6765 || ((op == o) && (
set[length].length <= p->length)
6775 op =
set[an].GetpFDeg();
6777 || ((op == o) && (
set[an].length >p->length))
6778 || ((op == o) && (
set[an].length <=p->length)
6784 op =
set[
i].GetpFDeg();
6786 || ((op == o) && (
set[i].length > p->length))
6787 || ((op == o) && (
set[i].length <= p->length)
6805 if (length<0)
return 0;
6807 int o = p->GetpFDeg();
6840 if (length<0)
return 0;
6842 int o = p->GetpFDeg() + p->ecart;
6846 || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6855 op =
set[an].GetpFDeg() +
set[an].ecart;
6862 op =
set[
i].GetpFDeg() +
set[
i].ecart;
6875 if (length<0)
return 0;
6877 int o = p->GetpFDeg() + p->ecart;
6890 op =
set[an].GetpFDeg() +
set[an].ecart;
6897 op =
set[
i].GetpFDeg() +
set[
i].ecart;
6916 if (length<0)
return 0;
6918 int o = p->GetpFDeg() + p->ecart;
6920 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6921 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6922 && (
set[length].ecart > p->ecart))
6923 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6924 && (
set[length].ecart == p->ecart)
6934 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
6935 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6936 && (
set[an].ecart > p->ecart))
6937 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6938 && (
set[an].ecart == p->ecart)
6944 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
6945 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6946 && (
set[i].ecart > p->ecart))
6947 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6948 && (
set[i].ecart == p->ecart)
6960 if (length<0)
return 0;
6962 int o = p->GetpFDeg() + p->ecart;
6964 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6965 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6966 && (
set[length].ecart > p->ecart))
6967 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6968 && (
set[length].ecart == p->ecart)
6978 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
6979 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6980 && (
set[an].ecart > p->ecart))
6981 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6982 && (
set[an].ecart == p->ecart)
6988 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
6989 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6990 && (
set[i].ecart > p->ecart))
6991 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6992 && (
set[i].ecart == p->ecart)
7010 if (length<0)
return 0;
7014 unsigned long c =
pGetComp(p->p)*cc;
7015 int o = p->GetpFDeg() + p->ecart;
7017 if (
pGetComp(
set[length].p)*cc > c)
7019 if (
pGetComp(
set[length].p)*cc == c)
7021 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
7022 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
7023 && (
set[length].ecart > p->ecart))
7024 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
7025 && (
set[length].ecart == p->ecart)
7040 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
7041 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7042 && (
set[an].ecart > p->ecart))
7043 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7044 && (
set[an].ecart == p->ecart)
7053 else if (
pGetComp(
set[i].p)*cc == c)
7055 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
7056 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7057 && (
set[i].ecart > p->ecart))
7058 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7059 && (
set[i].ecart == p->ecart)
7074 if (length<0)
return 0;
7078 unsigned long c =
pGetComp(p->p)*cc;
7079 int o = p->GetpFDeg() + p->ecart;
7081 if (
pGetComp(
set[length].p)*cc > c)
7083 if (
pGetComp(
set[length].p)*cc == c)
7085 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
7086 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
7087 && (
set[length].ecart > p->ecart))
7088 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
7089 && (
set[length].ecart == p->ecart)
7104 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
7105 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7106 && (
set[an].ecart > p->ecart))
7107 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7108 && (
set[an].ecart == p->ecart)
7117 else if (
pGetComp(
set[i].p)*cc == c)
7119 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
7120 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7121 && (
set[i].ecart > p->ecart))
7122 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7123 && (
set[i].ecart == p->ecart)
7142 PrintS(
"syzygy criterion checks: ");
7145 for (
int k=0;
k<strat->
syzl;
k++)
7150 Print(
"checking with: %d / %d -- \n",
k,strat->
syzl);
7182 PrintS(
"--- syzygy criterion checks: ");
7191 min = strat->
syzIdx[comp-2];
7201 max = strat->
syzIdx[comp-1];
7203 for (
int k=min;
k<
max;
k++)
7206 Print(
"COMP %d/%d - MIN %d - MAX %d - SYZL %ld\n",comp,strat->
currIdx,min,max,strat->
syzl);
7207 Print(
"checking with: %d -- ",
k);
7235 PrintS(
"rewritten criterion checks: ");
7238 for(
int k = strat->
sl;
k>=start;
k--)
7242 PrintS(
"checking with: ");
7253 printf(
"\nFaugere RewCrit: * divisible by *\n");
pWrite(sig);
pWrite(strat->
sig[
k]);
7261 PrintS(
"ALL ELEMENTS OF S\n----------------------------------------\n");
7262 for(
int kk = 0; kk<strat->
sl+1; kk++)
7266 PrintS(
"------------------------------\n");
7293 printf(
"\narriRewCrit\n");
7299 for (
int ii=strat->
sl; ii>start; ii--)
7305 if (!(
pLmCmp(p1,p2) == 1))
7308 printf(
"\narriRewCrit deleted: sig, P.sig\n");
7324 printf(
"\narriRewCritPre\n");
7330 for (
int i=strat->
Bl; i>-1; i--) {
7339 if (
pLmCmp(lm,strat->
B[found].GetLmCurrRing()) == -1)
7343 printf(
"\nDelete!\n");
7349 printf(
"\nDelete this one!\n");
7356 for (
int ii=strat->
sl; ii>-1; ii--)
7362 if (!(
pLmCmp(p1,p2) == 1))
7367 printf(
"\nDelete this one!\n");
7388 const unsigned long not_sev = ~L->sev;
7389 const unsigned long* sev = strat->
sevS;
7402 if (j > pos)
return NULL;
7403 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7405 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7410 if (!(sev[j] & not_sev) &&
7411 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]) &&
7425 if (j > pos)
return NULL;
7426 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7433 if (!(sev[j] & not_sev) &&
7434 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]) &&
7445 if (strat->
tl < 0 || strat->
S_2_R[j] == -1)
7447 T->Set(strat->
S[j], r, strat->
tailRing);
7455 return strat->
S_2_T(j);
7465 if (j > pos)
return NULL;
7467 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7468 t = strat->
S_2_T(j);
7471 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7476 if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7478 t = strat->
S_2_T(j);
7479 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[j]);
7494 if (j > pos)
return NULL;
7496 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7497 t = strat->
S_2_T(j);
7505 if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7507 t = strat->
S_2_T(j);
7508 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[j]);
7558 if (With ==
NULL)
break;
7568 return redtail(L, pos, strat);
7574 if (hn ==
NULL)
goto all_done;
7595 return redtail(&L, pos, strat);
7600 #define REDTAIL_CANONICALIZE 100 7604 p = h = L->GetLmTailRing();
7606 return L->GetLmCurrRing();
7613 Ln.pLength = L->GetpLength() - 1;
7637 Ln.SetShortExpVector();
7643 With = &(strat->
T[
j]);
7648 if (With ==
NULL)
break;
7675 pNext(h) = Ln.LmExtractAndIter();
7678 }
while (!Ln.IsNull());
7681 if (Ln.IsNull())
goto all_done;
7682 if (! withT) With_s.Init(
currRing);
7684 pNext(h) = Ln.LmExtractAndIter();
7703 return L->GetLmCurrRing();
7708 #define REDTAIL_CANONICALIZE 100 7712 p = h = L->GetLmTailRing();
7714 return L->GetLmCurrRing();
7721 Ln.pLength = L->GetpLength() - 1;
7745 Ln.SetShortExpVector();
7751 With = &(strat->
T[
j]);
7756 if (With ==
NULL)
break;
7783 pNext(h) = Ln.LmExtractAndIter();
7786 }
while (!Ln.IsNull());
7792 Ln.p =
pJet(Ln.p,bound);
7798 if (! withT) With_s.Init(
currRing);
7800 pNext(h) = Ln.LmExtractAndIter();
7819 return L->GetLmCurrRing();
7829 p = h = L->GetLmTailRing();
7831 return L->GetLmCurrRing();
7838 Ln.pLength = L->GetpLength() - 1;
7851 Ln.SetShortExpVector();
7853 if (With ==
NULL)
break;
7863 poly p_Ln=Ln.GetLmCurrRing();
7864 poly p_With=With->GetLmCurrRing();
7876 if (Ln.bucket!=
NULL)
7907 pNext(h) = Ln.LmExtractAndIter();
7910 }
while (!Ln.IsNull());
7913 if (Ln.IsNull())
goto all_done;
7916 pNext(h) = Ln.LmExtractAndIter();
7934 return L->GetLmCurrRing();
7950 if (strat->
Ll != *reduc)
7952 if (strat->
Ll != *reduc-1)
7964 if (red_result == 0)
7966 else if (red_result < 0)
7968 if ((red_result > 0) || ((strat->
Ll % 100)==99))
7970 if (strat->
Ll != *reduc && strat->
Ll > 0)
7987 Print(
"product criterion:%d chain criterion:%d\n",strat->
cp,strat->
c3);
7988 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7990 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
8001 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
8003 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
8018 for (i=0; i<=strat->
sl; i++)
8028 for (i=0; i<=strat->
tl; i++)
8032 Print(
" o:%ld e:%d l:%d",
8033 strat->
T[i].pFDeg(),strat->
T[
i].ecart,strat->
T[
i].length);
8038 for (i=strat->
Ll; i>=0; i--)
8047 Print(
" o:%ld e:%d l:%d",
8048 strat->
L[i].pFDeg(),strat->
L[
i].ecart,strat->
L[
i].length);
8070 strat->
S=strat->
Shdl->m;
8075 memset(strat->
fromQ,0,i*
sizeof(
int));
8081 h.p =
pCopy(Q->m[i]);
8102 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8105 strat->
enterS(h,pos,strat,-1);
8106 strat->
fromQ[pos]=1;
8116 h.p =
pCopy(F->m[i]);
8138 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8140 strat->
enterS(h,pos,strat,-1);
8166 strat->
S=strat->
Shdl->m;
8171 memset(strat->
fromQ,0,i*
sizeof(
int));
8177 h.p =
pCopy(Q->m[i]);
8198 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8201 strat->
enterS(h,pos,strat,-1);
8202 strat->
fromQ[pos]=1;
8212 h.p =
pCopy(F->m[i]);
8235 pos = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
8265 strat->
S = strat->
Shdl->m;
8278 memset(strat->
fromQ,0,i*
sizeof(
int));
8284 h.p =
pCopy(Q->m[i]);
8305 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8308 strat->
enterS(h,pos,strat,-1);
8309 strat->
fromQ[pos]=1;
8319 h.p =
pCopy(F->m[i]);
8420 for(i=1; i<=strat->
sl; i++)
8436 #if defined(DEBUGF5) || defined(DEBUGF51) 8437 PrintS(
"------------- GENERATING SYZ RULES NEW ---------------\n");
8444 while (i <= strat->sl)
8456 diff = comp - comp_old - 1;
8474 for (k = 0; k<
i; k++)
8501 diff = comp - comp_old - 1;
8518 for (k = 0; k<strat->
sl+1; k++)
8539 PrintS(
"Principal syzygies:\n");
8542 Print(
"ps %d\n",ps);
8543 PrintS(
"--------------------------------\n");
8544 for(i=0;i<=strat->
syzl-1;i++)
8553 PrintS(
"--------------------------------\n");
8573 strat->
S=strat->
Shdl->m;
8579 memset(strat->
fromQ,0,i*
sizeof(
int));
8585 h.p =
pCopy(Q->m[i]);
8606 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8609 strat->
enterS(h,pos,strat, strat->
tl+1);
8611 strat->
fromQ[pos]=1;
8622 h.p =
pCopy(F->m[i]);
8637 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8639 strat->
enterS(h,pos,strat, strat->
tl+1);
8681 h.is_normalized = 0;
8686 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8688 strat->
enterS(h,pos,strat, strat->
tl+1);
8696 strat->
enterS(h,0,strat, strat->
tl+1);
8718 strat->
S=strat->
Shdl->m;
8724 memset(strat->
fromQ,0,i*
sizeof(
int));
8730 h.p =
pCopy(Q->m[i]);
8751 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8754 strat->
enterS(h,pos,strat, strat->
tl+1);
8756 strat->
fromQ[pos]=1;
8767 h.p =
pCopy(F->m[i]);
8782 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8784 strat->
enterS(h,pos,strat, strat->
tl+1);
8826 h.is_normalized = 0;
8831 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8833 strat->
enterS(h,pos,strat, strat->
tl+1);
8841 strat->
enterS(h,0,strat, strat->
tl+1);
8857 while (j <= maxIndex)
8874 if (!
pIsVector((*p).p) && ((*p).ecart != 0))
8883 h1 = r =
pCopy((*p).p);
8936 while ((j <= strat->sl) && (
pGetComp(strat->
S[j])!=0)) j++;
8938 while (j<=strat->sl)
8962 while (j <= maxIndex)
9016 while (j <= maxIndex);
9046 while (i<=strat->sl)
9053 redSi =
pHead(strat->
S[i]);
9054 strat->
S[
i] =
redBba(strat->
S[i],i-1,strat);
9057 if (
pCmp(redSi,strat->
S[i])!=0)
9070 if (strat->
S[i]==
NULL)
9078 if (strat->
S[i]==
NULL)
9096 DENOMINATOR_LIST=denom;
9115 if (any_change)
reorderS(&suc,strat);
9120 for (i=0; i<=strat->
sl; i++)
9141 h.sev = strat->
sevS[
i];
9154 while (i<=strat->sl)
9159 redSi=
pHead((strat->
S)[i]);
9166 else if (
pCmp((strat->
S)[i],redSi)!=0)
9183 DENOMINATOR_LIST=denom;
9198 strat->
sevS[
i] = h.sev;
9208 if (any_change)
reorderS(&suc,strat);
9209 else { suc=-1;
break; }
9220 for (i=0; i<=strat->
sl; i++)
9224 strat->
S[
i] = h.p =
redtail(strat->
S[i],strat->
sl,strat);
9228 strat->
sevS[
i] = h.sev;
9234 h.sev = strat->
sevS[
i];
9235 h.length = h.pLength =
pLength(h.p);
9244 if (suc!= -1)
updateS(toT,strat);
9264 *
sizeof(
unsigned long));
9291 strat->
Shdl->m=strat->
S;
9293 if (atS <= strat->sl)
9295 #ifdef ENTER_USE_MEMMOVE 9296 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9297 (strat->
sl - atS + 1)*
sizeof(
poly));
9298 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9299 (strat->
sl - atS + 1)*
sizeof(
int));
9300 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9301 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9302 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9303 (strat->
sl - atS + 1)*
sizeof(
int));
9305 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9306 (strat->
sl - atS + 1)*
sizeof(
int));
9308 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9311 for (i=strat->
sl+1; i>=atS+1; i--)
9313 strat->
S[
i] = strat->
S[i-1];
9319 for (i=strat->
sl+1; i>=atS+1; i--)
9322 for (i=strat->
sl+1; i>=atS+1; i--)
9328 #ifdef ENTER_USE_MEMMOVE 9329 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9330 (strat->
sl - atS + 1)*
sizeof(
int));
9332 for (i=strat->
sl+1; i>=atS+1; i--)
9337 strat->
fromQ[atS]=0;
9341 strat->
S[atS] = p.p;
9347 strat->
sevS[atS] = p.sev;
9348 strat->
ecartS[atS] = p.ecart;
9349 strat->
S_2_R[atS] = atR;
9366 *
sizeof(
unsigned long));
9370 *
sizeof(
unsigned long));
9398 strat->
Shdl->m=strat->
S;
9405 if (atS <= strat->sl)
9407 #ifdef ENTER_USE_MEMMOVE 9408 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9409 (strat->
sl - atS + 1)*
sizeof(
poly));
9410 memmove(&(strat->
sig[atS+1]), &(strat->
sig[atS]),
9411 (strat->
sl - atS + 1)*
sizeof(
poly));
9412 memmove(&(strat->
sevSig[atS+1]), &(strat->
sevSig[atS]),
9413 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9414 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9415 (strat->
sl - atS + 1)*
sizeof(
int));
9416 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9417 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9418 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9419 (strat->
sl - atS + 1)*
sizeof(
int));
9421 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9422 (strat->
sl - atS + 1)*
sizeof(
int));
9424 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9427 for (i=strat->
sl+1; i>=atS+1; i--)
9429 strat->
S[
i] = strat->
S[i-1];
9433 strat->
sig[
i] = strat->
sig[i-1];
9437 for (i=strat->
sl+1; i>=atS+1; i--)
9440 for (i=strat->
sl+1; i>=atS+1; i--)
9446 #ifdef ENTER_USE_MEMMOVE 9447 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9448 (strat->
sl - atS + 1)*
sizeof(
int));
9450 for (i=strat->
sl+1; i>=atS+1; i--)
9455 strat->
fromQ[atS]=0;
9459 strat->
S[atS] = p.p;
9460 strat->
sig[atS] = p.sig;
9466 strat->
sevS[atS] = p.sev;
9476 strat->
sevSig[atS] = p.sevSig;
9478 strat->
ecartS[atS] = p.ecart;
9479 strat->
S_2_R[atS] = atR;
9483 Print(
"--- LIST S: %d ---\n",strat->
sl);
9484 for(k=0;k<=strat->
sl;k++)
9488 PrintS(
"--- LIST S END ---\n");
9504 assume(p.FDeg == p.pFDeg());
9509 for(i=strat->
tl;i>=0;i--)
9511 if (p.p==strat->
T[i].p)
9513 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
9519 #ifdef HAVE_TAIL_RING 9522 p.t_p=p.GetLmTailRing();
9527 atT = strat->
posInT(strat->
T, strat->
tl, p);
9528 if (strat->
tl == strat->
tmax-1)
9530 if (atT <= strat->tl)
9532 #ifdef ENTER_USE_MEMMOVE 9533 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9535 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9536 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9538 for (i=strat->
tl+1; i>=atT+1; i--)
9540 #ifndef ENTER_USE_MEMMOVE 9541 strat->
T[
i] = strat->
T[i-1];
9544 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9558 printf(
"\nenterT: add in position %i\n",atT);
9566 strat->
T[atT].max_exp =
NULL;
9569 strat->
R[strat->
tl] = &(strat->
T[atT]);
9570 strat->
T[atT].i_r = strat->
tl;
9590 assume(p.FDeg == p.pFDeg());
9595 for(i=strat->
tl;i>=0;i--)
9597 if (p.p==strat->
T[i].p)
9599 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
9605 #ifdef HAVE_TAIL_RING 9608 p.t_p=p.GetLmTailRing();
9613 atT = strat->
posInT(strat->
T, strat->
tl, p);
9614 if (strat->
tl == strat->
tmax-1)
9616 if (atT <= strat->tl)
9618 #ifdef ENTER_USE_MEMMOVE 9619 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9621 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9622 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9624 for (i=strat->
tl+1; i>=atT+1; i--)
9626 #ifndef ENTER_USE_MEMMOVE 9627 strat->
T[
i] = strat->
T[i-1];
9630 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9644 printf(
"\nenterT_strong: add in position %i\n",atT);
9652 strat->
T[atT].max_exp =
NULL;
9655 strat->
R[strat->
tl] = &(strat->
T[atT]);
9656 strat->
T[atT].i_r = strat->
tl;
9664 printf(
"\nDas ist p:\n");
pWrite(p.p);
9666 for(i=strat->
tl;i>=0;i--)
9671 printf(
"\nFound one: %i\n",i);
pWrite(strat->
T[i].p);
9695 printf(
"\n Entersyz:\n");
pWrite(p.sig);
9703 (strat->
syzmax)*
sizeof(
unsigned long),
9705 *
sizeof(
unsigned long));
9708 if (atT < strat->syzl)
9710 #ifdef ENTER_USE_MEMMOVE 9711 memmove(&(strat->
syz[atT+1]), &(strat->
syz[atT]),
9713 memmove(&(strat->
sevSyz[atT+1]), &(strat->
sevSyz[atT]),
9714 (strat->
syzl-atT+1)*
sizeof(
unsigned long));
9716 for (i=strat->
syzl; i>=atT+1; i--)
9718 #ifndef ENTER_USE_MEMMOVE 9719 strat->
syz[
i] = strat->
syz[i-1];
9731 strat->
syz[atT] = p.sig;
9732 strat->
sevSyz[atT] = p.sevSig;
9735 Print(
"element in strat->syz: %d--%d ",atT+1,strat->
syzmax);
9745 strat->
L[cc].sig, ~strat->
L[cc].sevSig,
currRing)
9754 printf(
"\n syzCrit deleted!\n");
pWrite(strat->
L[cc].p);
pWrite(strat->
L[cc].sig);
9762 PrintS(
"--- Syzygies ---\n");
9765 PrintS(
"--------------------------------\n");
9766 for(i=0;i<=strat->
syzl-1;i++)
9771 PrintS(
"--------------------------------\n");
9807 #ifdef HAVE_RATGRING 9852 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9853 else PrintS(
"ideal/module is not homogeneous\n");
9884 #ifdef HAVE_RATGRING 9923 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9924 else PrintS(
"ideal/module is not homogeneous\n");
10146 strat->
P.pLength=0;
10432 for (l=
IDELEMS(r)-1;l>=0;l--)
10443 for (l=
IDELEMS(r)-1;l>=0;l--)
10445 if ((r->m[l]!=
NULL)
10450 for(q=
IDELEMS(Q)-1; q>=0;q--)
10452 if ((Q->m[q]!=
NULL)
10474 for (l=
IDELEMS(r)-1;l>=0;l--)
10476 if ((r->m[l]!=
NULL)
10481 for(q=
IDELEMS(Q)-1; q>=0;q--)
10483 if ((Q->m[q]!=
NULL)
10514 for (l=
IDELEMS(r)-1;l>=0;l--)
10518 for(q=
IDELEMS(Q)-1; q>=0;q--)
10527 reduction_found=
TRUE;
10543 for (l=
IDELEMS(r)-1;l>=0;l--)
10547 for(q=
IDELEMS(Q)-1; q>=0;q--)
10558 reduction_found=
TRUE;
10572 if ( reduction_found)
10577 for (l=
IDELEMS(r)-1;l>=0;l--)
10608 for (l=
IDELEMS(r)-1;l>=0;l--)
10662 for (i=strat->
sl; i>=low; i--)
10664 int end_pos=strat->
sl;
10666 if (strat->
ak==0) end_pos=i-1;
10668 if ((T_j !=
NULL)&&(T_j->p==strat->
S[i]))
10674 Print(
"test S[%d]:",i);
10686 Print(
"to (tailR) S[%d]:",i);
10698 T_j->max_exp =
NULL;
10701 T_j->pCleardenom();
10709 Print(
"test S[%d]:",i);
10715 strat->
S[
i] =
redtailBba(strat->
S[i], end_pos, strat, withT);
10729 DENOMINATOR_LIST=denom;
10742 Print(
"to (-tailR) S[%d]:",i);
10753 sloppy_max =
FALSE;
10789 if (j < strat->
HCord)
10833 assume(L->i_r1 >= -1 && L->i_r1 <= strat->
tl);
10834 assume(L->i_r2 >= -1 && L->i_r2 <= strat->
tl);
10840 if ((L->i_r1 == -1) || (L->i_r2 == -1) )
10894 ideal F =
idCopy(Forig);
10898 ideal monred =
idInit(1,1);
10899 for(
int i=0; i<
idElem(F); i++)
10905 if((posconst != -1) && (!
nIsZero(F->m[posconst]->coef)))
10915 for(
int i=0; i<idelemQ; i++)
10923 if((posconst != -1) && (!
nIsZero(monred->m[posconst]->coef)))
10925 pmon =
pCopy(monred->m[posconst]);
10939 for(
int i = 0, j = 0; i<
IDELEMS(F); i++)
10940 II->m[j++] =
prMapR(F->m[i], nMap, origR, QQ_ring);
10941 for(
int i = 0, j =
IDELEMS(F); i<idelemQ; i++)
10942 II->m[j++] =
prMapR(Q->m[i], nMap, origR, QQ_ring);
10948 for(
int i =
IDELEMS(II)-1; i>=0; i--)
10949 if(II->m[i] !=
NULL)
10950 II->m[i+1] = II->m[
i];
10954 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
10961 integer =
pHead(syz->m[i]);
10968 pmon =
prMapR(integer, nMap2, QQ_ring, origR);
10983 for(
int i = 0; i<
IDELEMS(one); i++)
10987 if(mindegmon ==
NULL)
10988 mindegmon =
pCopy(one->m[i]);
10991 if(
p_Deg(one->m[i], QQ_ring) <
p_Deg(mindegmon, QQ_ring))
10992 mindegmon =
pCopy(one->m[i]);
10996 if(mindegmon !=
NULL)
10998 for(
int i =
IDELEMS(II)-1; i>=0; i--)
10999 if(II->m[i] !=
NULL)
11000 II->m[i+1] = II->m[
i];
11001 II->m[0] =
pCopy(mindegmon);
11004 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
11018 if (found ==
FALSE)
11030 pmon =
prMapR(mindegmon, nMap2, QQ_ring, origR);
11061 poly pH = h->GetP();
11065 for(
int i = 0; i<=strat->
sl; i++)
11120 h->SetLmCurrRing();
11121 if((deleted)&&(h->p!=
NULL))
11129 poly hSig = h->sig;
11130 poly pH = h->GetP();
11134 for(
int i = 0; i<=strat->
sl; i++)
11145 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
11172 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
11203 h->SetLmCurrRing();
11219 for(
int j = 0; j<=strat->
sl; j++)
11223 for(
int i = 0; i<=strat->
sl; i++)
11225 if((i != j) && (strat->
S[i] !=
NULL))
11285 if (expbound == 0) expbound = strat->
tailRing->bitmask << 1;
11302 new_tailRing->pFDeg =
currRing->pFDeg;
11303 new_tailRing->pLDeg =
currRing->pLDeg;
11307 Print(
"[%lu:%d", (
unsigned long) new_tailRing->bitmask, new_tailRing->ExpL_Size);
11316 for (i=0; i<=strat->
tl; i++)
11318 strat->
T[
i].ShallowCopyDelete(new_tailRing, new_tailBin,
11319 p_shallow_copy_delete);
11321 for (i=0; i<=strat->
Ll; i++)
11325 strat->
L[
i].ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11327 if ((strat->
P.t_p !=
NULL) ||
11329 strat->
P.ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11331 if ((L !=
NULL) && (L->tailRing != new_tailRing))
11334 L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11340 L->tailRing = new_tailRing;
11343 L->max_exp = t_l->max_exp;
11347 if ((T !=
NULL) && (T->tailRing != new_tailRing && T->i_r < 0))
11348 T->ShallowCopyDelete(new_tailRing, new_tailBin, p_shallow_copy_delete);
11355 strat->
tailBin = new_tailBin;
11381 unsigned long l = 0;
11387 for (i=0; i<= strat->
Ll; i++)
11391 for (i=0; i<=strat->
tl; i++)
11418 res->block0 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11419 res->block1 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11420 int **wvhdl = (
int **)
omAlloc0((n+1)*
sizeof(
int*));
11421 res->wvhdl = wvhdl;
11422 for (
int i=1; i<n; i++)
11424 res->order[
i] = r->order[i-1];
11425 res->block0[
i] = r->block0[i-1];
11426 res->block1[
i] = r->block1[i-1];
11427 res->wvhdl[
i] = r->wvhdl[i-1];
11433 for (
int i=
rBlocks(res); i>0; --
i)
11446 #ifndef SING_NDEBUG 11447 WarnS(
"error in nc_rComplete");
11466 res->block0 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11467 res->block1 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11468 int **wvhdl = (
int **)
omAlloc0((n+2)*
sizeof(
int*));
11469 res->wvhdl = wvhdl;
11470 for (
int i=2; i<n+2; i++)
11472 res->order[
i] = r->order[i-2];
11473 res->block0[
i] = r->block0[i-2];
11474 res->block1[
i] = r->block1[i-2];
11475 res->wvhdl[
i] = r->wvhdl[i-2];
11480 res->block0[0] = 1;
11481 res->wvhdl[0] = (
int *)
omAlloc(res->N*
sizeof(
int));
11482 for (
int i=0; i<res->N; ++
i)
11483 res->wvhdl[0][i] = 1;
11487 res->wvhdl[1] =
NULL;
11489 for (
int i=
rBlocks(res); i>1; --
i)
11502 #ifndef SING_NDEBUG 11503 WarnS(
"error in nc_rComplete");
11640 #ifdef HAVE_TAIL_BIN 11652 if (tailBin !=
NULL)
11656 if (t_kHEdge !=
NULL)
11658 if (t_kNoether !=
NULL)
11667 Timings
for the different possibilities of posInT:
11668 T15 EDL DL EL L 1-2-3
11669 Gonnet 43.26 42.30 38.34 41.98 38.40 100.04
11670 Hairer_2_1 1.11 1.15 1.04 1.22 1.08 4.7
11671 Twomat3 1.62 1.69 1.70 1.65 1.54 11.32
11672 ahml 4.48 4.03 4.03 4.38 4.96 26.50
11673 c7 15.02 13.98 15.16 13.24 17.31 47.89
11674 c8 505.09 407.46 852.76 413.21 499.19 n/
a 11675 f855 12.65 9.27 14.97 8.78 14.23 33.12
11676 gametwo6 11.47 11.35 14.57 11.20 12.02 35.07
11677 gerhard_3 2.73 2.83 2.93 2.64 3.12 6.24
11678 ilias13 22.89 22.46 24.62 20.60 23.34 53.86
11679 noon8 40.68 37.02 37.99 36.82 35.59 877.16
11680 rcyclic_19 48.22 42.29 43.99 45.35 51.51 204.29
11681 rkat9 82.37 79.46 77.20 77.63 82.54 267.92
11682 schwarz_11 16.46 16.81 16.76 16.81 16.72 35.56
11683 test016 16.39 14.17 14.40 13.50 14.26 34.07
11684 test017 34.70 36.01 33.16 35.48 32.75 71.45
11685 test042 10.76 10.99 10.27 11.57 10.45 23.04
11686 test058 6.78 6.75 6.51 6.95 6.22 9.47
11687 test066 10.71 10.94 10.76 10.61 10.56 19.06
11688 test073 10.75 11.11 10.17 10.79 8.63 58.10
11689 test086 12.23 11.81 12.88 12.24 13.37 66.68
11690 test103 5.05 4.80 5.47 4.64 4.89 11.90
11691 test154 12.96 11.64 13.51 12.46 14.61 36.35
11692 test162 65.27 64.01 67.35 59.79 67.54 196.46
11693 test164 7.50 6.50 7.68 6.70 7.96 17.13
11694 virasoro 3.39 3.50 3.35 3.47 3.70 7.66
11704 if (length==-1)
return 0;
11707 int op=p.GetpFDeg();
11708 int ol = p.GetpLength();
11710 if (
set[length].ecart < o)
11712 if (
set[length].ecart == o)
11714 int oo=
set[
length].GetpFDeg();
11715 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
11726 if (
set[an].ecart > o)
11728 if (
set[an].ecart == o)
11730 int oo=
set[an].GetpFDeg();
11732 || ((oo==op) && (
set[an].
pLength > ol)))
11738 if (
set[i].ecart > o)
11740 else if (
set[i].ecart == o)
11742 int oo=
set[
i].GetpFDeg();
11744 || ((oo == op) && (
set[i].
pLength > ol)))
11758 if (length==-1)
return 0;
11760 int op=p.GetpFDeg();
11761 int ol = p.GetpLength();
11763 int oo=
set[
length].GetpFDeg();
11764 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
11774 int oo=
set[an].GetpFDeg();
11776 || ((oo==op) && (
set[an].
pLength > ol)))
11781 int oo=
set[
i].GetpFDeg();
11783 || ((oo == op) && (
set[i].
pLength > ol)))
11794 int ol = p.GetpLength();
11797 if (
set[length].length<p.length)
11808 if (
set[an].
pLength>ol)
return an;
11829 if (strat->
red==redFirst)
PrintS(
"redFirst\n");
11831 else if (strat->
red==redEcart)
PrintS(
"redEcart\n");
11833 else Print(
"%p\n",(
void*)strat->
red);
11852 #ifdef HAVE_MORE_POS_IN_T 11883 else if (strat->
enterS==enterSMora)
PrintS(
"enterSMora\n");
11884 else if (strat->
enterS==enterSMoraNF)
PrintS(
"enterSMoraNF\n");
11890 PrintS(
"initEcartPair: ");
11894 Print(
"homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
11896 Print(
"honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
11902 Print(
"posInLDependsOnLength=%d\n",
11934 PrintS(
"currRing->pFDeg: ");
11949 PrintS(
"ecartWeights: ");
11956 #ifndef SING_NDEBUG 11961 #ifdef HAVE_SHIFTBBA 11975 #ifdef HAVE_SHIFTBBA 11992 #ifdef HAVE_SHIFTBBA 12084 #ifdef HAVE_SHIFTBBA 12094 for (i=0; i<=strat->
sl; i++)
12096 memset(&h,0,
sizeof(h));
12099 h.sev = strat->
sevS[
i];
12113 #ifdef HAVE_SHIFTBBA 12189 #ifdef HAVE_SHIFTBBA 12229 qfromQ = strat->
fromQ[
i];
12241 enterOnePairShift(qq, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, 0, i, uptodeg, lV);
12243 for (j=1; j<= toInsert; j++)
12259 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, i, uptodeg, lV);
12264 #ifdef HAVE_SHIFTBBA 12306 for (; j<= toInsert; j++)
12323 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, -1, uptodeg, lV);
12328 #ifdef HAVE_SHIFTBBA 12332 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)
12356 int qfromQ = qisFromQ;
12365 Lp.ecart=0; Lp.length=0;
12374 if (!
isInV(Lp.lcm, lV))
12379 PrintS(
"V crit applied to q = ");
12395 if((!((ecartq>0)&&(ecart>0)))
12418 Lp.ecart =
si_max(ecart,ecartq);
12419 if (strat->
fromT && (ecartq>ecart))
12437 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
12442 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12486 if (strat->
fromT && (ecartq>ecart))
12499 for(j = strat->
Bl;j>=0;j--)
12501 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
12505 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12529 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (qfromQ!=0))
12596 if ( (atR >= 0) && (shiftcount==0) && (ifromS >=0) )
12615 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
12621 #ifdef HAVE_SHIFTBBA 12642 for (j=0; j<=
k; j++)
12644 if (!strat->
fromQ[j])
12657 for (j=0; j<=
k; j++)
12670 for (j=0; j<=
k; j++)
12695 #ifdef HAVE_SHIFTBBA 12708 if ( (!strat->
fromT)
12717 clearS(h,h_sev, &j,&k,strat);
12726 #ifdef HAVE_SHIFTBBA 12746 atT = strat->
posInT(strat->
T, strat->
tl, p);
12753 for (i=1; i<=toInsert; i++)
12764 atT = strat->
posInT(strat->
T, strat->
tl, qq);
12773 #ifdef HAVE_SHIFTBBA 12780 p = h = L->GetLmTailRing();
12782 return L->GetLmCurrRing();
12789 Ln.pLength = L->GetpLength() - 1;
12797 while(!Ln.IsNull())
12801 Ln.SetShortExpVector();
12807 With = &(strat->
T[
j]);
12812 if (With ==
NULL)
break;
12828 pNext(h) = Ln.LmExtractAndIter();
12831 }
while (!Ln.IsNull());
12834 if (Ln.IsNull())
goto all_done;
12835 if (! withT) With_s.Init(
currRing);
12837 pNext(h) = Ln.LmExtractAndIter();
12852 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))) ...
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)
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)
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)
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