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";
675 r_assume(strat_tailRing == tailRing);
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);
723 p_Setm(test_max, tailRing);
735 if (
T->p ==
NULL &&
i > 0)
740 if ((
i >= 0) && (
T->pLength != 0)
745 return dReportError(
"%c[%d] pLength error: has %d, specified to have %d",
750 if (
i >= 0 && (TN ==
'T' || TN ==
'L'))
753 if (
T->FDeg !=
T->pFDeg())
757 return dReportError(
"%c[%d] FDeg error: has %d, specified to have %d",
758 TN,
i ,
T->pFDeg(), d);
763 if (
i >= 0 && TN ==
'T')
778 if (L->bucket !=
NULL)
780 kFalseReturn(
kbTest(L->bucket));
781 r_assume(L->bucket->bucket_ring == L->tailRing);
788 kFalseReturn(
kTest_T(L, strat_tailRing, lpos,
'L'));
797 return dReportError(
"L[%d] wrong sev: has %o, specified to have %o",
806 else if (tlength > 0 &&
T !=
NULL && (lpos >=0))
827 -1, strat->
T, strat->
tl));
830 if (strat->
T !=
NULL)
832 for (i=0; i<=strat->
tl; i++)
841 if (strat->
L !=
NULL)
843 for (i=0; i<=strat->
Ll; i++)
846 strat->
L[i].Next() != strat->
tail,
i,
847 strat->
T, strat->
tl));
858 if (strat->
S !=
NULL)
868 for (i=0; i<=strat->
sl; i++)
870 if (strat->
S[i] !=
NULL &&
873 return dReportError(
"S[%d] wrong sev: has %o, specified to have %o",
886 kFalseReturn(
kTest(strat));
889 for (i=0; i<=strat->
tl; i++)
891 if (strat->
T[i].i_r < 0 || strat->
T[i].i_r > strat->
tl)
892 return dReportError(
"strat->T[%d].i_r == %d out of bounds", i,
894 if (strat->
R[strat->
T[i].i_r] != &(strat->
T[i]))
898 if (strat->
S !=
NULL)
900 for (i=0; i<=strat->
sl; i++)
905 if (strat->
S_2_R[i] != strat->
T[j].i_r)
907 i, strat->
S_2_R[i], j, strat->
T[j].i_r);
911 for (i=0; i<=strat->
Ll; i++)
913 if (strat->
L[i].p1 !=
NULL && strat->
L[i].p2)
915 if (strat->
L[i].i_r1 < 0 ||
916 strat->
L[i].i_r1 > strat->
tl ||
917 strat->
L[i].T_1(strat)->p != strat->
L[
i].p1)
919 if (strat->
L[i].i_r2 < 0 ||
920 strat->
L[i].i_r2 > strat->
tl ||
921 strat->
L[i].T_2(strat)->p != strat->
L[
i].p2)
926 if (strat->
L[i].i_r1 != -1)
928 if (strat->
L[i].i_r2 != -1)
931 if (strat->
L[i].i_r != -1)
944 #ifdef ENTER_USE_MEMMOVE 945 memmove(&(strat->
S[i]), &(strat->
S[i+1]), (strat->
sl - i)*
sizeof(
poly));
946 memmove(&(strat->
ecartS[i]),&(strat->
ecartS[i+1]),(strat->
sl - i)*
sizeof(
int));
947 memmove(&(strat->
sevS[i]),&(strat->
sevS[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
948 memmove(&(strat->
S_2_R[i]),&(strat->
S_2_R[i+1]),(strat->
sl - i)*
sizeof(
int));
951 for (j=i; j<strat->
sl; j++)
953 strat->
S[
j] = strat->
S[j+1];
961 #ifdef ENTER_USE_MEMMOVE 962 memmove(&(strat->
lenS[i]),&(strat->
lenS[i+1]),(strat->
sl - i)*
sizeof(
int));
964 for (j=i; j<strat->
sl; j++) strat->
lenS[j] = strat->
lenS[j+1];
969 #ifdef ENTER_USE_MEMMOVE 972 for (j=i; j<strat->
sl; j++) strat->
lenSw[j] = strat->
lenSw[j+1];
977 #ifdef ENTER_USE_MEMMOVE 978 memmove(&(strat->
fromQ[i]),&(strat->
fromQ[i+1]),(strat->
sl - i)*
sizeof(
int));
980 for (j=i; j<strat->
sl; j++)
996 #ifdef ENTER_USE_MEMMOVE 997 memmove(&(strat->
S[i]), &(strat->
S[i+1]), (strat->
sl - i)*
sizeof(
poly));
998 memmove(&(strat->
sig[i]), &(strat->
sig[i+1]), (strat->
sl - i)*
sizeof(
poly));
999 memmove(&(strat->
ecartS[i]),&(strat->
ecartS[i+1]),(strat->
sl - i)*
sizeof(
int));
1000 memmove(&(strat->
sevS[i]),&(strat->
sevS[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1001 memmove(&(strat->
sevSig[i]),&(strat->
sevSig[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1002 memmove(&(strat->
S_2_R[i]),&(strat->
S_2_R[i+1]),(strat->
sl - i)*
sizeof(
int));
1005 for (j=i; j<strat->
sl; j++)
1007 strat->
S[
j] = strat->
S[j+1];
1008 strat->
sig[
j] = strat->
sig[j+1];
1017 #ifdef ENTER_USE_MEMMOVE 1018 memmove(&(strat->
lenS[i]),&(strat->
lenS[i+1]),(strat->
sl - i)*
sizeof(
int));
1020 for (j=i; j<strat->
sl; j++) strat->
lenS[j] = strat->
lenS[j+1];
1025 #ifdef ENTER_USE_MEMMOVE 1028 for (j=i; j<strat->
sl; j++) strat->
lenSw[j] = strat->
lenSw[j+1];
1033 #ifdef ENTER_USE_MEMMOVE 1034 memmove(&(strat->
fromQ[i]),&(strat->
fromQ[i+1]),(strat->
sl - i)*
sizeof(
int));
1036 for (j=i; j<strat->
sl; j++)
1092 if (*length > 0 && j < *length)
1094 #ifdef ENTER_USE_MEMMOVE 1095 memmove(&(
set[j]), &(
set[j+1]), (*length - j)*
sizeof(
LObject));
1098 for (i=j; i < (*length); i++)
1103 memset(&(
set[*length]),0,
sizeof(
LObject));
1114 assume(p.FDeg == p.pFDeg());
1119 if (at <= (*length))
1121 memmove(&((*
set)[at+1]), &((*set)[at]), ((*length)-at+1)*
sizeof(
LObject));
1123 for (
i=(*length)+1;
i>=at+1;
i--) (*
set)[
i] = (*set)[
i-1];
1137 h->FDeg = h->pFDeg();
1138 h->ecart = h->pLDeg() - h->FDeg;
1140 h->length=h->pLength=
pLength(h->p);
1145 h->FDeg = h->pFDeg();
1147 h->length=h->pLength=
pLength(h->p);
1152 Lp->FDeg = Lp->pFDeg();
1159 Lp->FDeg = Lp->pFDeg();
1160 (*Lp).ecart =
si_max(ecartF,ecartG);
1161 (*Lp).ecart = (*Lp).ecart- (Lp->FDeg -
p_FDeg((*Lp).lcm,
currRing));
1170 return (ecart1 <= ecart2);
1182 int l,
j,compare,compareCoeff;
1186 h.ecart=0; h.length=0;
1198 pLcm(p,strat->
S[i],h.lcm);
1207 for(j = strat->
Bl;j>=0;j--)
1212 printf(
"\nChainCrit in enteronepairring\n");
1218 printf(
"\nh - neue Paar\n");
1223 printf(
"\ncompare = %i\ncompareCoeff = %i\n",compare,compareCoeff);
1230 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1233 printf(
"\nGelöscht h\n");
1244 printf(
"\nGelöscht: B[j]\n");
1251 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1254 printf(
"\nGelöscht h\n");
1267 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1270 printf(
"\nGelöscht h\n");
1281 printf(
"\nGelöscht: B[j]\n");
1291 printf(
"\nTrying to add spair S[%i] und p\n",i);
pWrite(strat->
S[i]);
pWrite(p);
1360 printf(
"\nThis is afterwards:\n");
1363 h.i_r1 = -1;h.i_r2 = -1;
1373 h.i_r2 = strat->
S_2_R[
i];
1379 posx = strat->
posInL(strat->
B,strat->
Bl,&h,strat);
1384 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);
1455 PrintS(
"\n--- create strong gcd poly: ");
1456 Print(
"\n p: %d", i);
1458 Print(
"\n strat->S[%d]: ", i);
1482 h.i_r1 = -1;h.i_r2 = -1;
1488 h.p1 =
p;h.p2 = strat->
S[
i];
1492 h.i_r2 = strat->
S_2_R[
i];
1503 posx = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
1508 if(h.IsNull())
return FALSE;
1522 printf(
"\nThis strong poly was added to L:\n");
pWrite(h.p);
pWrite(h.p1);
pWrite(h.p2);
1541 Lp.ecart=0; Lp.length=0;
1546 #ifndef HAVE_RATGRING 1547 pLcm(p,strat->
S[i],Lp.lcm);
1548 #elif defined(HAVE_RATGRING) 1552 pLcm(p,strat->
S[i],Lp.lcm);
1559 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
1601 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
1606 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1663 for(j = strat->
Bl;j>=0;j--)
1665 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
1669 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1695 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
1740 PrintS(
"enterOnePairNormal::\n strat->S[i]: ");
pWrite(strat->
S[i]);
1755 PrintS(
"enterOnePairNormal::\n strat->S[i]: ");
pWrite(strat->
S[i]);
1784 Lp.p1 = strat->
S[
i];
1798 Lp.i_r1 = strat->
S_2_R[
i];
1814 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
1849 Lp.ecart=0; Lp.length=0;
1854 pLcm(p,strat->
S[i],Lp.lcm);
1859 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
1901 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
1906 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1959 for(j = strat->
Bl;j>=0;j--)
1961 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
1965 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1990 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2018 Lp.p1 = strat->
S[
i];
2025 Lp.i_r1 = strat->
S_2_R[
i];
2040 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2064 unsigned long pSigMultNegSev,sSigMultNegSev;
2068 Lp.ecart=0; Lp.length=0;
2073 #ifndef HAVE_RATGRING 2074 pLcm(p,strat->
S[i],Lp.lcm);
2075 #elif defined(HAVE_RATGRING) 2103 Print(
"----------------\n");
2106 Print(
"----------------\n");
2112 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2136 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2137 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2138 || strat->
rewCrit1(sSigMult,sSigMultNegSev,Lp.lcm,strat,i+1)
2164 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2209 PrintS(
"enterOnePairNormal::\n strat->S[i]: ");
pWrite(strat->
S[i]);
2224 PrintS(
"enterOnePairNormal::\n strat->S[i]: ");
pWrite(strat->
S[i]);
2239 Lp.sevSig = ~pSigMultNegSev;
2246 Lp.sevSig = ~sSigMultNegSev;
2257 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1)) {
2271 Lp.checked = strat->
sl+1;
2277 Lp.prod_crit =
TRUE;
2290 PrintS(
"SIGNATURE OF PAIR: ");
2294 Lp.p1 = strat->
S[
i];
2308 Lp.i_r1 = strat->
S_2_R[
i];
2352 pLcm(p,strat->
S[i],Lp.lcm);
2373 Lp.p1 = strat->
S[
i];
2377 Lp.i_r1 = strat->
S_2_R[
i];
2392 l = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
2403 int j=strat->
Ll+strat->
Bl+1;
2413 for (i=strat->
Bl; i>=0; i--)
2415 j = strat->
posInL(strat->
L,j,&(strat->
B[i]),strat);
2426 int j=strat->
Ll+strat->
Bl+1;
2436 for (i=strat->
Bl; i>=0; i--)
2438 j = strat->
posInLSba(strat->
L,j,&(strat->
B[i]),strat);
2460 for (j=0; j<=strat->
sl; j++)
2464 for (i=strat->
Bl; i>=0; i--)
2487 for (j=strat->
Ll; j>=0; j--)
2493 if (strat->
L[j].p == strat->
tail)
2513 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
2539 for (j=strat->
Ll; j>=0; j--)
2559 for(i=j-1; i>=0; i--)
2561 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
2578 for (j=strat->
Ll; j>=0; j--)
2609 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
2612 if (strat->
L[j].p2 == p)
2618 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
2632 strat->
L[
i].p2 = strat->
tail;
2649 else if (strat->
L[j].p2 == strat->
tail)
2688 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
2691 if (strat->
L[j].p2 == p)
2697 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
2711 strat->
L[
i].p2 = strat->
tail;
2728 else if (strat->
L[j].p2 == strat->
tail)
2736 #ifdef HAVE_RATGRING 2750 for (j=0; j<=strat->
sl; j++)
2754 for (i=strat->
Bl; i>=0; i--)
2762 Print(
"chain-crit-part: S[%d]=",j);
2764 Print(
" divide B[%d].lcm=",i);
2787 for (j=strat->
Ll; j>=0; j--)
2793 if (strat->
L[j].p == strat->
tail)
2797 PrintS(
"chain-crit-part: pCompareChainPart p=");
2799 Print(
" delete L[%d]",j);
2821 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
2828 Print(
"chain-crit-part: sugar B[%d].lcm=",j);
2830 Print(
" delete B[%d]",i);
2841 Print(
"chain-crit-part: sugar B[%d].lcm=",i);
2843 Print(
" delete B[%d]",j);
2863 for (j=strat->
Ll; j>=0; j--)
2871 PrintS(
"chain-crit-part: sugar:pCompareChainPart p=");
2873 Print(
" delete L[%d]",j);
2891 for(i=j-1; i>=0; i--)
2893 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
2897 Print(
"chain-crit-part: equal lcm B[%d].lcm=",j);
2899 Print(
" delete B[%d]\n",i);
2916 for (j=strat->
Ll; j>=0; j--)
2924 PrintS(
"chain-crit-part: pCompareChainPart p=");
2926 Print(
" delete L[%d]",j);
2955 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
2958 if (strat->
L[j].p2 == p)
2964 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
2981 strat->
L[
i].p2 = strat->
tail;
2988 PrintS(
"chain-crit-part: divisible_by p=");
2990 Print(
" delete L[%d]",l);
3001 PrintS(
"chain-crit-part: divisible_by(2) p=");
3003 Print(
" delete L[%d]",i);
3014 else if (strat->
L[j].p2 == strat->
tail)
3042 for (j=0; j<=
k; j++)
3044 if (!strat->
fromQ[j])
3055 for (j=0; j<=
k; j++)
3058 PrintS(
"\n Trying to add spoly : \n");
3069 for (j=0; j<=
k; j++)
3082 #ifdef HAVE_RATGRING 3111 for (j=0; j<=
k; j++)
3113 if (!strat->
fromQ[j])
3124 for (j=0; j<=
k; j++)
3133 for (j=0; j<=
k; j++)
3147 #ifdef HAVE_RATGRING 3174 for (j=0; j<=strat->
sl; j++)
3178 for (i=strat->
Bl; i>=0; i--)
3185 PrintS(
"--- chain criterion func chainCritRing type 1\n");
3188 PrintS(
" strat->B[i].lcm:");
3193 wrp(strat->
B[i].lcm);
3198 printf(
"\nChainCrit1\n");
3214 for (j=strat->
Ll; j>=0; j--)
3223 printf(
"\nChainCrit2\n");
3233 PrintS(
"--- chain criterion func chainCritRing type 2\n");
3234 PrintS(
"strat->L[j].p:");
3265 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3268 if (strat->
L[j].p2 == p)
3276 &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3283 PrintS(
"--- chain criterion func chainCritRing type 3\n");
3284 PrintS(
"strat->L[j].lcm:");
3285 wrp(strat->
L[j].lcm);
3286 PrintS(
" strat->L[i].lcm:");
3287 wrp(strat->
L[i].lcm);
3292 printf(
"\nChainCrit3\n");
3307 strat->
L[
i].p2 = strat->
tail;
3324 else if (strat->
L[j].p2 == strat->
tail)
3338 if (arg <= 0)
return 0;
3350 if (arg <= 0)
return 0;
3351 if (arg%2 == 1) { arg--; }
3361 #ifdef HAVE_VANIDEAL 3372 int l,
j,compare,compareCoeff;
3376 Lp.ecart=0; Lp.length=0;
3392 for(j = strat->
Bl;j>=0;j--)
3396 if (compareCoeff == 0 || compare == compareCoeff)
3414 if (compareCoeff == 1)
3421 if (compareCoeff == -1)
3432 if ((f==
NULL) || (p==
NULL))
return;
3464 tmp_h.SetShortExpVector();
3469 enterT(tmp_h, strat, strat->
tl + 1);
3474 Lp.i_r1 = strat->
tl;
3478 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
3492 if ((*cabsind < bound) && (*cabsind - step[1] + add < bound))
3501 if (N == 1)
return 0;
3503 while (exp[i] == cexp[i] && i <= N) i++;
3505 *cabsind -= cind[
i];
3508 *cabsind += cind[
i];
3511 if (i > N)
return 0;
3515 for (
int j = i + 1;
j <=
N;
j++)
3517 if (step[1] > step[
j]) step[1] = step[
j];
3519 add =
ind2(cexp[i] + 2);
3520 if (*cabsind - step[1] + add >= bound)
3523 *cabsind -= cind[
i];
3525 *cabsind += cind[
i];
3528 if (i > N)
return 0;
3531 }
while (step[1] != -1);
3536 if (add < step[i]) step[
i] =
add;
3537 for (i = 2; i <=
N; i++)
3539 if (step[1] > step[i]) step[1] = step[
i];
3565 for (
int i = 1; i <= leadRing->N; i++)
3571 if (cabsind < leadRing->ch)
3573 zeroPoly =
p_ISet(
twoPow(leadRing->ch - cabsind), tailRing);
3577 zeroPoly =
p_ISet(1, tailRing);
3579 for (
int i = 1; i <= leadRing->N; i++)
3581 for (
long j = 1;
j <= exp[
i];
j++)
3584 tmp2 =
p_ISet(1, tailRing);
3589 zeroPoly =
p_Mult_q(zeroPoly, tmp2, tailRing);
3594 zeroPoly =
p_Mult_q(zeroPoly,
p_Add_q(tmp3, tmp2, tailRing), tailRing);
3599 for (
int i = 1; i <= leadRing->N; i++)
3605 zeroPoly =
pNext(zeroPoly);
3607 pNext(tmp2) = zeroPoly;
3628 for (
int i = 1; i <=
currRing->N; i++)
3631 if (exp[i] & 1 != 0)
3633 exp[
i] = exp[
i] - 1;
3646 PrintS(
"-------------\npoly :");
3648 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
3649 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
3650 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
3652 Print(
"cind : %d\n", cabsind);
3669 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
3694 for (
int i = 1; i <=
currRing->N; i++)
3705 PrintS(
"-------------\npoly :");
3707 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
3708 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
3709 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
3710 Print(
"bound : %d\n", bound);
3711 Print(
"cind : %d\n", cabsind);
3729 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
3737 G0->m[
IDELEMS(G0) - 1] = zeroPoly;
3756 for (j=0; j<=
k; j++)
3814 PrintS(
"--- create zero spoly: ");
3852 posx = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
3877 if ( (!strat->
fromT)
3887 clearS(h,h_sev, &j,&k,strat);
3903 PrintS(
"\nEnter superenterpairs\n");
3904 int iii = strat->
Ll;
3905 printf(
"\nstrat->tl = %i\n",strat->
tl);
3914 PrintS(
"\n enterExtendedSpoly has not changed the list L.\n");
3919 PrintS(
"\n enterExtendedSpoly changed the list L:\n");
3920 for(iii=0;iii<=strat->
Ll;iii++)
3922 Print(
"\n L[%d]:\n",iii);
3928 printf(
"\nstrat->tl = %i\n",strat->
tl);
3936 PrintS(
"\n initenterpairs has not changed the list L.\n");
3940 PrintS(
"\n initenterpairs changed the list L:\n");
3941 for(iii=0;iii<=strat->
Ll;iii++)
3943 Print(
"\n L[%d]:\n",iii);
3949 printf(
"\nstrat->tl = %i\n",strat->
tl);
3957 PrintS(
"\n initenterstrongPairs has not changed the list L.\n");
3961 PrintS(
"\n initenterstrongPairs changed the list L:\n");
3962 for(iii=0;iii<=strat->
Ll;iii++)
3964 Print(
"\n L[%d]:\n",iii);
3970 printf(
"\nstrat->tl = %i\n",strat->
tl);
3971 PrintS(
"\nEnd of superenterpairs\n");
3975 printf(
"\nstrat->tl = %i\n",strat->
tl);
3993 Print(
"\n Vor initenterpairs: The new pair list L -- after superenterpairs in loop\n");
3994 for(
int iii=0;iii<=strat->
Ll;iii++)
3996 printf(
"\n L[%d]:\n",iii);
4007 Print(
"\n Nach initenterpairs: The new pair list L -- after superenterpairs in loop \n");
4008 for(
int iii=0;iii<=strat->
Ll;iii++)
4010 printf(
"\n L[%d]:\n",iii);
4017 if ( (!strat->
fromT)
4026 clearS(h,h_sev, &j,&k,strat);
4049 if ( (!strat->
fromT)
4058 clearS(h,h_sev, &j,&k,strat);
4078 for (j=0; j<=
k; j++)
4080 const int iCompSj =
pGetComp(strat->
S[j]);
4081 if ((iCompH==iCompSj)
4092 for (j=0; j<=
k; j++)
4094 const int iCompSj =
pGetComp(strat->
S[j]);
4095 if ((iCompH==iCompSj)
4133 clearS(h,h_sev,&j,&k,strat);
4150 int new_suc=strat->
sl+1;
4154 for (; i<=strat->
sl; i++)
4159 if (new_suc > at) new_suc = at;
4162 sev = strat->
sevS[
i];
4165 for (j=i; j>=at+1; j--)
4167 strat->
S[
j] = strat->
S[j-1];
4174 strat->
sevS[at] = sev;
4175 strat->
S_2_R[at] = s2r;
4178 for (j=i; j>=at+1; j--)
4182 strat->
fromQ[at]=fq;
4186 if (new_suc <= strat->sl) *suc=new_suc;
4200 if(length==-1)
return 0;
4219 || ((o==oo) && (
pLmCmp(
set[length],p)!= cmp_int)))
4242 if (
pLmCmp(
set[length],p)== -cmp_int)
4250 if (cmp == cmp_int)
return an;
4251 if (cmp == -cmp_int)
return en;
4257 if (cmp == cmp_int) en =
i;
4258 else if (cmp == -cmp_int) an =
i;
4268 if (
pLmCmp(
set[length],p)== -cmp_int)
4275 if (
pLmCmp(
set[an],p) == cmp_int)
return an;
4276 if (
pLmCmp(
set[an],p) == -cmp_int)
return en;
4278 && ((strat->
ecartS[an])>ecart_p))
4283 if (
pLmCmp(
set[i],p) == cmp_int) en=i;
4284 else if (
pLmCmp(
set[i],p) == -cmp_int) an=i;
4288 &&((strat->
ecartS[
i])<ecart_p))
4315 if (length==-1)
return 0;
4317 if (
pLmCmp(
set[length].p,p.p)!=
currRing->OrdSgn)
return length+1;
4346 if (
set[length].length<p.length)
4357 if (
set[an].length>p.length)
return an;
4361 if (
set[i].length>p.length) en=
i;
4390 if (length==-1)
return 0;
4392 int o = p.GetpFDeg();
4393 int op =
set[
length].GetpFDeg();
4396 || ((op == o) && (
pLmCmp(
set[length].p,p.p) !=
currRing->OrdSgn)))
4407 op=
set[an].GetpFDeg();
4414 op =
set[
i].GetpFDeg();
4430 if (length==-1)
return 0;
4431 int o = p.GetpFDeg();
4432 int op =
set[
length].GetpFDeg();
4437 if ((op < o) || (
pLmCmp(
set[length].p,p.p)== -cmp_int))
4444 op =
set[an].GetpFDeg();
4445 if (op > o)
return an;
4446 if (op < 0)
return en;
4447 cmp =
pLmCmp(
set[an].p,p.p);
4448 if (cmp == cmp_int)
return an;
4449 if (cmp == -cmp_int)
return en;
4454 op =
set[
i].GetpFDeg();
4456 else if (op < o) an =
i;
4459 cmp =
pLmCmp(
set[i].p,p.p);
4460 if (cmp == cmp_int) en =
i;
4461 else if (cmp == -cmp_int) an =
i;
4507 if (length==-1)
return 0;
4509 int o = p.GetpFDeg();
4510 int op =
set[
length].GetpFDeg();
4513 || (( op == o) && (
set[length].length<p.length))
4514 || (( op == o) && (
set[length].length == p.length)
4525 op =
set[an].GetpFDeg();
4527 || (( op == o) && (
set[an].length > p.length))
4528 || (( op == o) && (
set[an].length == p.length)
4534 op =
set[
i].GetpFDeg();
4536 || (( op == o) && (
set[i].length > p.length))
4537 || (( op == o) && (
set[i].length == p.length)
4552 if (length==-1)
return 0;
4554 int o = p.GetpFDeg();
4581 int ol = p.GetpLength();
4582 if (length==-1)
return 0;
4586 int oo=
set[
length].ecart;
4587 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
4597 int oo=
set[an].ecart;
4599 || ((oo==op) && (
set[an].
pLength > ol)))
4604 int oo=
set[
i].ecart;
4606 || ((oo == op) && (
set[i].
pLength > ol)))
4638 if (length==-1)
return 0;
4640 int o = p.GetpFDeg() + p.ecart;
4655 op =
set[an].GetpFDeg()+
set[an].ecart;
4662 op =
set[
i].GetpFDeg()+
set[
i].ecart;
4698 if (length==-1)
return 0;
4700 int o = p.GetpFDeg() + p.ecart;
4704 || (( op == o) && (
set[length].ecart > p.ecart))
4705 || (( op == o) && (
set[length].ecart==p.ecart)
4716 op =
set[an].GetpFDeg()+
set[an].ecart;
4718 || (( op == o) && (
set[an].ecart < p.ecart))
4719 || (( op == o) && (
set[an].ecart==p.ecart)
4725 op =
set[
i].GetpFDeg()+
set[
i].ecart;
4727 || (( op == o) && (
set[i].ecart < p.ecart))
4728 || (( op == o) && (
set[i].ecart == p.ecart)
4742 if (length==-1)
return 0;
4746 int o = p.GetpFDeg() + p.ecart;
4749 if (
pGetComp(
set[length].p)*cc < c)
4751 if (
pGetComp(
set[length].p)*cc == c)
4755 || ((op == o) && (
set[length].ecart > p.ecart))
4756 || ((op == o) && (
set[length].ecart==p.ecart)
4772 int op =
set[an].GetpFDeg()+
set[an].ecart;
4774 || ((op == o) && (
set[an].ecart < p.ecart))
4775 || ((op == o) && (
set[an].ecart==p.ecart)
4784 else if (
pGetComp(
set[i].p)*cc == c)
4786 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
4788 || ((op == o) && (
set[i].ecart < p.ecart))
4789 || ((op == o) && (
set[i].ecart == p.ecart)
4808 if (length==-1)
return 0;
4811 int op=p.GetpFDeg();
4813 if (
set[length].ecart < o)
4815 if (
set[length].ecart == o)
4817 int oo=
set[
length].GetpFDeg();
4818 if ((oo < op) || ((oo==op) && (
set[length].length < p.length)))
4829 if (
set[an].ecart > o)
4831 if (
set[an].ecart == o)
4833 int oo=
set[an].GetpFDeg();
4835 || ((oo==op) && (
set[an].length > p.length)))
4841 if (
set[i].ecart > o)
4843 else if (
set[i].ecart == o)
4845 int oo=
set[
i].GetpFDeg();
4847 || ((oo == op) && (
set[i].length > p.length)))
4865 if (length<0)
return 0;
4867 int d=p->GetpFDeg();
4868 int op=
set[
length].GetpFDeg();
4871 || ((op == d) && (p->p1!=
NULL)&&(
set[length].p1==
NULL))
4882 op=
set[an].GetpFDeg();
4884 || ((op == d) && (p->p1!=
NULL) && (
set[an].p1==
NULL))
4890 op=
set[
i].GetpFDeg();
4892 || ((op==d) && (p->p1!=
NULL) && (
set[i].p1==
NULL))
4908 if (length<0)
return 0;
4939 if (length<0)
return 0;
4963 if (length < 0)
return 0;
4964 if (
set[length].
FDeg > p->FDeg)
4966 if (
set[length].
FDeg == p->FDeg)
4967 if(
set[length].
GetpLength() > p->GetpLength())
4978 if (
set[an].
FDeg > p->FDeg)
4980 if(
set[an].
FDeg == p->FDeg)
4988 if(
nGreater(
set[an].p->coef, p->p->coef))
5007 if (
set[i].
FDeg > p->FDeg)
5011 if(
set[i].
FDeg == p->FDeg)
5019 if(
nGreater(
set[i].p->coef, p->p->coef))
5043 if (strat->
syzl==0)
return 0;
5048 int en= strat->
syzl-1;
5101 if (length<0)
return 0;
5103 int o = p->GetpFDeg();
5104 int op =
set[
length].GetpFDeg();
5107 || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
5116 op =
set[an].GetpFDeg();
5123 op =
set[
i].GetpFDeg();
5142 if (length < 0)
return 0;
5147 printf(
"\n----------------------\n");
5150 printf(
"\n----------------------\n");
5158 if (
pLmCmp(
set[an].p, p->p) == 1)
5160 if (
pLmCmp(
set[an].p, p->p) == -1)
5162 if (
pLmCmp(
set[an].p, p->p) == 0)
5192 if (
pLmCmp(
set[i].p, p->p) == 1)
5194 if (
pLmCmp(
set[i].p, p->p) == -1)
5196 if (
pLmCmp(
set[i].p, p->p) == 0)
5230 if (length < 0)
return 0;
5235 printf(
"\n----------------------\n");
5238 printf(
"\n----------------------\n");
5246 if (
set[an].
FDeg > p->FDeg)
5248 if (
set[an].FDeg < p->
FDeg)
5250 if (
set[an].FDeg == p->FDeg)
5280 if (
set[i].
FDeg > p->FDeg)
5282 if (
set[i].FDeg < p->
FDeg)
5284 if (
set[i].FDeg == p->FDeg)
5324 if (coeff == 0)
return -1;
5327 while (tmp % 2 == 0)
5346 if (length < 0)
return 0;
5348 int o = p->GetpFDeg();
5349 int op =
set[
length].GetpFDeg();
5351 if ((op > o) || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
5360 op =
set[an].GetpFDeg();
5361 if ((op > o) || ((op == o) && (
pLmCmp(
set[an].p,p->p) != -
currRing->OrdSgn)))
5366 op =
set[
i].GetpFDeg();
5367 if ((op > o) || ((op == o) && (
pLmCmp(
set[i].p,p->p) != -
currRing->OrdSgn)))
5422 if (length<0)
return 0;
5424 int o = p->GetpFDeg();
5425 int op =
set[
length].GetpFDeg();
5428 || ((op == o) && (
set[length].length >p->length))
5429 || ((op == o) && (
set[length].length <= p->length)
5439 op =
set[an].GetpFDeg();
5441 || ((op == o) && (
set[an].length >p->length))
5442 || ((op == o) && (
set[an].length <=p->length)
5448 op =
set[
i].GetpFDeg();
5450 || ((op == o) && (
set[i].length > p->length))
5451 || ((op == o) && (
set[i].length <= p->length)
5468 if (length<0)
return 0;
5470 int o = p->GetpFDeg();
5521 if (length<0)
return 0;
5523 int o = p->GetpFDeg() + p->ecart;
5527 || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
5536 op =
set[an].GetpFDeg() +
set[an].ecart;
5543 op =
set[
i].GetpFDeg() +
set[
i].ecart;
5561 if (length<0)
return 0;
5563 int o = p->GetpFDeg() + p->ecart;
5565 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
5566 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
5567 && (
set[length].ecart > p->ecart))
5568 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
5569 && (
set[length].ecart == p->ecart)
5579 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
5580 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
5581 && (
set[an].ecart > p->ecart))
5582 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
5583 && (
set[an].ecart == p->ecart)
5589 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
5590 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
5591 && (
set[i].ecart > p->ecart))
5592 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
5593 && (
set[i].ecart == p->ecart)
5609 if (length<0)
return 0;
5613 unsigned long c =
pGetComp(p->p)*cc;
5614 int o = p->GetpFDeg() + p->ecart;
5616 if (
pGetComp(
set[length].p)*cc > c)
5618 if (
pGetComp(
set[length].p)*cc == c)
5620 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
5621 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
5622 && (
set[length].ecart > p->ecart))
5623 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
5624 && (
set[length].ecart == p->ecart)
5639 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
5640 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
5641 && (
set[an].ecart > p->ecart))
5642 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
5643 && (
set[an].ecart == p->ecart)
5652 else if (
pGetComp(
set[i].p)*cc == c)
5654 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
5655 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
5656 && (
set[i].ecart > p->ecart))
5657 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
5658 && (
set[i].ecart == p->ecart)
5676 Print(
"syzygy criterion checks: ");
5679 for (
int k=0;
k<strat->
syzl;
k++)
5684 Print(
"checking with: %d / %d -- \n",
k,strat->
syzl);
5708 Print(
"--- syzygy criterion checks: ");
5717 min = strat->
syzIdx[comp-2];
5727 max = strat->
syzIdx[comp-1];
5729 for (
int k=min;
k<
max;
k++)
5732 Print(
"COMP %d/%d - MIN %d - MAX %d - SYZL %ld\n",comp,strat->
currIdx,min,max,strat->
syzl);
5733 Print(
"checking with: %d -- ",
k);
5751 PrintS(
"rewritten criterion checks: ");
5754 for(
int k = strat->
sl;
k>=start;
k--)
5758 Print(
"checking with: ");
5773 Print(
"ALL ELEMENTS OF S\n----------------------------------------\n");
5774 for(
int kk = 0; kk<strat->
sl+1; kk++)
5778 Print(
"------------------------------\n");
5806 for (
int ii=strat->
sl; ii>start; ii--)
5812 if (!(
pLmCmp(p1,p2) == 1))
5828 for (
int i=strat->
Bl; i>-1; i--) {
5835 if (
pLmCmp(lm,strat->
B[found].GetLmCurrRing()) == -1) {
5843 for (
int ii=strat->
sl; ii>-1; ii--)
5849 if (!(
pLmCmp(p1,p2) == 1))
5872 const unsigned long not_sev = ~L->sev;
5873 const unsigned long* sev = strat->
sevS;
5884 if (j > pos)
return NULL;
5885 #if defined(PDEBUG) || defined(PDIV_DEBUG) 5887 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
5898 if (!(sev[j] & not_sev) &&
5899 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]) &&
5915 if (strat->
tl < 0 || strat->
S_2_R[j] == -1)
5917 T->Set(strat->
S[j], r, strat->
tailRing);
5925 return strat->
S_2_T(j);
5933 if (j > pos)
return NULL;
5935 #if defined(PDEBUG) || defined(PDIV_DEBUG) 5936 t = strat->
S_2_T(j);
5939 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
5950 if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
5952 t = strat->
S_2_T(j);
5953 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[j]);
6007 if (With ==
NULL)
break;
6017 return redtail(L, pos, strat);
6023 if (hn ==
NULL)
goto all_done;
6044 return redtail(&L, pos, strat);
6049 #define REDTAIL_CANONICALIZE 100 6053 p = h = L->GetLmTailRing();
6055 return L->GetLmCurrRing();
6062 Ln.pLength = L->GetpLength() - 1;
6086 Ln.SetShortExpVector();
6092 With = &(strat->
T[
j]);
6097 if (With ==
NULL)
break;
6124 pNext(h) = Ln.LmExtractAndIter();
6127 }
while (!Ln.IsNull());
6130 if (Ln.IsNull())
goto all_done;
6131 if (! withT) With_s.Init(
currRing);
6133 pNext(h) = Ln.LmExtractAndIter();
6152 return L->GetLmCurrRing();
6162 p = h = L->GetLmTailRing();
6164 return L->GetLmCurrRing();
6171 Ln.pLength = L->GetpLength() - 1;
6184 Ln.SetShortExpVector();
6186 if (With ==
NULL)
break;
6196 poly p_Ln=Ln.GetLmCurrRing();
6197 poly p_With=With->GetLmCurrRing();
6209 if (Ln.bucket!=
NULL)
6240 pNext(h) = Ln.LmExtractAndIter();
6243 }
while (!Ln.IsNull());
6246 if (Ln.IsNull())
goto all_done;
6249 pNext(h) = Ln.LmExtractAndIter();
6267 return L->GetLmCurrRing();
6283 if (strat->
Ll != *reduc)
6285 if (strat->
Ll != *reduc-1)
6297 if (red_result == 0)
6299 else if (red_result < 0)
6301 if ((red_result > 0) || ((strat->
Ll % 100)==99))
6303 if (strat->
Ll != *reduc && strat->
Ll > 0)
6320 Print(
"product criterion:%d chain criterion:%d\n",strat->
cp,strat->
c3);
6321 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
6323 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
6338 for (i=0; i<=strat->
sl; i++)
6348 for (i=0; i<=strat->
tl; i++)
6352 Print(
" o:%ld e:%d l:%d",
6353 strat->
T[i].pFDeg(),strat->
T[
i].ecart,strat->
T[
i].length);
6358 for (i=strat->
Ll; i>=0; i--)
6367 Print(
" o:%ld e:%d l:%d",
6368 strat->
L[i].pFDeg(),strat->
L[
i].ecart,strat->
L[
i].length);
6390 strat->
S=strat->
Shdl->m;
6395 memset(strat->
fromQ,0,i*
sizeof(
int));
6401 h.p =
pCopy(Q->m[i]);
6422 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
6425 strat->
enterS(h,pos,strat,-1);
6426 strat->
fromQ[pos]=1;
6436 h.p =
pCopy(F->m[i]);
6465 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
6467 strat->
enterS(h,pos,strat,-1);
6493 strat->
S=strat->
Shdl->m;
6498 memset(strat->
fromQ,0,i*
sizeof(
int));
6504 h.p =
pCopy(Q->m[i]);
6525 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
6528 strat->
enterS(h,pos,strat,-1);
6529 strat->
fromQ[pos]=1;
6539 h.p =
pCopy(F->m[i]);
6562 pos = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
6592 strat->
S = strat->
Shdl->m;
6605 memset(strat->
fromQ,0,i*
sizeof(
int));
6611 h.p =
pCopy(Q->m[i]);
6632 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
6635 strat->
enterS(h,pos,strat,-1);
6636 strat->
fromQ[pos]=1;
6646 h.p =
pCopy(F->m[i]);
6747 for(i=1; i<=strat->
sl; i++)
6763 #if defined(DEBUGF5) || defined(DEBUGF51) 6764 PrintS(
"------------- GENERATING SYZ RULES NEW ---------------\n");
6771 while (i <= strat->sl)
6783 diff = comp - comp_old - 1;
6801 for (k = 0; k<
i; k++)
6824 diff = comp - comp_old - 1;
6841 for (k = 0; k<strat->
sl+1; k++)
6858 PrintS(
"Principal syzygies:\n");
6861 Print(
"ps %d\n",ps);
6862 PrintS(
"--------------------------------\n");
6863 for(i=0;i<=strat->
syzl-1;i++)
6872 PrintS(
"--------------------------------\n");
6894 strat->
S=strat->
Shdl->m;
6900 memset(strat->
fromQ,0,i*
sizeof(
int));
6906 h.p =
pCopy(Q->m[i]);
6927 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
6930 strat->
enterS(h,pos,strat, strat->
tl+1);
6932 strat->
fromQ[pos]=1;
6943 h.p =
pCopy(F->m[i]);
6958 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
6960 strat->
enterS(h,pos,strat, strat->
tl+1);
7002 h.is_normalized = 0;
7007 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
7009 strat->
enterS(h,pos,strat, strat->
tl+1);
7017 strat->
enterS(h,0,strat, strat->
tl+1);
7039 strat->
S=strat->
Shdl->m;
7045 memset(strat->
fromQ,0,i*
sizeof(
int));
7051 h.p =
pCopy(Q->m[i]);
7072 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
7075 strat->
enterS(h,pos,strat, strat->
tl+1);
7077 strat->
fromQ[pos]=1;
7088 h.p =
pCopy(F->m[i]);
7103 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
7105 strat->
enterS(h,pos,strat, strat->
tl+1);
7147 h.is_normalized = 0;
7152 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
7154 strat->
enterS(h,pos,strat, strat->
tl+1);
7162 strat->
enterS(h,0,strat, strat->
tl+1);
7177 while (j <= maxIndex)
7194 if (!
pIsVector((*p).p) && ((*p).ecart != 0))
7203 h1 = r =
pCopy((*p).p);
7256 while ((j <= strat->sl) && (
pGetComp(strat->
S[j])!=0)) j++;
7258 while (j<=strat->sl)
7282 while (j <= maxIndex)
7331 while (j <= maxIndex);
7361 while (i<=strat->sl)
7370 redSi =
pHead(strat->
S[i]);
7371 strat->
S[
i] =
redBba(strat->
S[i],i-1,strat);
7374 if (
pCmp(redSi,strat->
S[i])!=0)
7387 if (strat->
S[i]==
NULL)
7395 if (strat->
S[i]==
NULL)
7413 DENOMINATOR_LIST=denom;
7432 if (any_change)
reorderS(&suc,strat);
7437 for (i=0; i<=strat->
sl; i++)
7458 h.sev = strat->
sevS[
i];
7471 while (i<=strat->sl)
7476 redSi=
pHead((strat->
S)[i]);
7483 else if (
pCmp((strat->
S)[i],redSi)!=0)
7500 DENOMINATOR_LIST=denom;
7515 strat->
sevS[
i] = h.sev;
7525 if (any_change)
reorderS(&suc,strat);
7526 else { suc=-1;
break; }
7537 for (i=0; i<=strat->
sl; i++)
7541 strat->
S[
i] = h.p =
redtail(strat->
S[i],strat->
sl,strat);
7545 strat->
sevS[
i] = h.sev;
7551 h.sev = strat->
sevS[
i];
7552 h.length = h.pLength =
pLength(h.p);
7561 if (suc!= -1)
updateS(toT,strat);
7582 *
sizeof(
unsigned long));
7609 strat->
Shdl->m=strat->
S;
7611 if (atS <= strat->sl)
7613 #ifdef ENTER_USE_MEMMOVE 7615 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
7616 (strat->
sl - atS + 1)*
sizeof(
poly));
7617 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
7618 (strat->
sl - atS + 1)*
sizeof(
int));
7619 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
7620 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
7621 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
7622 (strat->
sl - atS + 1)*
sizeof(
int));
7624 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
7625 (strat->
sl - atS + 1)*
sizeof(
int));
7627 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
7630 for (i=strat->
sl+1; i>=atS+1; i--)
7632 strat->
S[
i] = strat->
S[i-1];
7638 for (i=strat->
sl+1; i>=atS+1; i--)
7641 for (i=strat->
sl+1; i>=atS+1; i--)
7647 #ifdef ENTER_USE_MEMMOVE 7648 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
7649 (strat->
sl - atS + 1)*
sizeof(
int));
7651 for (i=strat->
sl+1; i>=atS+1; i--)
7656 strat->
fromQ[atS]=0;
7660 strat->
S[atS] = p.p;
7666 strat->
sevS[atS] = p.sev;
7667 strat->
ecartS[atS] = p.ecart;
7668 strat->
S_2_R[atS] = atR;
7685 *
sizeof(
unsigned long));
7689 *
sizeof(
unsigned long));
7717 strat->
Shdl->m=strat->
S;
7722 if (atS <= strat->sl)
7724 #ifdef ENTER_USE_MEMMOVE 7726 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
7727 (strat->
sl - atS + 1)*
sizeof(
poly));
7728 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
7729 (strat->
sl - atS + 1)*
sizeof(
int));
7730 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
7731 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
7732 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
7733 (strat->
sl - atS + 1)*
sizeof(
int));
7735 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
7736 (strat->
sl - atS + 1)*
sizeof(
int));
7738 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
7741 for (i=strat->
sl+1; i>=atS+1; i--)
7743 strat->
S[
i] = strat->
S[i-1];
7749 for (i=strat->
sl+1; i>=atS+1; i--)
7752 for (i=strat->
sl+1; i>=atS+1; i--)
7758 #ifdef ENTER_USE_MEMMOVE 7759 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
7760 (strat->
sl - atS + 1)*
sizeof(
int));
7762 for (i=strat->
sl+1; i>=atS+1; i--)
7767 strat->
fromQ[atS]=0;
7771 strat->
S[atS] = p.p;
7772 strat->
sig[atS] = p.sig;
7778 strat->
sevS[atS] = p.sev;
7788 strat->
sevSig[atS] = p.sevSig;
7790 strat->
ecartS[atS] = p.ecart;
7791 strat->
S_2_R[atS] = atR;
7795 Print(
"--- LIST S: %d ---\n",strat->
sl);
7796 for(k=0;k<=strat->
sl;k++)
7800 Print(
"--- LIST S END ---\n");
7816 assume(p.FDeg == p.pFDeg());
7821 for(i=strat->
tl;i>=0;i--)
7823 if (p.p==strat->
T[i].p)
7825 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
7831 #ifdef HAVE_TAIL_RING 7834 p.t_p=p.GetLmTailRing();
7839 atT = strat->
posInT(strat->
T, strat->
tl, p);
7840 if (strat->
tl == strat->
tmax-1)
7842 if (atT <= strat->tl)
7844 #ifdef ENTER_USE_MEMMOVE 7845 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
7847 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
7848 (strat->
tl-atT+1)*
sizeof(
unsigned long));
7850 for (i=strat->
tl+1; i>=atT+1; i--)
7852 #ifndef ENTER_USE_MEMMOVE 7853 strat->
T[
i] = strat->
T[i-1];
7856 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
7870 printf(
"\nenterT: add in position %i\n",atT);
7878 strat->
T[atT].max =
NULL;
7881 strat->
R[strat->
tl] = &(strat->
T[atT]);
7882 strat->
T[atT].i_r = strat->
tl;
7900 assume(p.FDeg == p.pFDeg());
7905 for(i=strat->
tl;i>=0;i--)
7907 if (p.p==strat->
T[i].p)
7909 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
7915 #ifdef HAVE_TAIL_RING 7918 p.t_p=p.GetLmTailRing();
7923 atT = strat->
posInT(strat->
T, strat->
tl, p);
7924 if (strat->
tl == strat->
tmax-1)
7926 if (atT <= strat->tl)
7928 #ifdef ENTER_USE_MEMMOVE 7929 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
7931 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
7932 (strat->
tl-atT+1)*
sizeof(
unsigned long));
7934 for (i=strat->
tl+1; i>=atT+1; i--)
7936 #ifndef ENTER_USE_MEMMOVE 7937 strat->
T[
i] = strat->
T[i-1];
7940 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
7954 printf(
"\nenterT_strong: add in position %i\n",atT);
7962 strat->
T[atT].max =
NULL;
7965 strat->
R[strat->
tl] = &(strat->
T[atT]);
7966 strat->
T[atT].i_r = strat->
tl;
7974 printf(
"\nDas ist p:\n");
pWrite(p.p);
7976 for(i=strat->
tl;i>=0;i--)
7981 printf(
"\nFound one: %i\n",i);
pWrite(strat->
T[i].p);
8011 (strat->
syzmax)*
sizeof(
unsigned long),
8013 *
sizeof(
unsigned long));
8016 if (atT < strat->syzl)
8018 #ifdef ENTER_USE_MEMMOVE 8019 memmove(&(strat->
syz[atT+1]), &(strat->
syz[atT]),
8021 memmove(&(strat->
sevSyz[atT+1]), &(strat->
sevSyz[atT]),
8022 (strat->
syzl-atT+1)*
sizeof(
unsigned long));
8024 for (i=strat->
syzl; i>=atT+1; i--)
8026 #ifndef ENTER_USE_MEMMOVE 8027 strat->
syz[
i] = strat->
syz[i-1];
8034 strat->
syz[atT] = p.sig;
8035 strat->
sevSyz[atT] = p.sevSig;
8038 Print(
"element in strat->syz: %d--%d ",atT+1,strat->
syzmax);
8046 strat->
L[cc].sig, ~strat->
L[cc].sevSig,
currRing))
8054 PrintS(
"--- Syzygies ---\n");
8057 PrintS(
"--------------------------------\n");
8058 for(i=0;i<=strat->
syzl-1;i++)
8063 PrintS(
"--------------------------------\n");
8101 #ifdef HAVE_RATGRING 8149 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
8150 else PrintS(
"ideal/module is not homogeneous\n");
8181 #ifdef HAVE_RATGRING 8222 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
8223 else PrintS(
"ideal/module is not homogeneous\n");
8711 reduction_found=
TRUE;
8742 reduction_found=
TRUE;
8756 if ( reduction_found)
8820 for (i=strat->
sl; i>=low; i--)
8822 int end_pos=strat->
sl;
8824 if (strat->
ak==0) end_pos=i-1;
8826 if ((T_j !=
NULL)&&(T_j->p==strat->
S[i]))
8832 Print(
"test S[%d]:",i);
8844 Print(
"to (tailR) S[%d]:",i);
8867 Print(
"test S[%d]:",i);
8873 strat->
S[
i] =
redtailBba(strat->
S[i], end_pos, strat, withT);
8887 DENOMINATOR_LIST=denom;
8900 Print(
"to (-tailR) S[%d]:",i);
8949 if (j < strat->
HCord)
8995 assume(L->i_r1 >= -1 && L->i_r1 <= strat->
tl);
8996 assume(L->i_r2 >= -1 && L->i_r2 <= strat->
tl);
9002 if ((L->i_r1 == -1) || (L->i_r2 == -1) )
9006 poly p1_max = (strat->
R[L->i_r1])->
max;
9007 poly p2_max = (strat->
R[L->i_r2])->
max;
9033 poly p1_max = (strat->
R[atR])->
max;
9057 ideal monred =
idInit(1,1);
9058 for(
int i=0; i<
idElem(F); i++)
9064 if((posconst != -1) && (!
nIsZero(F->m[posconst]->coef)))
9066 pmon =
pCopy(F->m[posconst]);
9075 for(
int i=0; i<idelemQ; i++)
9083 if((posconst != -1) && (!
nIsZero(monred->m[posconst]->coef)))
9085 pmon =
pCopy(monred->m[posconst]);
9099 for(
int i = 0, j = 0; i<
IDELEMS(F); i++)
9100 II->m[j++] =
prMapR(F->m[i], nMap, origR, QQ_ring);
9101 for(
int i = 0, j =
IDELEMS(F); i<idelemQ; i++)
9102 II->m[j++] =
prMapR(Q->m[i], nMap, origR, QQ_ring);
9108 for(
int i =
IDELEMS(II)-1; i>=0; i--)
9109 if(II->m[i] !=
NULL)
9110 II->m[i+1] = II->m[
i];
9114 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
9120 integer =
pHead(syz->m[i]);
9128 pmon =
prMapR(integer, nMap2, QQ_ring, origR);
9143 for(
int i = 0; i<
IDELEMS(one); i++)
9147 if(mindegmon ==
NULL)
9148 mindegmon = one->m[
i];
9151 if(
p_Deg(one->m[i], QQ_ring) <
p_Deg(mindegmon, QQ_ring))
9152 mindegmon = one->m[i];
9156 if(mindegmon !=
NULL)
9158 for(
int i =
IDELEMS(II)-1; i>=0; i--)
9159 if(II->m[i] !=
NULL)
9160 II->m[i+1] = II->m[
i];
9161 II->m[0] = mindegmon;
9164 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
9191 pmon =
prMapR(mindegmon, nMap2, QQ_ring, origR);
9225 poly pH = h->GetP();
9229 for(
int i = 0; i<=strat->
sl; i++)
9295 for(
int j = 0; j<=strat->
sl; j++)
9299 for(
int i = 0; i<=strat->
sl; i++)
9301 if((i != j) && (strat->
S[i] !=
NULL))
9362 if (expbound == 0) expbound = strat->
tailRing->bitmask << 1;
9383 new_tailRing->pFDeg =
currRing->pFDeg;
9384 new_tailRing->pLDeg =
currRing->pLDeg;
9388 Print(
"[%lu:%d", (
unsigned long) new_tailRing->bitmask, new_tailRing->ExpL_Size);
9397 for (i=0; i<=strat->
tl; i++)
9399 strat->
T[
i].ShallowCopyDelete(new_tailRing, new_tailBin,
9400 p_shallow_copy_delete);
9402 for (i=0; i<=strat->
Ll; i++)
9406 strat->
L[
i].ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
9408 if ((strat->
P.t_p !=
NULL) ||
9410 strat->
P.ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
9412 if ((L !=
NULL) && (L->tailRing != new_tailRing))
9415 L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
9421 L->tailRing = new_tailRing;
9428 if ((T !=
NULL) && (T->tailRing != new_tailRing && T->i_r < 0))
9429 T->ShallowCopyDelete(new_tailRing, new_tailBin, p_shallow_copy_delete);
9462 unsigned long l = 0;
9468 for (i=0; i<= strat->
Ll; i++)
9472 for (i=0; i<=strat->
tl; i++)
9498 res->order = (
int *)
omAlloc0((n+1)*
sizeof(int));
9499 res->block0 = (
int *)
omAlloc0((n+1)*
sizeof(int));
9500 res->block1 = (
int *)
omAlloc0((n+1)*
sizeof(int));
9501 int **wvhdl = (
int **)
omAlloc0((n+1)*
sizeof(
int*));
9503 for (
int i=1; i<n; i++)
9505 res->order[
i] = r->order[i-1];
9506 res->block0[
i] = r->block0[i-1];
9507 res->block1[
i] = r->block1[i-1];
9508 res->wvhdl[
i] = r->wvhdl[i-1];
9514 for (
int i=
rBlocks(res); i>0; --
i) {
9526 WarnS(
"error in nc_rComplete");
9544 res->order = (
int *)
omAlloc0((n+2)*
sizeof(int));
9545 res->block0 = (
int *)
omAlloc0((n+2)*
sizeof(int));
9546 res->block1 = (
int *)
omAlloc0((n+2)*
sizeof(int));
9547 int **wvhdl = (
int **)
omAlloc0((n+2)*
sizeof(
int*));
9549 for (
int i=2; i<n+2; i++)
9551 res->order[
i] = r->order[i-2];
9552 res->block0[
i] = r->block0[i-2];
9553 res->block1[
i] = r->block1[i-2];
9554 res->wvhdl[
i] = r->wvhdl[i-2];
9560 res->wvhdl[0] = (
int *)
omAlloc(res->N*
sizeof(
int));
9561 for (
int i=0; i<res->N; ++
i)
9562 res->wvhdl[0][i] = 1;
9566 res->wvhdl[1] =
NULL;
9568 for (
int i=
rBlocks(res); i>1; --
i) {
9580 WarnS(
"error in nc_rComplete");
9717 #ifdef HAVE_TAIL_BIN 9729 if (tailBin !=
NULL)
9733 if (t_kHEdge !=
NULL)
9735 if (t_kNoether !=
NULL)
9744 Timings
for the different possibilities of posInT:
9745 T15 EDL DL EL L 1-2-3
9746 Gonnet 43.26 42.30 38.34 41.98 38.40 100.04
9747 Hairer_2_1 1.11 1.15 1.04 1.22 1.08 4.7
9748 Twomat3 1.62 1.69 1.70 1.65 1.54 11.32
9749 ahml 4.48 4.03 4.03 4.38 4.96 26.50
9750 c7 15.02 13.98 15.16 13.24 17.31 47.89
9751 c8 505.09 407.46 852.76 413.21 499.19 n/
a 9752 f855 12.65 9.27 14.97 8.78 14.23 33.12
9753 gametwo6 11.47 11.35 14.57 11.20 12.02 35.07
9754 gerhard_3 2.73 2.83 2.93 2.64 3.12 6.24
9755 ilias13 22.89 22.46 24.62 20.60 23.34 53.86
9756 noon8 40.68 37.02 37.99 36.82 35.59 877.16
9757 rcyclic_19 48.22 42.29 43.99 45.35 51.51 204.29
9758 rkat9 82.37 79.46 77.20 77.63 82.54 267.92
9759 schwarz_11 16.46 16.81 16.76 16.81 16.72 35.56
9760 test016 16.39 14.17 14.40 13.50 14.26 34.07
9761 test017 34.70 36.01 33.16 35.48 32.75 71.45
9762 test042 10.76 10.99 10.27 11.57 10.45 23.04
9763 test058 6.78 6.75 6.51 6.95 6.22 9.47
9764 test066 10.71 10.94 10.76 10.61 10.56 19.06
9765 test073 10.75 11.11 10.17 10.79 8.63 58.10
9766 test086 12.23 11.81 12.88 12.24 13.37 66.68
9767 test103 5.05 4.80 5.47 4.64 4.89 11.90
9768 test154 12.96 11.64 13.51 12.46 14.61 36.35
9769 test162 65.27 64.01 67.35 59.79 67.54 196.46
9770 test164 7.50 6.50 7.68 6.70 7.96 17.13
9771 virasoro 3.39 3.50 3.35 3.47 3.70 7.66
9781 if (length==-1)
return 0;
9784 int op=p.GetpFDeg();
9785 int ol = p.GetpLength();
9787 if (
set[length].ecart < o)
9789 if (
set[length].ecart == o)
9791 int oo=
set[
length].GetpFDeg();
9792 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
9803 if (
set[an].ecart > o)
9805 if (
set[an].ecart == o)
9807 int oo=
set[an].GetpFDeg();
9809 || ((oo==op) && (
set[an].
pLength > ol)))
9815 if (
set[i].ecart > o)
9817 else if (
set[i].ecart == o)
9819 int oo=
set[
i].GetpFDeg();
9821 || ((oo == op) && (
set[i].
pLength > ol)))
9835 if (length==-1)
return 0;
9837 int op=p.GetpFDeg();
9838 int ol = p.GetpLength();
9840 int oo=
set[
length].GetpFDeg();
9841 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
9851 int oo=
set[an].GetpFDeg();
9853 || ((oo==op) && (
set[an].
pLength > ol)))
9858 int oo=
set[
i].GetpFDeg();
9860 || ((oo == op) && (
set[i].
pLength > ol)))
9871 int ol = p.GetpLength();
9874 if (
set[length].length<p.length)
9885 if (
set[an].
pLength>ol)
return an;
9906 if (strat->
red==redFirst)
PrintS(
"redFirst\n");
9908 else if (strat->
red==redEcart)
PrintS(
"redEcart\n");
9910 else Print(
"%p\n",(
void*)strat->
red);
9922 #ifdef HAVE_MORE_POS_IN_T 9944 else if (strat->
enterS==enterSMora)
PrintS(
"enterSMora\n");
9945 else if (strat->
enterS==enterSMoraNF)
PrintS(
"enterSMoraNF\n");
9951 PrintS(
"initEcartPair: ");
9955 Print(
"homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
9957 Print(
"honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
9963 Print(
"posInLDependsOnLength=%d\n",
9995 PrintS(
"currRing->pFDeg: ");
10010 PrintS(
"ecartWeights: ");
10017 #ifndef SING_NDEBUG 10023 #ifdef HAVE_SHIFTBBA 10037 #ifdef HAVE_SHIFTBBA 10054 #ifdef HAVE_SHIFTBBA 10146 #ifdef HAVE_SHIFTBBA 10156 for (i=0; i<=strat->
sl; i++)
10158 memset(&h,0,
sizeof(h));
10161 h.sev = strat->
sevS[
i];
10175 #ifdef HAVE_SHIFTBBA 10256 #ifdef HAVE_SHIFTBBA 10296 qfromQ = strat->
fromQ[
i];
10308 enterOnePairShift(qq, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, 0, i, uptodeg, lV);
10310 for (j=1; j<= toInsert; j++)
10325 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, i, uptodeg, lV);
10330 #ifdef HAVE_SHIFTBBA 10372 for (; j<= toInsert; j++)
10389 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, -1, uptodeg, lV);
10394 #ifdef HAVE_SHIFTBBA 10398 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)
10422 int qfromQ = qisFromQ;
10431 Lp.ecart=0; Lp.length=0;
10440 if (!
isInV(Lp.lcm, lV))
10445 PrintS(
"V crit applied to q = ");
10461 if((!((ecartq>0)&&(ecart>0)))
10484 Lp.ecart =
si_max(ecart,ecartq);
10485 if (strat->
fromT && (ecartq>ecart))
10503 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
10508 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
10552 if (strat->
fromT && (ecartq>ecart))
10565 for(j = strat->
Bl;j>=0;j--)
10567 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
10571 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
10595 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (qfromQ!=0))
10662 if ( (atR >= 0) && (shiftcount==0) && (ifromS >=0) )
10681 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
10687 #ifdef HAVE_SHIFTBBA 10702 if ( (!strat->
fromT)
10711 clearS(h,h_sev, &j,&k,strat);
10720 #ifdef HAVE_SHIFTBBA 10741 for (j=0; j<=
k; j++)
10743 if (!strat->
fromQ[j])
10756 for (j=0; j<=
k; j++)
10769 for (j=0; j<=
k; j++)
10794 #ifdef HAVE_SHIFTBBA 10814 atT = strat->
posInT(strat->
T, strat->
tl, p);
10821 for (i=1; i<=toInsert; i++)
10832 atT = strat->
posInT(strat->
T, strat->
tl, qq);
10841 #ifdef HAVE_SHIFTBBA 10848 p = h = L->GetLmTailRing();
10850 return L->GetLmCurrRing();
10857 Ln.pLength = L->GetpLength() - 1;
10865 while(!Ln.IsNull())
10869 Ln.SetShortExpVector();
10875 With = &(strat->
T[
j]);
10880 if (With ==
NULL)
break;
10896 pNext(h) = Ln.LmExtractAndIter();
10899 }
while (!Ln.IsNull());
10902 if (Ln.IsNull())
goto all_done;
10903 if (! withT) With_s.Init(
currRing);
10905 pNext(h) = Ln.LmExtractAndIter();
10920 return L->GetLmCurrRing();
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
#define TEST_OPT_INFREDTAIL
#define pSetmComp(p)
TODO:
void initEcartPairBba(LObject *Lp, poly, poly, int, int)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
int getIndexRng(long coeff)
int posInL11(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
denominator_list_s * denominator_list
int posInT_pLength(const TSet set, const int length, LObject &p)
#define omRealloc0Size(addr, o_size, size)
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
unsigned long p_GetMaxExpL(poly p, const ring r, unsigned long l_max)
return the maximal exponent of p in form of the maximal long var
static FORCE_INLINE number n_IntMod(number a, number b, const coeffs r)
for r a field, return n_Init(0,r) always: n_Div(a,b,r)*b+n_IntMod(a,b,r)==a n_IntMod(a,b,r) >=0
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
KINLINE TObject ** initR()
const CanonicalForm int s
int posInTrg0(const TSet set, const int length, LObject &p)
void omMergeStickyBinIntoBin(omBin sticky_bin, omBin into_bin)
void initSbaPos(kStrategy strat)
poly redtail(LObject *L, int pos, kStrategy strat)
void enterOnePairShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS, int, int lV)
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
void enterSSba(LObject &p, int atS, kStrategy strat, int atR)
int posInL17(const LSet set, const int length, LObject *p, const kStrategy)
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
int itoInsert(poly p, int uptodeg, int lV, const ring r)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
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
#define idDelete(H)
delete an ideal
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<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 enterOnePairSig(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
poly prMoveR(poly &p, ring src_r, ring dest_r)
void reorderS(int *suc, kStrategy strat)
static int rGetCurrSyzLimit(const ring r)
void initenterstrongPairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
static BOOLEAN p_LmExpVectorAddIsOk(const poly p1, const poly p2, const ring r)
static poly pp_Mult_nn(poly p, number n, const ring r)
int posInL13(const LSet set, const int length, LObject *p, const kStrategy)
static BOOLEAN rIsRatGRing(const ring r)
#define TEST_OPT_CONTENTSB
BOOLEAN posInLDependsOnLength
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
int kFindInT(poly p, TSet T, int tlength)
returns index of p in TSet, or -1 if not found
int(* posInLSba)(const LSet set, const int length, LObject *L, const kStrategy strat)
#define omFreeSize(addr, size)
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)
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.
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:
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)
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)
#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)
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 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,...)
KINLINE long GetpFDeg() const
#define ALLOW_PROD_CRIT(A)
static poly p_Neg(poly p, const ring r)
static void p_LmDelete(poly p, const ring r)
BOOLEAN isInPairsetB(poly q, int *k, kStrategy strat)
long p_WTotaldegree(poly p, const ring r)
static poly redMora(poly h, int maxIndex, kStrategy strat)
void kMergeBintoL(kStrategy strat)
void p_wrp(poly p, ring lmRing, ring tailRing)
void p_Write(poly p, ring lmRing, ring tailRing)
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
int kFindDivisibleByInT(const kStrategy strat, const LObject *L, const int start)
return -1 if no divisor is found number of first divisor in T, otherwise
BOOLEAN newHEdge(kStrategy strat)
int posInT19(const TSet set, const int length, LObject &p)
poly redtailBbaShift(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
void initEcartNormal(TObject *h)
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r1, const ring r2)
static LSet initL(int nr=setmaxL)
static poly p_Add_q(poly p, poly q, const ring r)
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
int posInT_EcartpLength(const TSet set, const int length, LObject &p)
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
KINLINE poly kNoetherTail()
static BOOLEAN sugarDivisibleBy(int ecart1, int ecart2)
void enterOnePairManyShifts(int i, poly p, int ecart, int isFromQ, kStrategy strat, int, int uptodeg, int lV)
poly p_Cleardenom(poly p, const ring r)
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
void chainCritPart(poly p, int ecart, kStrategy strat)
void nKillChar(coeffs r)
undo all initialisations
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static poly p_Mult_q(poly p, poly q, const ring r)
void enterOnePairSelfShifts(poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int, int uptodeg, int lV)
void exitBuchMora(kStrategy strat)
pFDegProc pOrigFDeg_TailRing
#define ENTER_USE_MEMMOVE
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
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)