44 #define ENTER_USE_MEMMOVE
84 #ifdef ENTER_USE_MYMEMMOVE
85 inline void _my_memmove_d_gt_s(
unsigned long* d,
unsigned long*
s,
long l)
87 register unsigned long* _dl = (
unsigned long*) d;
88 register unsigned long* _sl = (
unsigned long*) s;
89 register long _i = l - 1;
99 inline void _my_memmove_d_lt_s(
unsigned long* d,
unsigned long*
s,
long l)
101 register long _ll =
l;
102 register unsigned long* _dl = (
unsigned long*) d;
103 register unsigned long* _sl = (
unsigned long*) s;
104 register long _i = 0;
114 inline void _my_memmove(
void* d,
void* s,
long l)
116 unsigned long _d = (
unsigned long) d;
117 unsigned long _s = (
unsigned long) s;
118 unsigned long _l = ((
l) + SIZEOF_LONG - 1) >> LOG_SIZEOF_LONG;
120 if (_d > _s) _my_memmove_d_gt_s(_d, _s, _l);
121 else _my_memmove_d_lt_s(_d, _s, _l);
125 #define memmove(d,s,l) _my_memmove(d, s, l)
132 #define pDivComp_EQUAL 2
133 #define pDivComp_LESS 1
134 #define pDivComp_GREATER -1
135 #define pDivComp_INCOMP 0
147 unsigned long la, lb;
148 unsigned long divmask =
currRing->divmask;
149 for (i=0; i<
currRing->VarL_Size; i++)
158 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
165 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
195 unsigned long la, lb;
196 unsigned long divmask =
currRing->divmask;
197 for (i=0; i<
currRing->VarL_Size; i++)
206 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
213 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
220 if (b) {
return -1; }
241 poly p = L->GetLmTailRing();
244 if (L->bucket !=
NULL)
282 L->ecart = L->pLDeg() - L->GetpFDeg();
291 L->ecart = L->pLDeg(strat->
LDegLast) - L->GetpFDeg();
333 ring
r = L->tailRing;
334 poly p = L->GetLmTailRing();
341 printf(
"\n cancelunit\n");
402 if (i == r->N)
break;
414 printf(
"\nDoes not divide\n");
419 printf(
"\nDivides. Go On\n");
475 inline static unsigned long*
initsevS (
const int maxnr)
477 return (
unsigned long*)
omAlloc0(maxnr*
sizeof(
unsigned long));
481 return (
int*)
omAlloc0(maxnr*
sizeof(
int));
485 int &length,
const int incr)
490 assume((length+incr) > 0);
494 (length+incr)*
sizeof(
TObject));
496 sevT = (
unsigned long*)
omReallocSize(sevT, length*
sizeof(
long*),
497 (length+incr)*
sizeof(
long*));
500 (length+incr)*
sizeof(
TObject*));
501 for (i=length-1;i>=0;i--) R[T[i].i_r] = &(T[i]);
516 for (j=0; j<=strat->
tl; j++)
520 if (strat->
T[j].max !=
NULL)
530 if (strat->
T[j].t_p !=
NULL)
539 if (p == strat->
S[i])
541 if (strat->
T[j].t_p !=
NULL)
565 assume(((*length)+incr)>0);
568 ((*length)+incr)*
sizeof(
LObject));
588 if ((*k) < 0)
return FALSE;
589 if (((p1 == (*p).p1) && (p2 == (*p).p2))
590 || ((p1 == (*p).p2) && (p2 == (*p).p1)))
609 if ((*k) < 0)
return FALSE;
621 for (i=0; i<=tlength; i++)
623 if (T[i].p == p)
return i;
634 if (i >= 0)
return i;
637 while (strat !=
NULL);
650 #define kFalseReturn(x) do { if (!x) return FALSE;} while (0)
656 for (i=1; i<=tailRing->N; i++)
659 return "Lm[i] different";
662 return "Lm[0] different";
664 return "Lm.next different";
666 return "Lm.coeff different";
673 ring tailRing = T->tailRing;
675 r_assume(strat_tailRing == tailRing);
680 if (T->p ==
NULL && T->t_p ==
NULL && i >= 0)
685 if (T->t_p ==
NULL && i > 0)
691 const char* msg = kTest_LmEqual(T->p, T->t_p, T->tailRing);
702 if (T->t_p !=
NULL && i >= 0 && TN ==
'T')
707 return dReportError(
"%c[%d].max is not NULL as it should be", TN, i);
714 return dReportError(
"pNext(%c[%d].max) != NULL", TN, i);
723 p_Setm(test_max, tailRing);
736 return dReportError(
"%c[%d].max != NULL but tailRing == currRing",TN,i);
738 return dReportError(
"%c[%d].t_p != NULL but tailRing == currRing",TN,i);
739 if (T->p ==
NULL && i > 0)
744 if ((i >= 0) && (T->pLength != 0)
749 return dReportError(
"%c[%d] pLength error: has %d, specified to have %d",
754 if (i >= 0 && (TN ==
'T' || TN ==
'L'))
757 if (T->FDeg != T->pFDeg())
761 return dReportError(
"%c[%d] FDeg error: has %d, specified to have %d",
762 TN, i , T->pFDeg(), d);
767 if (i >= 0 && TN ==
'T')
782 if (L->bucket !=
NULL)
784 kFalseReturn(
kbTest(L->bucket));
785 r_assume(L->bucket->bucket_ring == L->tailRing);
792 kFalseReturn(
kTest_T(L, strat_tailRing, lpos,
'L'));
801 return dReportError(
"L[%d] wrong sev: has %o, specified to have %o",
810 else if (tlength > 0 && T !=
NULL && (lpos >=0))
831 -1, strat->
T, strat->
tl));
834 if (strat->
T !=
NULL)
836 for (i=0; i<=strat->
tl; i++)
845 if (strat->
L !=
NULL)
847 for (i=0; i<=strat->
Ll; i++)
850 strat->
L[i].Next() != strat->
tail,
i,
851 strat->
T, strat->
tl));
862 if (strat->
S !=
NULL)
872 for (i=0; i<=strat->
sl; i++)
874 if (strat->
S[i] !=
NULL &&
877 return dReportError(
"S[%d] wrong sev: has %o, specified to have %o",
890 kFalseReturn(
kTest(strat));
893 for (i=0; i<=strat->
tl; i++)
895 if (strat->
T[i].i_r < 0 || strat->
T[i].i_r > strat->
tl)
896 return dReportError(
"strat->T[%d].i_r == %d out of bounds", i,
898 if (strat->
R[strat->
T[i].i_r] != &(strat->
T[i]))
902 if (strat->
S !=
NULL)
904 for (i=0; i<=strat->
sl; i++)
909 if (strat->
S_2_R[i] != strat->
T[j].i_r)
911 i, strat->
S_2_R[i], j, strat->
T[j].i_r);
915 for (i=0; i<=strat->
Ll; i++)
917 if (strat->
L[i].p1 !=
NULL && strat->
L[i].p2)
919 if (strat->
L[i].i_r1 < 0 ||
920 strat->
L[i].i_r1 > strat->
tl ||
921 strat->
L[i].T_1(strat)->p != strat->
L[
i].p1)
923 if (strat->
L[i].i_r2 < 0 ||
924 strat->
L[i].i_r2 > strat->
tl ||
925 strat->
L[i].T_2(strat)->p != strat->
L[
i].p2)
930 if (strat->
L[i].i_r1 != -1)
932 if (strat->
L[i].i_r2 != -1)
935 if (strat->
L[i].i_r != -1)
948 #ifdef ENTER_USE_MEMMOVE
949 memmove(&(strat->
S[i]), &(strat->
S[i+1]), (strat->
sl - i)*
sizeof(
poly));
950 memmove(&(strat->
ecartS[i]),&(strat->
ecartS[i+1]),(strat->
sl - i)*
sizeof(
int));
951 memmove(&(strat->
sevS[i]),&(strat->
sevS[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
952 memmove(&(strat->
S_2_R[i]),&(strat->
S_2_R[i+1]),(strat->
sl - i)*
sizeof(
int));
955 for (j=i; j<strat->
sl; j++)
957 strat->
S[
j] = strat->
S[j+1];
965 #ifdef ENTER_USE_MEMMOVE
966 memmove(&(strat->
lenS[i]),&(strat->
lenS[i+1]),(strat->
sl - i)*
sizeof(
int));
968 for (j=i; j<strat->
sl; j++) strat->
lenS[j] = strat->
lenS[j+1];
973 #ifdef ENTER_USE_MEMMOVE
976 for (j=i; j<strat->
sl; j++) strat->
lenSw[j] = strat->
lenSw[j+1];
981 #ifdef ENTER_USE_MEMMOVE
982 memmove(&(strat->
fromQ[i]),&(strat->
fromQ[i+1]),(strat->
sl - i)*
sizeof(
int));
984 for (j=i; j<strat->
sl; j++)
1000 #ifdef ENTER_USE_MEMMOVE
1001 memmove(&(strat->
S[i]), &(strat->
S[i+1]), (strat->
sl - i)*
sizeof(
poly));
1002 memmove(&(strat->
sig[i]), &(strat->
sig[i+1]), (strat->
sl - i)*
sizeof(
poly));
1003 memmove(&(strat->
ecartS[i]),&(strat->
ecartS[i+1]),(strat->
sl - i)*
sizeof(
int));
1004 memmove(&(strat->
sevS[i]),&(strat->
sevS[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1005 memmove(&(strat->
sevSig[i]),&(strat->
sevSig[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1006 memmove(&(strat->
S_2_R[i]),&(strat->
S_2_R[i+1]),(strat->
sl - i)*
sizeof(
int));
1009 for (j=i; j<strat->
sl; j++)
1011 strat->
S[
j] = strat->
S[j+1];
1012 strat->
sig[
j] = strat->
sig[j+1];
1021 #ifdef ENTER_USE_MEMMOVE
1022 memmove(&(strat->
lenS[i]),&(strat->
lenS[i+1]),(strat->
sl - i)*
sizeof(
int));
1024 for (j=i; j<strat->
sl; j++) strat->
lenS[j] = strat->
lenS[j+1];
1029 #ifdef ENTER_USE_MEMMOVE
1032 for (j=i; j<strat->
sl; j++) strat->
lenSw[j] = strat->
lenSw[j+1];
1037 #ifdef ENTER_USE_MEMMOVE
1038 memmove(&(strat->
fromQ[i]),&(strat->
fromQ[i+1]),(strat->
sl - i)*
sizeof(
int));
1040 for (j=i; j<strat->
sl; j++)
1064 if (set[j].sig!=
NULL)
1096 if (*length > 0 && j < *length)
1098 #ifdef ENTER_USE_MEMMOVE
1099 memmove(&(set[j]), &(set[j+1]), (*length - j)*
sizeof(
LObject));
1102 for (i=j; i < (*length); i++)
1107 memset(&(set[*length]),0,
sizeof(
LObject));
1118 assume(p.FDeg == p.pFDeg());
1123 if (at <= (*length))
1125 memmove(&((*set)[at+1]), &((*set)[at]), ((*length)-at+1)*
sizeof(
LObject));
1127 for (i=(*length)+1; i>=at+1; i--) (*set)[
i] = (*set)[i-1];
1141 h->FDeg = h->pFDeg();
1142 h->ecart = h->pLDeg() - h->FDeg;
1144 h->length=h->pLength=
pLength(h->p);
1149 h->FDeg = h->pFDeg();
1151 h->length=h->pLength=
pLength(h->p);
1156 Lp->FDeg = Lp->pFDeg();
1163 Lp->FDeg = Lp->pFDeg();
1164 (*Lp).ecart =
si_max(ecartF,ecartG);
1165 (*Lp).ecart = (*Lp).ecart- (Lp->FDeg -
p_FDeg((*Lp).lcm,
currRing));
1174 return (ecart1 <= ecart2);
1186 int l,
j,compare,compareCoeff;
1190 h.ecart=0; h.length=0;
1202 pLcm(p,strat->
S[i],h.lcm);
1211 for(j = strat->
Bl;j>=0;j--)
1216 printf(
"\nChainCrit in enteronepairring\n");
1222 printf(
"\nh - neue Paar\n");
1227 printf(
"\ncompare = %i\ncompareCoeff = %i\n",compare,compareCoeff);
1234 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1237 printf(
"\nGelöscht h\n");
1248 printf(
"\nGelöscht: B[j]\n");
1255 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1258 printf(
"\nGelöscht h\n");
1271 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1274 printf(
"\nGelöscht h\n");
1285 printf(
"\nGelöscht: B[j]\n");
1295 printf(
"\nTrying to add spair S[%i] und p\n",i);
pWrite(strat->
S[i]);
pWrite(p);
1364 printf(
"\nThis is afterwards:\n");
1367 h.i_r1 = -1;h.i_r2 = -1;
1377 h.i_r2 = strat->
S_2_R[
i];
1383 posx = strat->
posInL(strat->
B,strat->
Bl,&h,strat);
1388 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);
1459 PrintS(
"\n--- create strong gcd poly: ");
1460 Print(
"\n p: %d", i);
1462 Print(
"\n strat->S[%d]: ", i);
1486 h.i_r1 = -1;h.i_r2 = -1;
1492 h.p1 =
p;h.p2 = strat->
S[
i];
1496 h.i_r2 = strat->
S_2_R[
i];
1507 posx = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
1512 if(h.IsNull())
return FALSE;
1526 printf(
"\nThis strong poly was added to L:\n");
pWrite(h.p);
pWrite(h.p1);
pWrite(h.p2);
1545 Lp.ecart=0; Lp.length=0;
1550 #ifndef HAVE_RATGRING
1551 pLcm(p,strat->
S[i],Lp.lcm);
1552 #elif defined(HAVE_RATGRING)
1556 pLcm(p,strat->
S[i],Lp.lcm);
1563 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
1605 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
1610 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1667 for(j = strat->
Bl;j>=0;j--)
1669 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
1673 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1699 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
1744 PrintS(
"enterOnePairNormal::\n strat->S[i]: ");
pWrite(strat->
S[i]);
1759 PrintS(
"enterOnePairNormal::\n strat->S[i]: ");
pWrite(strat->
S[i]);
1788 Lp.p1 = strat->
S[
i];
1802 Lp.i_r1 = strat->
S_2_R[
i];
1818 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
1853 Lp.ecart=0; Lp.length=0;
1858 pLcm(p,strat->
S[i],Lp.lcm);
1863 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
1905 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
1910 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1963 for(j = strat->
Bl;j>=0;j--)
1965 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
1969 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1994 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2022 Lp.p1 = strat->
S[
i];
2029 Lp.i_r1 = strat->
S_2_R[
i];
2044 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2068 unsigned long pSigMultNegSev,sSigMultNegSev;
2072 Lp.ecart=0; Lp.length=0;
2077 #ifndef HAVE_RATGRING
2078 pLcm(p,strat->
S[i],Lp.lcm);
2079 #elif defined(HAVE_RATGRING)
2107 Print(
"----------------\n");
2110 Print(
"----------------\n");
2116 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2140 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2141 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2142 || strat->
rewCrit1(sSigMult,sSigMultNegSev,Lp.lcm,strat,i+1)
2168 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2213 PrintS(
"enterOnePairNormal::\n strat->S[i]: ");
pWrite(strat->
S[i]);
2228 PrintS(
"enterOnePairNormal::\n strat->S[i]: ");
pWrite(strat->
S[i]);
2243 Lp.sevSig = ~pSigMultNegSev;
2250 Lp.sevSig = ~sSigMultNegSev;
2261 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1)) {
2275 Lp.checked = strat->
sl+1;
2281 Lp.prod_crit =
TRUE;
2294 PrintS(
"SIGNATURE OF PAIR: ");
2298 Lp.p1 = strat->
S[
i];
2312 Lp.i_r1 = strat->
S_2_R[
i];
2356 pLcm(p,strat->
S[i],Lp.lcm);
2377 Lp.p1 = strat->
S[
i];
2381 Lp.i_r1 = strat->
S_2_R[
i];
2396 l = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
2407 int j=strat->
Ll+strat->
Bl+1;
2417 for (i=strat->
Bl; i>=0; i--)
2419 j = strat->
posInL(strat->
L,j,&(strat->
B[i]),strat);
2430 int j=strat->
Ll+strat->
Bl+1;
2440 for (i=strat->
Bl; i>=0; i--)
2442 j = strat->
posInLSba(strat->
L,j,&(strat->
B[i]),strat);
2464 for (j=0; j<=strat->
sl; j++)
2468 for (i=strat->
Bl; i>=0; i--)
2491 for (j=strat->
Ll; j>=0; j--)
2497 if (strat->
L[j].p == strat->
tail)
2517 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
2543 for (j=strat->
Ll; j>=0; j--)
2563 for(i=j-1; i>=0; i--)
2565 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
2582 for (j=strat->
Ll; j>=0; j--)
2613 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
2616 if (strat->
L[j].p2 == p)
2622 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
2636 strat->
L[
i].p2 = strat->
tail;
2653 else if (strat->
L[j].p2 == strat->
tail)
2692 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
2695 if (strat->
L[j].p2 == p)
2701 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
2715 strat->
L[
i].p2 = strat->
tail;
2732 else if (strat->
L[j].p2 == strat->
tail)
2740 #ifdef HAVE_RATGRING
2754 for (j=0; j<=strat->
sl; j++)
2758 for (i=strat->
Bl; i>=0; i--)
2766 Print(
"chain-crit-part: S[%d]=",j);
2768 Print(
" divide B[%d].lcm=",i);
2791 for (j=strat->
Ll; j>=0; j--)
2797 if (strat->
L[j].p == strat->
tail)
2801 PrintS(
"chain-crit-part: pCompareChainPart p=");
2803 Print(
" delete L[%d]",j);
2825 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
2832 Print(
"chain-crit-part: sugar B[%d].lcm=",j);
2834 Print(
" delete B[%d]",i);
2845 Print(
"chain-crit-part: sugar B[%d].lcm=",i);
2847 Print(
" delete B[%d]",j);
2867 for (j=strat->
Ll; j>=0; j--)
2875 PrintS(
"chain-crit-part: sugar:pCompareChainPart p=");
2877 Print(
" delete L[%d]",j);
2895 for(i=j-1; i>=0; i--)
2897 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
2901 Print(
"chain-crit-part: equal lcm B[%d].lcm=",j);
2903 Print(
" delete B[%d]\n",i);
2920 for (j=strat->
Ll; j>=0; j--)
2928 PrintS(
"chain-crit-part: pCompareChainPart p=");
2930 Print(
" delete L[%d]",j);
2959 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
2962 if (strat->
L[j].p2 == p)
2968 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
2985 strat->
L[
i].p2 = strat->
tail;
2992 PrintS(
"chain-crit-part: divisible_by p=");
2994 Print(
" delete L[%d]",l);
3005 PrintS(
"chain-crit-part: divisible_by(2) p=");
3007 Print(
" delete L[%d]",i);
3018 else if (strat->
L[j].p2 == strat->
tail)
3046 for (j=0; j<=
k; j++)
3048 if (!strat->
fromQ[j])
3059 for (j=0; j<=
k; j++)
3062 PrintS(
"\n Trying to add spoly : \n");
3073 for (j=0; j<=
k; j++)
3086 #ifdef HAVE_RATGRING
3115 for (j=0; j<=
k; j++)
3117 if (!strat->
fromQ[j])
3128 for (j=0; j<=
k; j++)
3137 for (j=0; j<=
k; j++)
3151 #ifdef HAVE_RATGRING
3178 for (j=0; j<=strat->
sl; j++)
3182 for (i=strat->
Bl; i>=0; i--)
3189 PrintS(
"--- chain criterion func chainCritRing type 1\n");
3192 PrintS(
" strat->B[i].lcm:");
3197 wrp(strat->
B[i].lcm);
3202 printf(
"\nChainCrit1\n");
3218 for (j=strat->
Ll; j>=0; j--)
3227 printf(
"\nChainCrit2\n");
3237 PrintS(
"--- chain criterion func chainCritRing type 2\n");
3238 PrintS(
"strat->L[j].p:");
3269 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3272 if (strat->
L[j].p2 == p)
3280 &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3287 PrintS(
"--- chain criterion func chainCritRing type 3\n");
3288 PrintS(
"strat->L[j].lcm:");
3289 wrp(strat->
L[j].lcm);
3290 PrintS(
" strat->L[i].lcm:");
3291 wrp(strat->
L[i].lcm);
3296 printf(
"\nChainCrit3\n");
3311 strat->
L[
i].p2 = strat->
tail;
3328 else if (strat->
L[j].p2 == strat->
tail)
3342 if (arg <= 0)
return 0;
3354 if (arg <= 0)
return 0;
3355 if (arg%2 == 1) { arg--; }
3365 #ifdef HAVE_VANIDEAL
3376 int l,
j,compare,compareCoeff;
3380 Lp.ecart=0; Lp.length=0;
3396 for(j = strat->
Bl;j>=0;j--)
3400 if (compareCoeff == 0 || compare == compareCoeff)
3418 if (compareCoeff == 1)
3425 if (compareCoeff == -1)
3436 if ((f==
NULL) || (p==
NULL))
return;
3468 tmp_h.SetShortExpVector();
3473 enterT(tmp_h, strat, strat->
tl + 1);
3478 Lp.i_r1 = strat->
tl;
3482 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
3496 if ((*cabsind < bound) && (*cabsind - step[1] + add < bound))
3505 if (N == 1)
return 0;
3507 while (exp[i] == cexp[i] && i <= N) i++;
3509 *cabsind -= cind[
i];
3512 *cabsind += cind[
i];
3515 if (i > N)
return 0;
3519 for (
int j = i + 1; j <=
N; j++)
3521 if (step[1] > step[j]) step[1] = step[
j];
3523 add =
ind2(cexp[i] + 2);
3524 if (*cabsind - step[1] + add >= bound)
3527 *cabsind -= cind[
i];
3529 *cabsind += cind[
i];
3532 if (i > N)
return 0;
3535 }
while (step[1] != -1);
3540 if (add < step[i]) step[
i] =
add;
3541 for (i = 2; i <=
N; i++)
3543 if (step[1] > step[i]) step[1] = step[
i];
3569 for (
int i = 1; i <= leadRing->N; i++)
3575 if (cabsind < leadRing->ch)
3577 zeroPoly =
p_ISet(
twoPow(leadRing->ch - cabsind), tailRing);
3581 zeroPoly =
p_ISet(1, tailRing);
3583 for (
int i = 1; i <= leadRing->N; i++)
3585 for (
long j = 1; j <= exp[
i]; j++)
3588 tmp2 =
p_ISet(1, tailRing);
3593 zeroPoly =
p_Mult_q(zeroPoly, tmp2, tailRing);
3598 zeroPoly =
p_Mult_q(zeroPoly,
p_Add_q(tmp3, tmp2, tailRing), tailRing);
3603 for (
int i = 1; i <= leadRing->N; i++)
3609 zeroPoly =
pNext(zeroPoly);
3611 pNext(tmp2) = zeroPoly;
3632 for (
int i = 1; i <=
currRing->N; i++)
3635 if (exp[i] & 1 != 0)
3637 exp[
i] = exp[
i] - 1;
3650 PrintS(
"-------------\npoly :");
3652 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
3653 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
3654 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
3656 Print(
"cind : %d\n", cabsind);
3673 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
3698 for (
int i = 1; i <=
currRing->N; i++)
3709 PrintS(
"-------------\npoly :");
3711 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
3712 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
3713 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
3714 Print(
"bound : %d\n", bound);
3715 Print(
"cind : %d\n", cabsind);
3733 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
3741 G0->m[
IDELEMS(G0) - 1] = zeroPoly;
3760 for (j=0; j<=
k; j++)
3818 PrintS(
"--- create zero spoly: ");
3856 posx = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
3881 if ( (!strat->
fromT)
3891 clearS(h,h_sev, &j,&k,strat);
3907 PrintS(
"\nEnter superenterpairs\n");
3908 int iii = strat->
Ll;
3909 printf(
"\nstrat->tl = %i\n",strat->
tl);
3918 PrintS(
"\n enterExtendedSpoly has not changed the list L.\n");
3923 PrintS(
"\n enterExtendedSpoly changed the list L:\n");
3924 for(iii=0;iii<=strat->
Ll;iii++)
3926 Print(
"\n L[%d]:\n",iii);
3932 printf(
"\nstrat->tl = %i\n",strat->
tl);
3940 PrintS(
"\n initenterpairs has not changed the list L.\n");
3944 PrintS(
"\n initenterpairs changed the list L:\n");
3945 for(iii=0;iii<=strat->
Ll;iii++)
3947 Print(
"\n L[%d]:\n",iii);
3953 printf(
"\nstrat->tl = %i\n",strat->
tl);
3961 PrintS(
"\n initenterstrongPairs has not changed the list L.\n");
3965 PrintS(
"\n initenterstrongPairs changed the list L:\n");
3966 for(iii=0;iii<=strat->
Ll;iii++)
3968 Print(
"\n L[%d]:\n",iii);
3974 printf(
"\nstrat->tl = %i\n",strat->
tl);
3975 PrintS(
"\nEnd of superenterpairs\n");
3979 printf(
"\nstrat->tl = %i\n",strat->
tl);
3997 Print(
"\n Vor initenterpairs: The new pair list L -- after superenterpairs in loop\n");
3998 for(
int iii=0;iii<=strat->
Ll;iii++)
4000 printf(
"\n L[%d]:\n",iii);
4011 Print(
"\n Nach initenterpairs: The new pair list L -- after superenterpairs in loop \n");
4012 for(
int iii=0;iii<=strat->
Ll;iii++)
4014 printf(
"\n L[%d]:\n",iii);
4021 if ( (!strat->
fromT)
4030 clearS(h,h_sev, &j,&k,strat);
4053 if ( (!strat->
fromT)
4062 clearS(h,h_sev, &j,&k,strat);
4082 for (j=0; j<=
k; j++)
4084 const int iCompSj =
pGetComp(strat->
S[j]);
4085 if ((iCompH==iCompSj)
4096 for (j=0; j<=
k; j++)
4098 const int iCompSj =
pGetComp(strat->
S[j]);
4099 if ((iCompH==iCompSj)
4137 clearS(h,h_sev,&j,&k,strat);
4150 int i,
j,at,ecart, s2r;
4154 int new_suc=strat->
sl+1;
4158 for (; i<=strat->
sl; i++)
4163 if (new_suc > at) new_suc = at;
4166 sev = strat->
sevS[
i];
4169 for (j=i; j>=at+1; j--)
4171 strat->
S[
j] = strat->
S[j-1];
4177 strat->
ecartS[at] = ecart;
4178 strat->
sevS[at] = sev;
4179 strat->
S_2_R[at] = s2r;
4182 for (j=i; j>=at+1; j--)
4186 strat->
fromQ[at]=fq;
4190 if (new_suc <= strat->sl) *suc=new_suc;
4204 if(length==-1)
return 0;
4223 || ((o==oo) && (
pLmCmp(set[length],p)!= cmp_int)))
4246 if (
pLmCmp(set[length],p)== -cmp_int)
4254 if (cmp == cmp_int)
return an;
4255 if (cmp == -cmp_int)
return en;
4261 if (cmp == cmp_int) en =
i;
4262 else if (cmp == -cmp_int) an =
i;
4272 if (
pLmCmp(set[length],p)== -cmp_int)
4279 if (
pLmCmp(set[an],p) == cmp_int)
return an;
4280 if (
pLmCmp(set[an],p) == -cmp_int)
return en;
4282 && ((strat->
ecartS[an])>ecart_p))
4287 if (
pLmCmp(set[i],p) == cmp_int) en=i;
4288 else if (
pLmCmp(set[i],p) == -cmp_int) an=i;
4292 &&((strat->
ecartS[
i])<ecart_p))
4319 if (length==-1)
return 0;
4321 if (
pLmCmp(set[length].p,p.p)!=
currRing->OrdSgn)
return length+1;
4350 if (set[length].length<p.length)
4361 if (set[an].length>p.length)
return an;
4365 if (set[i].length>p.length) en=
i;
4394 if (length==-1)
return 0;
4396 int o = p.GetpFDeg();
4397 int op = set[length].GetpFDeg();
4400 || ((op == o) && (
pLmCmp(set[length].p,p.p) !=
currRing->OrdSgn)))
4411 op= set[an].GetpFDeg();
4418 op = set[
i].GetpFDeg();
4434 if (length==-1)
return 0;
4435 int o = p.GetpFDeg();
4436 int op = set[length].GetpFDeg();
4441 if ((op < o) || (
pLmCmp(set[length].p,p.p)== -cmp_int))
4448 op = set[an].GetpFDeg();
4449 if (op > o)
return an;
4450 if (op < 0)
return en;
4451 cmp =
pLmCmp(set[an].p,p.p);
4452 if (cmp == cmp_int)
return an;
4453 if (cmp == -cmp_int)
return en;
4458 op = set[
i].GetpFDeg();
4460 else if (op < o) an =
i;
4463 cmp =
pLmCmp(set[i].p,p.p);
4464 if (cmp == cmp_int) en =
i;
4465 else if (cmp == -cmp_int) an =
i;
4511 if (length==-1)
return 0;
4513 int o = p.GetpFDeg();
4514 int op = set[length].GetpFDeg();
4517 || (( op == o) && (set[length].length<p.length))
4518 || (( op == o) && (set[length].length == p.length)
4529 op = set[an].GetpFDeg();
4531 || (( op == o) && (set[an].length > p.length))
4532 || (( op == o) && (set[an].length == p.length)
4538 op = set[
i].GetpFDeg();
4540 || (( op == o) && (set[i].length > p.length))
4541 || (( op == o) && (set[i].length == p.length)
4556 if (length==-1)
return 0;
4558 int o = p.GetpFDeg();
4560 if (set[length].GetpFDeg() <= o)
4570 if (set[an].GetpFDeg() > o)
4575 if (set[i].GetpFDeg() > o)
4585 int ol = p.GetpLength();
4586 if (length==-1)
return 0;
4590 int oo=set[length].ecart;
4591 if ((oo < op) || ((oo==op) && (set[length].length < ol)))
4601 int oo=set[an].ecart;
4603 || ((oo==op) && (set[an].
pLength > ol)))
4608 int oo=set[
i].ecart;
4610 || ((oo == op) && (set[i].
pLength > ol)))
4642 if (length==-1)
return 0;
4644 int o = p.GetpFDeg() + p.ecart;
4645 int op = set[length].GetpFDeg()+set[length].ecart;
4659 op = set[an].GetpFDeg()+set[an].ecart;
4666 op = set[
i].GetpFDeg()+set[
i].ecart;
4702 if (length==-1)
return 0;
4704 int o = p.GetpFDeg() + p.ecart;
4705 int op = set[length].GetpFDeg()+set[length].ecart;
4708 || (( op == o) && (set[length].ecart > p.ecart))
4709 || (( op == o) && (set[length].ecart==p.ecart)
4720 op = set[an].GetpFDeg()+set[an].ecart;
4722 || (( op == o) && (set[an].ecart < p.ecart))
4723 || (( op == o) && (set[an].ecart==p.ecart)
4729 op = set[
i].GetpFDeg()+set[
i].ecart;
4731 || (( op == o) && (set[i].ecart < p.ecart))
4732 || (( op == o) && (set[i].ecart == p.ecart)
4746 if (length==-1)
return 0;
4750 int o = p.GetpFDeg() + p.ecart;
4753 if (
pGetComp(set[length].p)*cc < c)
4755 if (
pGetComp(set[length].p)*cc == c)
4757 int op = set[length].GetpFDeg()+set[length].ecart;
4759 || ((op == o) && (set[length].ecart > p.ecart))
4760 || ((op == o) && (set[length].ecart==p.ecart)
4776 int op = set[an].GetpFDeg()+set[an].ecart;
4778 || ((op == o) && (set[an].ecart < p.ecart))
4779 || ((op == o) && (set[an].ecart==p.ecart)
4788 else if (
pGetComp(set[i].p)*cc == c)
4790 int op = set[
i].GetpFDeg()+set[
i].ecart;
4792 || ((op == o) && (set[i].ecart < p.ecart))
4793 || ((op == o) && (set[i].ecart == p.ecart)
4812 if (length==-1)
return 0;
4815 int op=p.GetpFDeg();
4817 if (set[length].ecart < o)
4819 if (set[length].ecart == o)
4821 int oo=set[length].GetpFDeg();
4822 if ((oo < op) || ((oo==op) && (set[length].length < p.length)))
4833 if (set[an].ecart > o)
4835 if (set[an].ecart == o)
4837 int oo=set[an].GetpFDeg();
4839 || ((oo==op) && (set[an].length > p.length)))
4845 if (set[i].ecart > o)
4847 else if (set[i].ecart == o)
4849 int oo=set[
i].GetpFDeg();
4851 || ((oo == op) && (set[i].length > p.length)))
4869 if (length<0)
return 0;
4871 int d=p->GetpFDeg();
4872 int op=set[length].GetpFDeg();
4875 || ((op == d) && (p->p1!=
NULL)&&(set[length].p1==
NULL))
4886 op=set[an].GetpFDeg();
4888 || ((op == d) && (p->p1!=
NULL) && (set[an].p1==
NULL))
4894 op=set[
i].GetpFDeg();
4896 || ((op==d) && (p->p1!=
NULL) && (set[i].p1==
NULL))
4912 if (length<0)
return 0;
4943 if (length<0)
return 0;
4967 if (length < 0)
return 0;
4968 if (set[length].FDeg > p->FDeg)
4970 if (set[length].FDeg == p->FDeg)
4971 if(set[length].GetpLength() > p->GetpLength())
4982 if (set[an].FDeg > p->FDeg)
4984 if(set[an].FDeg == p->FDeg)
4986 if(set[an].GetpLength() > p->GetpLength())
4990 if(set[an].GetpLength() == p->GetpLength())
4992 if(
nGreater(set[an].p->coef, p->p->coef))
5011 if (set[i].FDeg > p->FDeg)
5015 if(set[i].FDeg == p->FDeg)
5017 if(set[i].GetpLength() > p->GetpLength())
5021 if(set[i].GetpLength() == p->GetpLength())
5023 if(
nGreater(set[i].p->coef, p->p->coef))
5047 if (strat->
syzl==0)
return 0;
5052 int en= strat->
syzl-1;
5105 if (length<0)
return 0;
5107 int o = p->GetpFDeg();
5108 int op = set[length].GetpFDeg();
5111 || ((op == o) && (
pLmCmp(set[length].p,p->p) != -
currRing->OrdSgn)))
5120 op = set[an].GetpFDeg();
5127 op = set[
i].GetpFDeg();
5146 if (length < 0)
return 0;
5151 printf(
"\n----------------------\n");
5152 for(i=0;i<=length;i++)
5154 printf(
"\n----------------------\n");
5162 if (
pLmCmp(set[an].p, p->p) == 1)
5164 if (
pLmCmp(set[an].p, p->p) == -1)
5166 if (
pLmCmp(set[an].p, p->p) == 0)
5174 if (set[an].t_p!=
NULL)
5196 if (
pLmCmp(set[i].p, p->p) == 1)
5198 if (
pLmCmp(set[i].p, p->p) == -1)
5200 if (
pLmCmp(set[i].p, p->p) == 0)
5208 if (set[i].t_p!=
NULL)
5234 if (length < 0)
return 0;
5239 printf(
"\n----------------------\n");
5240 for(i=0;i<=length;i++)
5242 printf(
"\n----------------------\n");
5250 if (set[an].FDeg > p->FDeg)
5252 if (set[an].FDeg < p->FDeg)
5254 if (set[an].FDeg == p->FDeg)
5262 if (set[an].t_p!=
NULL)
5284 if (set[i].FDeg > p->FDeg)
5286 if (set[i].FDeg < p->FDeg)
5288 if (set[i].FDeg == p->FDeg)
5296 if (set[i].t_p!=
NULL)
5328 if (coeff == 0)
return -1;
5331 while (tmp % 2 == 0)
5350 if (length < 0)
return 0;
5352 int o = p->GetpFDeg();
5353 int op = set[length].GetpFDeg();
5355 if ((op > o) || ((op == o) && (
pLmCmp(set[length].p,p->p) != -
currRing->OrdSgn)))
5364 op = set[an].GetpFDeg();
5365 if ((op > o) || ((op == o) && (
pLmCmp(set[an].p,p->p) != -
currRing->OrdSgn)))
5370 op = set[
i].GetpFDeg();
5371 if ((op > o) || ((op == o) && (
pLmCmp(set[i].p,p->p) != -
currRing->OrdSgn)))
5426 if (length<0)
return 0;
5428 int o = p->GetpFDeg();
5429 int op = set[length].GetpFDeg();
5432 || ((op == o) && (set[length].length >p->length))
5433 || ((op == o) && (set[length].length <= p->length)
5443 op = set[an].GetpFDeg();
5445 || ((op == o) && (set[an].length >p->length))
5446 || ((op == o) && (set[an].length <=p->length)
5452 op = set[
i].GetpFDeg();
5454 || ((op == o) && (set[i].length > p->length))
5455 || ((op == o) && (set[i].length <= p->length)
5472 if (length<0)
return 0;
5474 int o = p->GetpFDeg();
5476 if (set[length].GetpFDeg() > o)
5486 if (set[an].GetpFDeg() >= o)
5491 if (set[i].GetpFDeg() >= o)
5525 if (length<0)
return 0;
5527 int o = p->GetpFDeg() + p->ecart;
5528 int op = set[length].GetpFDeg() + set[length].ecart;
5531 || ((op == o) && (
pLmCmp(set[length].p,p->p) != -
currRing->OrdSgn)))
5540 op = set[an].GetpFDeg() + set[an].ecart;
5547 op = set[
i].GetpFDeg() + set[
i].ecart;
5565 if (length<0)
return 0;
5567 int o = p->GetpFDeg() + p->ecart;
5569 if ((set[length].GetpFDeg() + set[length].ecart > o)
5570 || ((set[length].GetpFDeg() + set[length].ecart == o)
5571 && (set[length].ecart > p->ecart))
5572 || ((set[length].GetpFDeg() + set[length].ecart == o)
5573 && (set[length].ecart == p->ecart)
5583 if ((set[an].GetpFDeg() + set[an].ecart > o)
5584 || ((set[an].GetpFDeg() + set[an].ecart == o)
5585 && (set[an].ecart > p->ecart))
5586 || ((set[an].GetpFDeg() + set[an].ecart == o)
5587 && (set[an].ecart == p->ecart)
5593 if ((set[i].GetpFDeg() + set[
i].ecart > o)
5594 || ((set[i].GetpFDeg() + set[
i].ecart == o)
5595 && (set[i].ecart > p->ecart))
5596 || ((set[i].GetpFDeg() +set[
i].ecart == o)
5597 && (set[i].ecart == p->ecart)
5613 if (length<0)
return 0;
5617 unsigned long c =
pGetComp(p->p)*cc;
5618 int o = p->GetpFDeg() + p->ecart;
5620 if (
pGetComp(set[length].p)*cc > c)
5622 if (
pGetComp(set[length].p)*cc == c)
5624 if ((set[length].GetpFDeg() + set[length].ecart > o)
5625 || ((set[length].GetpFDeg() + set[length].ecart == o)
5626 && (set[length].ecart > p->ecart))
5627 || ((set[length].GetpFDeg() + set[length].ecart == o)
5628 && (set[length].ecart == p->ecart)
5643 if ((set[an].GetpFDeg() + set[an].ecart > o)
5644 || ((set[an].GetpFDeg() + set[an].ecart == o)
5645 && (set[an].ecart > p->ecart))
5646 || ((set[an].GetpFDeg() + set[an].ecart == o)
5647 && (set[an].ecart == p->ecart)
5656 else if (
pGetComp(set[i].p)*cc == c)
5658 if ((set[i].GetpFDeg() + set[
i].ecart > o)
5659 || ((set[i].GetpFDeg() + set[
i].ecart == o)
5660 && (set[i].ecart > p->ecart))
5661 || ((set[i].GetpFDeg() +set[
i].ecart == o)
5662 && (set[i].ecart == p->ecart)
5680 Print(
"syzygy criterion checks: ");
5683 for (
int k=0;
k<strat->
syzl;
k++)
5688 Print(
"checking with: %d / %d -- \n",
k,strat->
syzl);
5712 Print(
"--- syzygy criterion checks: ");
5721 min = strat->
syzIdx[comp-2];
5731 max = strat->
syzIdx[comp-1];
5733 for (
int k=min;
k<
max;
k++)
5736 Print(
"COMP %d/%d - MIN %d - MAX %d - SYZL %ld\n",comp,strat->
currIdx,min,max,strat->
syzl);
5737 Print(
"checking with: %d -- ",
k);
5755 PrintS(
"rewritten criterion checks: ");
5758 for(
int k = strat->
sl;
k>=start;
k--)
5762 Print(
"checking with: ");
5777 Print(
"ALL ELEMENTS OF S\n----------------------------------------\n");
5778 for(
int kk = 0; kk<strat->
sl+1; kk++)
5782 Print(
"------------------------------\n");
5810 for (
int ii=strat->
sl; ii>start; ii--)
5816 if (!(
pLmCmp(p1,p2) == 1))
5832 for (
int i=strat->
Bl; i>-1; i--) {
5839 if (
pLmCmp(lm,strat->
B[found].GetLmCurrRing()) == -1) {
5847 for (
int ii=strat->
sl; ii>-1; ii--)
5853 if (!(
pLmCmp(p1,p2) == 1))
5876 const unsigned long not_sev = ~L->sev;
5877 const unsigned long* sev = strat->
sevS;
5888 if (j > pos)
return NULL;
5889 #if defined(PDEBUG) || defined(PDIV_DEBUG)
5891 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
5902 if (!(sev[j] & not_sev) &&
5903 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]) &&
5919 if (strat->
tl < 0 || strat->
S_2_R[j] == -1)
5921 T->Set(strat->
S[j], r, strat->
tailRing);
5929 return strat->
S_2_T(j);
5937 if (j > pos)
return NULL;
5939 #if defined(PDEBUG) || defined(PDIV_DEBUG)
5940 t = strat->
S_2_T(j);
5943 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
5954 if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
5956 t = strat->
S_2_T(j);
5957 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[j]);
6001 if ((Kstd1_deg>0)&&(op>Kstd1_deg))
goto all_done;
6011 if (With ==
NULL)
break;
6021 return redtail(L, pos, strat);
6027 if (hn ==
NULL)
goto all_done;
6029 if ((Kstd1_deg>0)&&(op>Kstd1_deg))
goto all_done;
6048 return redtail(&L, pos, strat);
6053 #define REDTAIL_CANONICALIZE 100
6057 p = h = L->GetLmTailRing();
6059 return L->GetLmCurrRing();
6066 Ln.pLength = L->GetpLength() - 1;
6090 Ln.SetShortExpVector();
6096 With = &(strat->
T[
j]);
6101 if (With ==
NULL)
break;
6128 pNext(h) = Ln.LmExtractAndIter();
6131 }
while (!Ln.IsNull());
6134 if (Ln.IsNull())
goto all_done;
6135 if (! withT) With_s.Init(
currRing);
6137 pNext(h) = Ln.LmExtractAndIter();
6156 return L->GetLmCurrRing();
6166 p = h = L->GetLmTailRing();
6168 return L->GetLmCurrRing();
6175 Ln.pLength = L->GetpLength() - 1;
6188 Ln.SetShortExpVector();
6190 if (With ==
NULL)
break;
6200 poly p_Ln=Ln.GetLmCurrRing();
6201 poly p_With=With->GetLmCurrRing();
6213 if (Ln.bucket!=
NULL)
6244 pNext(h) = Ln.LmExtractAndIter();
6247 }
while (!Ln.IsNull());
6250 if (Ln.IsNull())
goto all_done;
6253 pNext(h) = Ln.LmExtractAndIter();
6271 return L->GetLmCurrRing();
6287 if (strat->
Ll != *reduc)
6289 if (strat->
Ll != *reduc-1)
6301 if (red_result == 0)
6303 else if (red_result < 0)
6305 if ((red_result > 0) || ((strat->
Ll % 100)==99))
6307 if (strat->
Ll != *reduc && strat->
Ll > 0)
6324 Print(
"product criterion:%d chain criterion:%d\n",strat->
cp,strat->
c3);
6325 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
6327 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
6342 for (i=0; i<=strat->
sl; i++)
6352 for (i=0; i<=strat->
tl; i++)
6356 Print(
" o:%ld e:%d l:%d",
6357 strat->
T[i].pFDeg(),strat->
T[
i].ecart,strat->
T[
i].length);
6362 for (i=strat->
Ll; i>=0; i--)
6371 Print(
" o:%ld e:%d l:%d",
6372 strat->
L[i].pFDeg(),strat->
L[
i].ecart,strat->
L[
i].length);
6394 strat->
S=strat->
Shdl->m;
6399 memset(strat->
fromQ,0,i*
sizeof(
int));
6405 h.p =
pCopy(Q->m[i]);
6426 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
6429 strat->
enterS(h,pos,strat,-1);
6430 strat->
fromQ[pos]=1;
6440 h.p =
pCopy(F->m[i]);
6469 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
6471 strat->
enterS(h,pos,strat,-1);
6497 strat->
S=strat->
Shdl->m;
6502 memset(strat->
fromQ,0,i*
sizeof(
int));
6508 h.p =
pCopy(Q->m[i]);
6529 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
6532 strat->
enterS(h,pos,strat,-1);
6533 strat->
fromQ[pos]=1;
6543 h.p =
pCopy(F->m[i]);
6566 pos = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
6596 strat->
S = strat->
Shdl->m;
6609 memset(strat->
fromQ,0,i*
sizeof(
int));
6615 h.p =
pCopy(Q->m[i]);
6636 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
6639 strat->
enterS(h,pos,strat,-1);
6640 strat->
fromQ[pos]=1;
6650 h.p =
pCopy(F->m[i]);
6751 for(i=1; i<=strat->
sl; i++)
6767 #if defined(DEBUGF5) || defined(DEBUGF51)
6768 PrintS(
"------------- GENERATING SYZ RULES NEW ---------------\n");
6775 while (i <= strat->sl)
6787 diff = comp - comp_old - 1;
6805 for (k = 0; k<
i; k++)
6828 diff = comp - comp_old - 1;
6845 for (k = 0; k<strat->
sl+1; k++)
6862 PrintS(
"Principal syzygies:\n");
6865 Print(
"ps %d\n",ps);
6866 PrintS(
"--------------------------------\n");
6867 for(i=0;i<=strat->
syzl-1;i++)
6876 PrintS(
"--------------------------------\n");
6898 strat->
S=strat->
Shdl->m;
6904 memset(strat->
fromQ,0,i*
sizeof(
int));
6910 h.p =
pCopy(Q->m[i]);
6931 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
6934 strat->
enterS(h,pos,strat, strat->
tl+1);
6936 strat->
fromQ[pos]=1;
6947 h.p =
pCopy(F->m[i]);
6962 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
6964 strat->
enterS(h,pos,strat, strat->
tl+1);
7006 h.is_normalized = 0;
7011 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
7013 strat->
enterS(h,pos,strat, strat->
tl+1);
7021 strat->
enterS(h,0,strat, strat->
tl+1);
7043 strat->
S=strat->
Shdl->m;
7049 memset(strat->
fromQ,0,i*
sizeof(
int));
7055 h.p =
pCopy(Q->m[i]);
7076 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
7079 strat->
enterS(h,pos,strat, strat->
tl+1);
7081 strat->
fromQ[pos]=1;
7092 h.p =
pCopy(F->m[i]);
7107 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
7109 strat->
enterS(h,pos,strat, strat->
tl+1);
7151 h.is_normalized = 0;
7156 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
7158 strat->
enterS(h,pos,strat, strat->
tl+1);
7166 strat->
enterS(h,0,strat, strat->
tl+1);
7181 while (j <= maxIndex)
7198 if (!
pIsVector((*p).p) && ((*p).ecart != 0))
7207 h1 = r =
pCopy((*p).p);
7260 while ((j <= strat->sl) && (
pGetComp(strat->
S[j])!=0)) j++;
7262 while (j<=strat->sl)
7286 while (j <= maxIndex)
7335 while (j <= maxIndex);
7365 while (i<=strat->sl)
7374 redSi =
pHead(strat->
S[i]);
7375 strat->
S[
i] =
redBba(strat->
S[i],i-1,strat);
7378 if (
pCmp(redSi,strat->
S[i])!=0)
7391 if (strat->
S[i]==
NULL)
7399 if (strat->
S[i]==
NULL)
7417 DENOMINATOR_LIST=denom;
7436 if (any_change)
reorderS(&suc,strat);
7441 for (i=0; i<=strat->
sl; i++)
7462 h.sev = strat->
sevS[
i];
7475 while (i<=strat->sl)
7480 redSi=
pHead((strat->
S)[i]);
7487 else if (
pCmp((strat->
S)[i],redSi)!=0)
7504 DENOMINATOR_LIST=denom;
7519 strat->
sevS[
i] = h.sev;
7529 if (any_change)
reorderS(&suc,strat);
7530 else { suc=-1;
break; }
7541 for (i=0; i<=strat->
sl; i++)
7545 strat->
S[
i] = h.p =
redtail(strat->
S[i],strat->
sl,strat);
7549 strat->
sevS[
i] = h.sev;
7555 h.sev = strat->
sevS[
i];
7556 h.length = h.pLength =
pLength(h.p);
7565 if (suc!= -1)
updateS(toT,strat);
7586 *
sizeof(
unsigned long));
7613 strat->
Shdl->m=strat->
S;
7615 if (atS <= strat->sl)
7617 #ifdef ENTER_USE_MEMMOVE
7619 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
7620 (strat->
sl - atS + 1)*
sizeof(
poly));
7621 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
7622 (strat->
sl - atS + 1)*
sizeof(
int));
7623 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
7624 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
7625 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
7626 (strat->
sl - atS + 1)*
sizeof(
int));
7628 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
7629 (strat->
sl - atS + 1)*
sizeof(
int));
7631 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
7634 for (i=strat->
sl+1; i>=atS+1; i--)
7636 strat->
S[
i] = strat->
S[i-1];
7642 for (i=strat->
sl+1; i>=atS+1; i--)
7645 for (i=strat->
sl+1; i>=atS+1; i--)
7651 #ifdef ENTER_USE_MEMMOVE
7652 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
7653 (strat->
sl - atS + 1)*
sizeof(
int));
7655 for (i=strat->
sl+1; i>=atS+1; i--)
7660 strat->
fromQ[atS]=0;
7664 strat->
S[atS] = p.p;
7670 strat->
sevS[atS] = p.sev;
7671 strat->
ecartS[atS] = p.ecart;
7672 strat->
S_2_R[atS] = atR;
7689 *
sizeof(
unsigned long));
7693 *
sizeof(
unsigned long));
7721 strat->
Shdl->m=strat->
S;
7726 if (atS <= strat->sl)
7728 #ifdef ENTER_USE_MEMMOVE
7730 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
7731 (strat->
sl - atS + 1)*
sizeof(
poly));
7732 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
7733 (strat->
sl - atS + 1)*
sizeof(
int));
7734 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
7735 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
7736 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
7737 (strat->
sl - atS + 1)*
sizeof(
int));
7739 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
7740 (strat->
sl - atS + 1)*
sizeof(
int));
7742 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
7745 for (i=strat->
sl+1; i>=atS+1; i--)
7747 strat->
S[
i] = strat->
S[i-1];
7753 for (i=strat->
sl+1; i>=atS+1; i--)
7756 for (i=strat->
sl+1; i>=atS+1; i--)
7762 #ifdef ENTER_USE_MEMMOVE
7763 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
7764 (strat->
sl - atS + 1)*
sizeof(
int));
7766 for (i=strat->
sl+1; i>=atS+1; i--)
7771 strat->
fromQ[atS]=0;
7775 strat->
S[atS] = p.p;
7776 strat->
sig[atS] = p.sig;
7782 strat->
sevS[atS] = p.sev;
7792 strat->
sevSig[atS] = p.sevSig;
7794 strat->
ecartS[atS] = p.ecart;
7795 strat->
S_2_R[atS] = atR;
7799 Print(
"--- LIST S: %d ---\n",strat->
sl);
7800 for(k=0;k<=strat->
sl;k++)
7804 Print(
"--- LIST S END ---\n");
7820 assume(p.FDeg == p.pFDeg());
7825 for(i=strat->
tl;i>=0;i--)
7827 if (p.p==strat->
T[i].p)
7829 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
7835 #ifdef HAVE_TAIL_RING
7838 p.t_p=p.GetLmTailRing();
7843 atT = strat->
posInT(strat->
T, strat->
tl, p);
7844 if (strat->
tl == strat->
tmax-1)
7846 if (atT <= strat->tl)
7848 #ifdef ENTER_USE_MEMMOVE
7849 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
7851 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
7852 (strat->
tl-atT+1)*
sizeof(
unsigned long));
7854 for (i=strat->
tl+1; i>=atT+1; i--)
7856 #ifndef ENTER_USE_MEMMOVE
7857 strat->
T[
i] = strat->
T[i-1];
7860 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
7874 printf(
"\nenterT: add in position %i\n",atT);
7882 strat->
T[atT].max =
NULL;
7885 strat->
R[strat->
tl] = &(strat->
T[atT]);
7886 strat->
T[atT].i_r = strat->
tl;
7904 assume(p.FDeg == p.pFDeg());
7909 for(i=strat->
tl;i>=0;i--)
7911 if (p.p==strat->
T[i].p)
7913 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
7919 #ifdef HAVE_TAIL_RING
7922 p.t_p=p.GetLmTailRing();
7927 atT = strat->
posInT(strat->
T, strat->
tl, p);
7928 if (strat->
tl == strat->
tmax-1)
7930 if (atT <= strat->tl)
7932 #ifdef ENTER_USE_MEMMOVE
7933 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
7935 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
7936 (strat->
tl-atT+1)*
sizeof(
unsigned long));
7938 for (i=strat->
tl+1; i>=atT+1; i--)
7940 #ifndef ENTER_USE_MEMMOVE
7941 strat->
T[
i] = strat->
T[i-1];
7944 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
7958 printf(
"\nenterT_strong: add in position %i\n",atT);
7966 strat->
T[atT].max =
NULL;
7969 strat->
R[strat->
tl] = &(strat->
T[atT]);
7970 strat->
T[atT].i_r = strat->
tl;
7978 printf(
"\nDas ist p:\n");
pWrite(p.p);
7980 for(i=strat->
tl;i>=0;i--)
7985 printf(
"\nFound one: %i\n",i);
pWrite(strat->
T[i].p);
8015 (strat->
syzmax)*
sizeof(
unsigned long),
8017 *
sizeof(
unsigned long));
8020 if (atT < strat->syzl)
8022 #ifdef ENTER_USE_MEMMOVE
8023 memmove(&(strat->
syz[atT+1]), &(strat->
syz[atT]),
8025 memmove(&(strat->
sevSyz[atT+1]), &(strat->
sevSyz[atT]),
8026 (strat->
syzl-atT+1)*
sizeof(
unsigned long));
8028 for (i=strat->
syzl; i>=atT+1; i--)
8030 #ifndef ENTER_USE_MEMMOVE
8031 strat->
syz[
i] = strat->
syz[i-1];
8038 strat->
syz[atT] = p.sig;
8039 strat->
sevSyz[atT] = p.sevSig;
8042 Print(
"element in strat->syz: %d--%d ",atT+1,strat->
syzmax);
8050 strat->
L[cc].sig, ~strat->
L[cc].sevSig,
currRing))
8058 PrintS(
"--- Syzygies ---\n");
8061 PrintS(
"--------------------------------\n");
8062 for(i=0;i<=strat->
syzl-1;i++)
8067 PrintS(
"--------------------------------\n");
8105 #ifdef HAVE_RATGRING
8153 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
8154 else PrintS(
"ideal/module is not homogeneous\n");
8185 #ifdef HAVE_RATGRING
8226 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
8227 else PrintS(
"ideal/module is not homogeneous\n");
8233 (
const LSet set,
const int length,
8715 reduction_found=
TRUE;
8746 reduction_found=
TRUE;
8760 if ( reduction_found)
8824 for (i=strat->
sl; i>=low; i--)
8826 int end_pos=strat->
sl;
8828 if (strat->
ak==0) end_pos=i-1;
8830 if ((T_j !=
NULL)&&(T_j->p==strat->
S[i]))
8836 Print(
"test S[%d]:",i);
8848 Print(
"to (tailR) S[%d]:",i);
8871 Print(
"test S[%d]:",i);
8877 strat->
S[
i] =
redtailBba(strat->
S[i], end_pos, strat, withT);
8891 DENOMINATOR_LIST=denom;
8904 Print(
"to (-tailR) S[%d]:",i);
8953 if (j < strat->HCord)
8999 assume(L->i_r1 >= -1 && L->i_r1 <= strat->
tl);
9000 assume(L->i_r2 >= -1 && L->i_r2 <= strat->
tl);
9006 if ((L->i_r1 == -1) || (L->i_r2 == -1) )
9010 poly p1_max = (strat->
R[L->i_r1])->
max;
9011 poly p2_max = (strat->
R[L->i_r2])->
max;
9037 poly p1_max = (strat->
R[atR])->
max;
9061 ideal monred =
idInit(1,1);
9062 for(
int i=0; i<
idElem(F); i++)
9068 if((posconst != -1) && (!
nIsZero(F->m[posconst]->coef)))
9070 pmon =
pCopy(F->m[posconst]);
9079 for(
int i=0; i<idelemQ; i++)
9087 if((posconst != -1) && (!
nIsZero(monred->m[posconst]->coef)))
9089 pmon =
pCopy(monred->m[posconst]);
9103 for(
int i = 0, j = 0; i<
IDELEMS(F); i++)
9104 II->m[j++] =
prMapR(F->m[i], nMap, origR, QQ_ring);
9105 for(
int i = 0, j =
IDELEMS(F); i<idelemQ; i++)
9106 II->m[j++] =
prMapR(Q->m[i], nMap, origR, QQ_ring);
9112 for(
int i =
IDELEMS(II)-1; i>=0; i--)
9113 if(II->m[i] !=
NULL)
9114 II->m[i+1] = II->m[
i];
9118 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
9124 integer =
pHead(syz->m[i]);
9132 pmon =
prMapR(integer, nMap2, QQ_ring, origR);
9147 for(
int i = 0; i<
IDELEMS(one); i++)
9151 if(mindegmon ==
NULL)
9152 mindegmon = one->m[
i];
9155 if(
p_Deg(one->m[i], QQ_ring) <
p_Deg(mindegmon, QQ_ring))
9156 mindegmon = one->m[i];
9160 if(mindegmon !=
NULL)
9162 for(
int i =
IDELEMS(II)-1; i>=0; i--)
9163 if(II->m[i] !=
NULL)
9164 II->m[i+1] = II->m[
i];
9165 II->m[0] = mindegmon;
9168 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
9195 pmon =
prMapR(mindegmon, nMap2, QQ_ring, origR);
9229 poly pH = h->GetP();
9233 for(
int i = 0; i<=strat->
sl; i++)
9299 for(
int j = 0; j<=strat->
sl; j++)
9303 for(
int i = 0; i<=strat->
sl; i++)
9305 if((i != j) && (strat->
S[i] !=
NULL))
9366 if (expbound == 0) expbound = strat->
tailRing->bitmask << 1;
9387 new_tailRing->pFDeg =
currRing->pFDeg;
9388 new_tailRing->pLDeg =
currRing->pLDeg;
9392 Print(
"[%lu:%d", (
unsigned long) new_tailRing->bitmask, new_tailRing->ExpL_Size);
9401 for (i=0; i<=strat->
tl; i++)
9403 strat->
T[
i].ShallowCopyDelete(new_tailRing, new_tailBin,
9404 p_shallow_copy_delete);
9406 for (i=0; i<=strat->
Ll; i++)
9410 strat->
L[
i].ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
9412 if ((strat->
P.t_p !=
NULL) ||
9414 strat->
P.ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
9416 if ((L !=
NULL) && (L->tailRing != new_tailRing))
9419 L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
9425 L->tailRing = new_tailRing;
9432 if ((T !=
NULL) && (T->tailRing != new_tailRing && T->i_r < 0))
9433 T->ShallowCopyDelete(new_tailRing, new_tailBin, p_shallow_copy_delete);
9466 unsigned long l = 0;
9472 for (i=0; i<= strat->
Ll; i++)
9476 for (i=0; i<=strat->
tl; i++)
9502 res->order = (
int *)
omAlloc0((n+1)*
sizeof(int));
9503 res->block0 = (
int *)
omAlloc0((n+1)*
sizeof(int));
9504 res->block1 = (
int *)
omAlloc0((n+1)*
sizeof(int));
9505 int **wvhdl = (
int **)
omAlloc0((n+1)*
sizeof(
int*));
9507 for (
int i=1; i<
n; i++)
9509 res->order[
i] = r->order[i-1];
9510 res->block0[
i] = r->block0[i-1];
9511 res->block1[
i] = r->block1[i-1];
9512 res->wvhdl[
i] = r->wvhdl[i-1];
9518 for (
int i=
rBlocks(res); i>0; --
i) {
9530 WarnS(
"error in nc_rComplete");
9548 res->order = (
int *)
omAlloc0((n+2)*
sizeof(int));
9549 res->block0 = (
int *)
omAlloc0((n+2)*
sizeof(int));
9550 res->block1 = (
int *)
omAlloc0((n+2)*
sizeof(int));
9551 int **wvhdl = (
int **)
omAlloc0((n+2)*
sizeof(
int*));
9553 for (
int i=2; i<n+2; i++)
9555 res->order[
i] = r->order[i-2];
9556 res->block0[
i] = r->block0[i-2];
9557 res->block1[
i] = r->block1[i-2];
9558 res->wvhdl[
i] = r->wvhdl[i-2];
9564 res->wvhdl[0] = (
int *)
omAlloc(res->N*
sizeof(
int));
9565 for (
int i=0; i<res->N; ++
i)
9566 res->wvhdl[0][i] = 1;
9570 res->wvhdl[1] =
NULL;
9572 for (
int i=
rBlocks(res); i>1; --
i) {
9584 WarnS(
"error in nc_rComplete");
9721 #ifdef HAVE_TAIL_BIN
9735 (tailRing !=
NULL ? tailRing->PolyBin:
9748 Timings
for the different possibilities of posInT:
9749 T15 EDL DL EL L 1-2-3
9750 Gonnet 43.26 42.30 38.34 41.98 38.40 100.04
9751 Hairer_2_1 1.11 1.15 1.04 1.22 1.08 4.7
9752 Twomat3 1.62 1.69 1.70 1.65 1.54 11.32
9753 ahml 4.48 4.03 4.03 4.38 4.96 26.50
9754 c7 15.02 13.98 15.16 13.24 17.31 47.89
9755 c8 505.09 407.46 852.76 413.21 499.19
n/
a
9756 f855 12.65 9.27 14.97 8.78 14.23 33.12
9757 gametwo6 11.47 11.35 14.57 11.20 12.02 35.07
9758 gerhard_3 2.73 2.83 2.93 2.64 3.12 6.24
9759 ilias13 22.89 22.46 24.62 20.60 23.34 53.86
9760 noon8 40.68 37.02 37.99 36.82 35.59 877.16
9761 rcyclic_19 48.22 42.29 43.99 45.35 51.51 204.29
9762 rkat9 82.37 79.46 77.20 77.63 82.54 267.92
9763 schwarz_11 16.46 16.81 16.76 16.81 16.72 35.56
9764 test016 16.39 14.17 14.40 13.50 14.26 34.07
9765 test017 34.70 36.01 33.16 35.48 32.75 71.45
9766 test042 10.76 10.99 10.27 11.57 10.45 23.04
9767 test058 6.78 6.75 6.51 6.95 6.22 9.47
9768 test066 10.71 10.94 10.76 10.61 10.56 19.06
9769 test073 10.75 11.11 10.17 10.79 8.63 58.10
9770 test086 12.23 11.81 12.88 12.24 13.37 66.68
9771 test103 5.05 4.80 5.47 4.64 4.89 11.90
9772 test154 12.96 11.64 13.51 12.46 14.61 36.35
9773 test162 65.27 64.01 67.35 59.79 67.54 196.46
9774 test164 7.50 6.50 7.68 6.70 7.96 17.13
9775 virasoro 3.39 3.50 3.35 3.47 3.70 7.66
9785 if (length==-1)
return 0;
9788 int op=p.GetpFDeg();
9789 int ol = p.GetpLength();
9791 if (set[length].ecart < o)
9793 if (set[length].ecart == o)
9795 int oo=set[length].GetpFDeg();
9796 if ((oo < op) || ((oo==op) && (set[length].length < ol)))
9807 if (set[an].ecart > o)
9809 if (set[an].ecart == o)
9811 int oo=set[an].GetpFDeg();
9813 || ((oo==op) && (set[an].
pLength > ol)))
9819 if (set[i].ecart > o)
9821 else if (set[i].ecart == o)
9823 int oo=set[
i].GetpFDeg();
9825 || ((oo == op) && (set[i].
pLength > ol)))
9839 if (length==-1)
return 0;
9841 int op=p.GetpFDeg();
9842 int ol = p.GetpLength();
9844 int oo=set[length].GetpFDeg();
9845 if ((oo < op) || ((oo==op) && (set[length].length < ol)))
9855 int oo=set[an].GetpFDeg();
9857 || ((oo==op) && (set[an].
pLength > ol)))
9862 int oo=set[
i].GetpFDeg();
9864 || ((oo == op) && (set[i].
pLength > ol)))
9875 int ol = p.GetpLength();
9878 if (set[length].length<p.length)
9889 if (set[an].
pLength>ol)
return an;
9914 else Print(
"%p\n",(
void*)strat->
red);
9926 #ifdef HAVE_MORE_POS_IN_T
9955 PrintS(
"initEcartPair: ");
9959 Print(
"homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
9961 Print(
"honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
9967 Print(
"posInLDependsOnLength=%d\n",
9999 PrintS(
"currRing->pFDeg: ");
10010 Print(
" degBound: %d\n", Kstd1_deg);
10014 PrintS(
"ecartWeights: ");
10021 #ifndef SING_NDEBUG
10027 #ifdef HAVE_SHIFTBBA
10041 #ifdef HAVE_SHIFTBBA
10058 #ifdef HAVE_SHIFTBBA
10150 #ifdef HAVE_SHIFTBBA
10160 for (i=0; i<=strat->
sl; i++)
10162 memset(&h,0,
sizeof(h));
10165 h.sev = strat->
sevS[
i];
10179 #ifdef HAVE_SHIFTBBA
10260 #ifdef HAVE_SHIFTBBA
10300 qfromQ = strat->
fromQ[
i];
10312 enterOnePairShift(qq, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, 0, i, uptodeg, lV);
10314 for (j=1; j<= toInsert; j++)
10329 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, i, uptodeg, lV);
10334 #ifdef HAVE_SHIFTBBA
10376 for (; j<= toInsert; j++)
10393 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, -1, uptodeg, lV);
10398 #ifdef HAVE_SHIFTBBA
10402 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)
10426 int qfromQ = qisFromQ;
10435 Lp.ecart=0; Lp.length=0;
10444 if (!
isInV(Lp.lcm, lV))
10449 PrintS(
"V crit applied to q = ");
10465 if((!((ecartq>0)&&(ecart>0)))
10488 Lp.ecart =
si_max(ecart,ecartq);
10489 if (strat->
fromT && (ecartq>ecart))
10507 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
10512 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
10556 if (strat->
fromT && (ecartq>ecart))
10569 for(j = strat->
Bl;j>=0;j--)
10571 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
10575 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
10599 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (qfromQ!=0))
10666 if ( (atR >= 0) && (shiftcount==0) && (ifromS >=0) )
10685 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
10691 #ifdef HAVE_SHIFTBBA
10706 if ( (!strat->
fromT)
10715 clearS(h,h_sev, &j,&k,strat);
10724 #ifdef HAVE_SHIFTBBA
10745 for (j=0; j<=
k; j++)
10747 if (!strat->
fromQ[j])
10760 for (j=0; j<=
k; j++)
10773 for (j=0; j<=
k; j++)
10798 #ifdef HAVE_SHIFTBBA
10818 atT = strat->
posInT(strat->
T, strat->
tl, p);
10825 for (i=1; i<=toInsert; i++)
10836 atT = strat->
posInT(strat->
T, strat->
tl, qq);
10845 #ifdef HAVE_SHIFTBBA
10852 p = h = L->GetLmTailRing();
10854 return L->GetLmCurrRing();
10861 Ln.pLength = L->GetpLength() - 1;
10869 while(!Ln.IsNull())
10873 Ln.SetShortExpVector();
10879 With = &(strat->
T[
j]);
10884 if (With ==
NULL)
break;
10900 pNext(h) = Ln.LmExtractAndIter();
10903 }
while (!Ln.IsNull());
10906 if (Ln.IsNull())
goto all_done;
10907 if (! withT) With_s.Init(
currRing);
10909 pNext(h) = Ln.LmExtractAndIter();
10924 return L->GetLmCurrRing();
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
#define TEST_OPT_INFREDTAIL
#define pSetmComp(p)
TODO:
void initEcartPairBba(LObject *Lp, poly, poly, int, int)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
int getIndexRng(long coeff)
int posInL11(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
denominator_list_s * denominator_list
int posInT_pLength(const TSet set, const int length, LObject &p)
#define omRealloc0Size(addr, o_size, size)
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
unsigned long p_GetMaxExpL(poly p, const ring r, unsigned long l_max)
return the maximal exponent of p in form of the maximal long var
static FORCE_INLINE number n_IntMod(number a, number b, const coeffs r)
for r a field, return n_Init(0,r) otherwise: n_Div(a,b,r)*b+n_IntMod(a,b,r)==a
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
KINLINE TObject ** initR()
const CanonicalForm int s
int posInTrg0(const TSet set, const int length, LObject &p)
void omMergeStickyBinIntoBin(omBin sticky_bin, omBin into_bin)
void initSbaPos(kStrategy strat)
poly redtail(LObject *L, int pos, kStrategy strat)
void enterOnePairShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS, int, int lV)
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
void enterSSba(LObject &p, int atS, kStrategy strat, int atR)
int posInL17(const LSet set, const int length, LObject *p, const kStrategy)
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
int itoInsert(poly p, int uptodeg, int lV, const ring r)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
void enterSMora(LObject &p, int atS, kStrategy strat, int atR=-1)
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
static FORCE_INLINE BOOLEAN n_IsUnit(number n, const coeffs r)
TRUE iff n has a multiplicative inverse in the given coeff field/ring r.
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
static CanonicalForm bound(const CFMatrix &M)
int posInT2(const TSet set, const int length, LObject &p)
long pLDeg1(poly p, int *l, const ring r)
static int p_Cmp(poly p1, poly p2, ring r)
KINLINE unsigned long * initsevT()
#define TEST_OPT_DEGBOUND
int posInL11Ringls(const LSet set, const int length, LObject *p, const kStrategy strat)
void pLcmRat(poly a, poly b, poly m, int rat_shift)
void initBuchMoraPos(kStrategy strat)
void clearSbatch(poly h, int k, int pos, kStrategy strat)
BOOLEAN(* rewCrit1)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
BOOLEAN p_LmCheckIsFromRing(poly p, ring r)
poly preIntegerCheck(ideal FOrig, ideal Q)
used for GB over ZZ: look for constant and monomial elements in the ideal background: any known const...
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
pLDegProc pOrigLDeg_TailRing
long pLDeg1c_Totaldegree(poly p, int *l, const ring r)
static int * initS_2_R(const int maxnr)
void messageStat(int hilbcount, kStrategy strat)
static int min(int a, int b)
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)
Compatiblity layer for legacy polynomial operations (over currRing)
int posInT1(const TSet set, const int length, LObject &p)
long totaldegreeWecart(poly p, ring r)
void chainCritNormal(poly p, int ecart, kStrategy strat)
void initenterpairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
KINLINE int ksReducePolyTail(LObject *PR, TObject *PW, LObject *Red)
int 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)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p
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 enterOnePairSig(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
poly prMoveR(poly &p, ring src_r, ring dest_r)
void reorderS(int *suc, kStrategy strat)
static int rGetCurrSyzLimit(const ring r)
void initenterstrongPairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
static BOOLEAN p_LmExpVectorAddIsOk(const poly p1, const poly p2, const ring r)
static poly pp_Mult_nn(poly p, number n, const ring r)
int posInL13(const LSet set, const int length, LObject *p, const kStrategy)
#define TEST_OPT_CONTENTSB
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
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)
const CanonicalForm CFMap CFMap int &both_non_zero int n
static short rVar(const ring r)
#define rVar(r) (r->N)
static int pDivComp(poly p, poly q)
int ksCheckCoeff(number *a, number *b)
void initSyzRules(kStrategy strat)
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)
void initSLSba(ideal F, ideal Q, kStrategy strat)
void cancelunit(LObject *L, BOOLEAN inNF)
poly kCreateZeroPoly(long exp[], long cabsind, poly *t_p, ring leadRing, ring tailRing)
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
poly nc_CreateShortSpoly(poly p1, poly p2, const ring r)
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
poly redtailBba(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
int posInLF5C(const LSet, const int, LObject *, const kStrategy strat)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
long pLDeg1_Deg(poly p, int *l, const ring r)
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR, int uptodeg, int lV)
static unsigned long * initsevS(const int maxnr)
ring rAssure_c_dp(const ring r)
int posInT15(const TSet set, const int length, LObject &p)
int(* red)(LObject *L, kStrategy strat)
static bool rIsPluralRing(const ring r)
we must always have this test!
int nextZeroSimplexExponent(long exp[], long ind[], long cexp[], long cind[], long *cabsind, long step[], long bound, long N)
int redHomog(LObject *h, kStrategy strat)
static poly redBba1(poly h, int maxIndex, kStrategy strat)
int(* posInT)(const TSet T, const int tl, LObject &h)
static number p_SetCoeff(poly p, number n, ring r)
void HEckeTest(poly pp, kStrategy strat)
#define omCheckBinAddrSize(addr, size)
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.
static int pLength(poly a)
int posInL110(const LSet set, const int length, LObject *p, const kStrategy)
int posInT0(const TSet, const int length, LObject &)
static poly p_Copy(poly p, const ring r)
returns a copy of p
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void enterExtendedSpoly(poly h, kStrategy strat)
static FORCE_INLINE number n_Ann(number a, const coeffs r)
if r is a ring with zero divisors, return an annihilator!=0 of b otherwise return NULL ...
BOOLEAN(* syzCrit)(poly sig, unsigned long not_sevSig, kStrategy strat)
char completeReduce_retry
void initenterpairsShift(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
void kStratInitChangeTailRing(kStrategy strat)
static poly redBba(poly h, int maxIndex, kStrategy strat)
int posInLSig(const LSet set, const int length, LObject *p, const kStrategy)
long pLDeg1c_Deg(poly p, int *l, const ring r)
pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring, ring)
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
BOOLEAN kPosInLDependsOnLength(int(*pos_in_l)(const LSet set, const int length, LObject *L, const kStrategy strat))
void enterT(LObject &p, kStrategy strat, int atT)
poly prMapR(poly src, nMapFunc nMap, ring src_r, ring dest_r)
int redHoney(LObject *h, kStrategy strat)
void p_Cleardenom_n(poly ph, const ring r, number &c)
poly p_LPshift(poly p, int sh, int uptodeg, int lV, const ring r)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
void updateSShift(kStrategy strat, int uptodeg, int lV)
#define pFalseReturn(cond)
BOOLEAN p_CheckPolyRing(poly p, ring r)
#define omReallocSize(addr, o_size, size)
void(* initEcart)(TObject *L)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pGetExp(p, i)
Exponent.
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)
KINLINE TObject * S_2_T(int i)
void kBucketDestroy(kBucket_pt *bucket_pt)
void initEcartPairMora(LObject *Lp, poly, poly, int ecartF, int ecartG)
#define TEST_OPT_INTSTRATEGY
static void p_SetCompP(poly p, int i, ring r)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define TEST_OPT_NOT_SUGAR
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ...
static void enlargeT(TSet &T, TObject **&R, unsigned long *&sevT, int &length, const int incr)
int posInL11Ring(const LSet set, const int length, LObject *p, const kStrategy strat)
const CanonicalForm CFMap CFMap & N
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
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 initHilbCrit(ideal, ideal, intvec **hilb, kStrategy strat)
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)
#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 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)
static void p_ExpVectorAdd(poly p1, poly p2, const ring r)
int posInT17(const TSet set, const int length, LObject &p)
static poly p_LmFreeAndNext(poly p, ring)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
void deleteInSSba(int i, kStrategy strat)
static FORCE_INLINE int n_DivComp(number a, number b, const coeffs r)
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static FORCE_INLINE number n_Lcm(number a, number b, const coeffs r)
in Z: return the lcm of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
omBin omGetStickyBinOfBin(omBin bin)
void initBuchMoraShift(ideal F, ideal Q, kStrategy strat)
BOOLEAN rHasMixedOrdering(const ring r)
void enterT_strong(LObject &p, kStrategy strat, int atT)
static void enlargeL(LSet *L, int *length, const int incr)
static BOOLEAN _p_LmDivisibleByPart(poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
static int index(p_Length length, p_Ord ord)
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
void rChangeCurrRing(ring r)
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether)
poly redtailBba_Z(LObject *L, int pos, kStrategy strat)
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat)
BOOLEAN arriRewCriterion(poly, unsigned long, poly, kStrategy strat, int start=0)
void enterSMoraNF(LObject &p, int atS, kStrategy strat, int atR=-1)
#define rRing_has_Comp(r)
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
static void p_Delete(poly *p, const ring r)
static FORCE_INLINE number n_ExtGcd(number a, number b, number *s, number *t, const coeffs r)
beware that ExtGCD is only relevant for a few chosen coeff. domains and may perform something unexpec...
unsigned long p_GetShortExpVector(const poly p, const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
poly p_LPshiftT(poly p, int sh, int uptodeg, int lV, kStrategy strat, const ring r)
void kMergeBintoLSba(kStrategy strat)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
void initenterzeropairsRing(poly p, int ecart, kStrategy strat, int atR)
poly(* pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r, omBin dest_bin)
returns a poly from dest_r which is a ShallowCopy of s_p from source_r assumes that source_r->N == de...
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int)
#define TEST_OPT_SUGARCRIT
BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat)
void(* chainCrit)(poly p, int ecart, kStrategy strat)
void initPairtest(kStrategy strat)
long pLDegb(poly p, int *l, const ring r)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void postReduceByMon(LObject *h, kStrategy strat)
used for GB over ZZ: intermediate reduction by monomial elements background: any known constant eleme...
BOOLEAN p_CheckIsFromRing(poly p, ring r)
static BOOLEAN rField_is_Ring(const ring r)
void cleanT(kStrategy strat)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
void pEnlargeSet(poly **p, int l, int increment)
long pLDeg1_Totaldegree(poly p, int *l, const ring r)
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
int redEcart(LObject *h, kStrategy strat)
BOOLEAN rHasGlobalOrdering(const ring r)
void rDelete(ring r)
unconditionally deletes fields in r
long ind_fact_2(long arg)
int posInSyz(const kStrategy strat, poly sig)
BOOLEAN enterOneStrongPoly(int i, poly p, int, int, kStrategy strat, int atR, bool enterTstrong)
int posInT110(const TSet set, const int length, LObject &p)
void pNorm(poly p, const ring R=currRing)
void enterOnePairRing(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
#define pInit()
allocates a new monomial and initializes everything to 0
#define TEST_OPT_CANCELUNIT
void initSbaCrit(kStrategy strat)
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
#define omSizeWOfBin(bin_ptr)
void updateS(BOOLEAN toT, kStrategy strat)
static bool rIsSCA(const ring r)
void completeReduce(kStrategy strat, BOOLEAN withT)
#define REDTAIL_CANONICALIZE
BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat)
void chainCritOpt_1(poly, int, kStrategy strat)
void rKillModifiedRing(ring r)
long maxdegreeWecart(poly p, int *l, ring r)
void enterOnePairLift(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
static void p_Setm(poly p, const ring r)
void updateResult(ideal r, ideal Q, kStrategy strat)
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
KINLINE TObject * s_2_t(int i)
long pLDeg1_WFirstTotalDegree(poly p, int *l, const ring r)
int redFirst(LObject *h, kStrategy strat)
int posInLSpecial(const LSet set, const int length, LObject *p, const kStrategy)
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring tailRing)
static nc_type & ncRingType(nc_struct *p)
static intset initec(const int maxnr)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
static int pDivCompRing(poly p, poly q)
long pLDeg1c_WFirstTotalDegree(poly p, int *l, const ring r)
poly pCopyL2p(LObject H, kStrategy strat)
int idElem(const ideal F)
count non-zero elements
int dReportError(const char *fmt,...)
#define ALLOW_PROD_CRIT(A)
static poly p_Neg(poly p, const ring r)
static void p_LmDelete(poly p, const ring r)
BOOLEAN isInPairsetB(poly q, int *k, kStrategy strat)
long p_WTotaldegree(poly p, const ring r)
static poly redMora(poly h, int maxIndex, kStrategy strat)
void kMergeBintoL(kStrategy strat)
void p_wrp(poly p, ring lmRing, ring tailRing)
void p_Write(poly p, ring lmRing, ring tailRing)
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
int kFindDivisibleByInT(const kStrategy strat, const LObject *L, const int start)
return -1 if no divisor is found number of first divisor in T, otherwise
BOOLEAN newHEdge(kStrategy strat)
int posInT19(const TSet set, const int length, LObject &p)
poly redtailBbaShift(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
void initEcartNormal(TObject *h)
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r1, const ring r2)
static LSet initL(int nr=setmaxL)
static poly p_Add_q(poly p, poly q, const ring r)
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
int posInT_EcartpLength(const TSet set, const int length, LObject &p)
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
KINLINE poly kNoetherTail()
static BOOLEAN sugarDivisibleBy(int ecart1, int ecart2)
void enterOnePairManyShifts(int i, poly p, int ecart, int isFromQ, kStrategy strat, int, int uptodeg, int lV)
poly p_Cleardenom(poly p, const ring r)
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
void chainCritPart(poly p, int ecart, kStrategy strat)
void nKillChar(coeffs r)
undo all initialisations
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static poly p_Mult_q(poly p, poly q, const ring r)
static bool rIsRatGRing(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
void idDelete(ideal *h)
delete an ideal
#define ENTER_USE_MEMMOVE
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
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...
BOOLEAN pCompareChainPart(poly p, poly p1, poly p2, poly lcm, const ring R)