22 #define EXT_POLY_NEW 0 52 #define ENTER_USE_MEMMOVE 92 #ifdef ENTER_USE_MYMEMMOVE 93 inline void _my_memmove_d_gt_s(
unsigned long* d,
unsigned long*
s,
long l)
95 register unsigned long* _dl = (
unsigned long*) d;
96 register unsigned long* _sl = (
unsigned long*) s;
97 register long _i = l - 1;
107 inline void _my_memmove_d_lt_s(
unsigned long* d,
unsigned long*
s,
long l)
109 register long _ll =
l;
110 register unsigned long* _dl = (
unsigned long*) d;
111 register unsigned long* _sl = (
unsigned long*)
s;
112 register long _i = 0;
122 inline void _my_memmove(
void* d,
void*
s,
long l)
124 unsigned long _d = (
unsigned long) d;
125 unsigned long _s = (
unsigned long)
s;
126 unsigned long _l = ((
l) + SIZEOF_LONG - 1) >> LOG_SIZEOF_LONG;
128 if (_d > _s) _my_memmove_d_gt_s(_d, _s, _l);
129 else _my_memmove_d_lt_s(_d, _s, _l);
133 #define memmove(d,s,l) _my_memmove(d, s, l) 140 #define pDivComp_EQUAL 2 141 #define pDivComp_LESS 1 142 #define pDivComp_GREATER -1 143 #define pDivComp_INCOMP 0 155 unsigned long la, lb;
156 unsigned long divmask =
currRing->divmask;
157 for (i=0; i<
currRing->VarL_Size; i++)
166 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
173 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
203 unsigned long la, lb;
204 unsigned long divmask =
currRing->divmask;
205 for (i=0; i<
currRing->VarL_Size; i++)
214 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
221 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
228 if (b) {
return -1; }
249 poly p = L->GetLmTailRing();
252 if (L->bucket !=
NULL)
290 L->ecart = L->pLDeg() - L->GetpFDeg();
299 L->ecart = L->pLDeg(strat->
LDegLast) - L->GetpFDeg();
341 ring
r = L->tailRing;
342 poly p = L->GetLmTailRing();
347 printf(
"\n cancelunit\n");
374 number eins=
nCopy(lc);
404 if (i == r->N)
break;
415 printf(
"\nDoes not divide\n");
420 printf(
"\nDivides. Go On\n");
434 number eins=
nInit(1);
464 if (i == r->N)
break;
522 inline static unsigned long*
initsevS (
const int maxnr)
524 return (
unsigned long*)
omAlloc0(maxnr*
sizeof(
unsigned long));
528 return (
int*)
omAlloc0(maxnr*
sizeof(
int));
532 int &length,
const int incr)
537 assume((length+incr) > 0);
541 (length+incr)*
sizeof(
TObject));
543 sevT = (
unsigned long*)
omReallocSize(sevT, length*
sizeof(
long*),
544 (length+incr)*
sizeof(
long*));
547 (length+incr)*
sizeof(
TObject*));
548 for (i=length-1;i>=0;i--) R[T[i].i_r] = &(T[i]);
562 for (j=0; j<=strat->
tl; j++)
566 if (strat->
T[j].max_exp !=
NULL)
576 if (strat->
T[j].t_p !=
NULL)
587 if (p == strat->
S[i])
589 if (strat->
T[j].t_p !=
NULL)
613 for (j=0; j<=strat->
tl; j++)
617 if (strat->
T[j].max_exp !=
NULL)
627 if (strat->
T[j].t_p !=
NULL)
639 if (p == strat->
S[i])
641 if (strat->
T[j].t_p !=
NULL)
665 assume(((*length)+incr)>0);
668 ((*length)+incr)*
sizeof(
LObject));
688 if ((*k) < 0)
return FALSE;
689 if (((p1 == (*p).p1) && (p2 == (*p).p2))
690 || ((p1 == (*p).p2) && (p2 == (*p).p1)))
709 if ((*k) < 0)
return FALSE;
721 for (i=0; i<=tlength; i++)
723 if (T[i].p == p)
return i;
734 if (i >= 0)
return i;
737 while (strat !=
NULL);
750 #define kFalseReturn(x) do { if (!x) return FALSE;} while (0) 756 for (i=1; i<=tailRing->N; i++)
759 return "Lm[i] different";
762 return "Lm[0] different";
764 return "Lm.next different";
766 return "Lm.coeff different";
775 r_assume(strat_tailRing == tailRing);
785 if (
T->t_p ==
NULL &&
i > 0)
791 const char* msg = kTest_LmEqual(
T->p,
T->t_p,
T->tailRing);
802 if (
T->t_p !=
NULL &&
i >= 0 && TN ==
'T')
806 if (
T->max_exp !=
NULL)
807 return dReportError(
"%c[%d].max_exp is not NULL as it should be", TN,
i);
811 if (
T->max_exp ==
NULL)
823 p_Setm(test_max, tailRing);
835 if (
T->p ==
NULL &&
i > 0)
840 if ((
i >= 0) && (
T->pLength != 0)
845 return dReportError(
"%c[%d] pLength error: has %d, specified to have %d",
850 if (
i >= 0 && (TN ==
'T' || TN ==
'L'))
853 if (
T->FDeg !=
T->pFDeg())
857 return dReportError(
"%c[%d] FDeg error: has %d, specified to have %d",
858 TN,
i ,
T->pFDeg(), d);
863 if (
i >= 0 && TN ==
'T')
878 if (L->bucket !=
NULL)
880 kFalseReturn(
kbTest(L->bucket));
881 r_assume(L->bucket->bucket_ring == L->tailRing);
888 kFalseReturn(
kTest_T(L, strat_tailRing, lpos,
'L'));
897 return dReportError(
"L[%d] wrong sev: has %o, specified to have %o",
906 else if (tlength > 0 &&
T !=
NULL && (lpos >=0))
926 -1, strat->
T, strat->
tl));
929 if (strat->
T !=
NULL)
931 for (i=0; i<=strat->
tl; i++)
940 if (strat->
L !=
NULL)
942 for (i=0; i<=strat->
Ll; i++)
945 strat->
L[i].Next() != strat->
tail,
i,
946 strat->
T, strat->
tl));
957 if (strat->
S !=
NULL)
967 for (i=0; i<=strat->
sl; i++)
969 if (strat->
S[i] !=
NULL &&
972 return dReportError(
"S[%d] wrong sev: has %o, specified to have %o",
985 kFalseReturn(
kTest(strat));
988 for (i=0; i<=strat->
tl; i++)
990 if (strat->
T[i].i_r < 0 || strat->
T[i].i_r > strat->
tl)
991 return dReportError(
"strat->T[%d].i_r == %d out of bounds", i,
993 if (strat->
R[strat->
T[i].i_r] != &(strat->
T[i]))
997 if (strat->
S !=
NULL)
999 for (i=0; i<=strat->
sl; i++)
1004 if (strat->
S_2_R[i] != strat->
T[j].i_r)
1006 i, strat->
S_2_R[i], j, strat->
T[j].i_r);
1010 for (i=0; i<=strat->
Ll; i++)
1012 if (strat->
L[i].p1 !=
NULL && strat->
L[i].p2)
1014 if (strat->
L[i].i_r1 < 0 ||
1015 strat->
L[i].i_r1 > strat->
tl ||
1016 strat->
L[i].T_1(strat)->p != strat->
L[
i].p1)
1018 if (strat->
L[i].i_r2 < 0 ||
1019 strat->
L[i].i_r2 > strat->
tl ||
1020 strat->
L[i].T_2(strat)->p != strat->
L[
i].p2)
1025 if (strat->
L[i].i_r1 != -1)
1027 if (strat->
L[i].i_r2 != -1)
1030 if (strat->
L[i].i_r != -1)
1043 #ifdef ENTER_USE_MEMMOVE 1044 memmove(&(strat->
S[i]), &(strat->
S[i+1]), (strat->
sl - i)*
sizeof(
poly));
1045 memmove(&(strat->
ecartS[i]),&(strat->
ecartS[i+1]),(strat->
sl - i)*
sizeof(
int));
1046 memmove(&(strat->
sevS[i]),&(strat->
sevS[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1047 memmove(&(strat->
S_2_R[i]),&(strat->
S_2_R[i+1]),(strat->
sl - i)*
sizeof(
int));
1050 for (j=i; j<strat->
sl; j++)
1052 strat->
S[
j] = strat->
S[j+1];
1060 #ifdef ENTER_USE_MEMMOVE 1061 memmove(&(strat->
lenS[i]),&(strat->
lenS[i+1]),(strat->
sl - i)*
sizeof(
int));
1063 for (j=i; j<strat->
sl; j++) strat->
lenS[j] = strat->
lenS[j+1];
1068 #ifdef ENTER_USE_MEMMOVE 1071 for (j=i; j<strat->
sl; j++) strat->
lenSw[j] = strat->
lenSw[j+1];
1076 #ifdef ENTER_USE_MEMMOVE 1077 memmove(&(strat->
fromQ[i]),&(strat->
fromQ[i+1]),(strat->
sl - i)*
sizeof(
int));
1079 for (j=i; j<strat->
sl; j++)
1095 #ifdef ENTER_USE_MEMMOVE 1096 memmove(&(strat->
S[i]), &(strat->
S[i+1]), (strat->
sl - i)*
sizeof(
poly));
1097 memmove(&(strat->
sig[i]), &(strat->
sig[i+1]), (strat->
sl - i)*
sizeof(
poly));
1098 memmove(&(strat->
ecartS[i]),&(strat->
ecartS[i+1]),(strat->
sl - i)*
sizeof(
int));
1099 memmove(&(strat->
sevS[i]),&(strat->
sevS[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1100 memmove(&(strat->
sevSig[i]),&(strat->
sevSig[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1101 memmove(&(strat->
S_2_R[i]),&(strat->
S_2_R[i+1]),(strat->
sl - i)*
sizeof(
int));
1104 for (j=i; j<strat->
sl; j++)
1106 strat->
S[
j] = strat->
S[j+1];
1107 strat->
sig[
j] = strat->
sig[j+1];
1116 #ifdef ENTER_USE_MEMMOVE 1117 memmove(&(strat->
lenS[i]),&(strat->
lenS[i+1]),(strat->
sl - i)*
sizeof(
int));
1119 for (j=i; j<strat->
sl; j++) strat->
lenS[j] = strat->
lenS[j+1];
1124 #ifdef ENTER_USE_MEMMOVE 1127 for (j=i; j<strat->
sl; j++) strat->
lenSw[j] = strat->
lenSw[j+1];
1132 #ifdef ENTER_USE_MEMMOVE 1133 memmove(&(strat->
fromQ[i]),&(strat->
fromQ[i+1]),(strat->
sl - i)*
sizeof(
int));
1135 for (j=i; j<strat->
sl; j++)
1191 if (*length > 0 && j < *length)
1193 #ifdef ENTER_USE_MEMMOVE 1194 memmove(&(
set[j]), &(
set[j+1]), (*length - j)*
sizeof(
LObject));
1197 for (i=j; i < (*length); i++)
1202 memset(&(
set[*length]),0,
sizeof(
LObject));
1213 assume(p.FDeg == p.pFDeg());
1218 if (at <= (*length))
1220 memmove(&((*
set)[at+1]), &((*set)[at]), ((*length)-at+1)*
sizeof(
LObject));
1222 for (
i=(*length)+1;
i>=at+1;
i--) (*
set)[
i] = (*set)[
i-1];
1236 h->FDeg = h->pFDeg();
1237 h->ecart = h->pLDeg() - h->FDeg;
1239 h->length=h->pLength=
pLength(h->p);
1244 h->FDeg = h->pFDeg();
1246 h->length=h->pLength=
pLength(h->p);
1251 Lp->FDeg = Lp->pFDeg();
1258 Lp->FDeg = Lp->pFDeg();
1259 (*Lp).ecart =
si_max(ecartF,ecartG);
1260 (*Lp).ecart = (*Lp).ecart- (Lp->FDeg -
p_FDeg((*Lp).lcm,
currRing));
1269 return (ecart1 <= ecart2);
1300 int j,compare,compareCoeff;
1304 h.ecart=0; h.length=0;
1316 pLcm(p,strat->
S[i],h.lcm);
1325 for(j = strat->
Bl;j>=0;j--)
1330 printf(
"\nChainCrit in enteronepairring\n");
1336 printf(
"\nh - neue Paar\n");
1341 printf(
"\ncompare = %i\ncompareCoeff = %i\n",compare,compareCoeff);
1348 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1351 printf(
"\nGelöscht h\n");
1362 printf(
"\nGelöscht: B[j]\n");
1369 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1372 printf(
"\nGelöscht h\n");
1385 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1388 printf(
"\nGelöscht h\n");
1399 printf(
"\nGelöscht: B[j]\n");
1409 printf(
"\nTrying to add spair S[%i] und p\n",i);
pWrite(strat->
S[i]);
pWrite(p);
1481 printf(
"\nThis is afterwards:\n");
1484 h.i_r1 = -1;h.i_r2 = -1;
1494 h.i_r2 = strat->
S_2_R[
i];
1500 posx = strat->
posInL(strat->
B,strat->
Bl,&h,strat);
1505 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);
1576 PrintS(
"\n--- create strong gcd poly: ");
1577 Print(
"\n p: %d", i);
1579 Print(
"\n strat->S[%d]: ", i);
1603 h.i_r1 = -1;h.i_r2 = -1;
1609 h.p1 =
p;h.p2 = strat->
S[
i];
1613 h.i_r2 = strat->
S_2_R[
i];
1624 posx = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
1629 if(h.IsNull())
return FALSE;
1643 printf(
"\nThis strong poly was added to L:\n");
pWrite(h.p);
pWrite(h.p1);
pWrite(h.p2);
1650 if(strat->
sl < 0)
return FALSE;
1652 for(i=0;i<strat->
sl;i++)
1678 if(pairsig!=
NULL &&
pLtCmp(pairsig,h->sig) == 0)
1681 printf(
"\nCan replace * (sig = *) with * (sig = *) since of * with sig *\n");
1693 h->i_r1 = -1;h->i_r2 = -1;
1763 PrintS(
"\n--- create strong gcd poly: ");
1764 Print(
"\n p: %d", i);
1766 Print(
"\n strat->S[%d]: ", i);
1790 if(
pLmCmp(pSigMult,sSigMult) == 0)
1799 if(
pLtCmp(pSigMult,sSigMult)==1)
1819 h.i_r1 = -1;h.i_r2 = -1;
1825 printf(
"\nPossible sigdrop in enterpairstrongSig (due to lost of sig)\n");
1830 int red_result =
redRing(&h,strat);
1832 printf(
"\nAfter redRing reduce:\n");
pWrite(h.p);
1838 printf(
"\nCancel the sigdrop. It reduced to 0\n");
1847 printf(
"\nSigdrop. end\n");
1849 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1851 strat->
enterS(h,0,strat,strat->
tl);
1858 h.sig =
pNeg(h.sig);
1865 printf(
"\nSigDrop in enteronestrongpolySig\n");
1872 int red_result =
redRing(&h,strat);
1877 printf(
"\nCancel the sigdrop after redRing (=0)\n");
1886 printf(
"\nAfter redRing still sigdrop:\n");
pWrite(h.p);
1888 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1891 strat->
enterS(h,0,strat, strat->
tl+1);
1903 printf(
"\nSigDrop in strongpair\noriginals: ");
pWrite(sig);
pWrite(strat->
sig[i]);
1904 printf(
"\nnow: ");
pWrite(pairsig);
1908 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1909 strat->
enterS(h,strat->
sl+1,strat,strat->
tl+1);
1912 h.p1 =
p;h.p2 = strat->
S[
i];
1916 h.i_r2 = strat->
S_2_R[
i];
1946 Lp.ecart=0; Lp.length=0;
1951 #ifndef HAVE_RATGRING 1952 pLcm(p,strat->
S[i],Lp.lcm);
1953 #elif defined(HAVE_RATGRING) 1957 pLcm(p,strat->
S[i],Lp.lcm);
1964 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
2006 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2011 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2068 for(j = strat->
Bl;j>=0;j--)
2070 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2074 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2100 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2167 Lp.p1 = strat->
S[
i];
2181 Lp.i_r1 = strat->
S_2_R[
i];
2197 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2232 Lp.ecart=0; Lp.length=0;
2237 pLcm(p,strat->
S[i],Lp.lcm);
2242 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
2284 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2289 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2342 for(j = strat->
Bl;j>=0;j--)
2344 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2348 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2373 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2401 Lp.p1 = strat->
S[
i];
2408 Lp.i_r1 = strat->
S_2_R[
i];
2423 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2447 unsigned long pSigMultNegSev,sSigMultNegSev;
2451 Lp.ecart=0; Lp.length=0;
2456 #ifndef HAVE_RATGRING 2457 pLcm(p,strat->
S[i],Lp.lcm);
2458 #elif defined(HAVE_RATGRING) 2486 PrintS(
"----------------\n");
2489 PrintS(
"----------------\n");
2495 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2517 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2518 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2519 || strat->
rewCrit1(sSigMult,sSigMultNegSev,Lp.lcm,strat,i+1)
2543 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2597 Lp.sevSig = ~pSigMultNegSev;
2604 Lp.sevSig = ~sSigMultNegSev;
2615 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
2630 Lp.checked = strat->
sl+1;
2637 Lp.prod_crit =
TRUE;
2650 PrintS(
"SIGNATURE OF PAIR: ");
2654 Lp.p1 = strat->
S[
i];
2668 Lp.i_r1 = strat->
S_2_R[
i];
2697 printf(
"\nTrying to add p and S[%i]\n",i);
2727 unsigned long pSigMultNegSev,sSigMultNegSev;
2731 Lp.ecart=0; Lp.length=0;
2736 #ifndef HAVE_RATGRING 2737 pLcm(p,strat->
S[i],Lp.lcm);
2738 #elif defined(HAVE_RATGRING) 2754 printf(
"\nIn Spoly: m1, m2 :\n");
pWrite(m1);
pWrite(m2);
2775 if(pSigMult !=
NULL)
2778 if(sSigMult !=
NULL)
2782 Print(
"----------------\n");
2785 Print(
"----------------\n");
2789 if(pSigMult !=
NULL && sSigMult !=
NULL)
2798 if(pSigMult ==
NULL)
2800 if(sSigMult ==
NULL)
2810 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2820 printf(
"\nPossible sigdrop in enterpairSig (due to lost of sig)\n");
2835 int red_result =
redRing(&Lp,strat);
2837 printf(
"\nAfter redRing reduce:\n");
pWrite(Lp.p);
2843 printf(
"\nCancel the sigdrop. It reduced to 0\n");
2852 printf(
"\nSigdrop. end\n");
2854 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
2856 strat->
enterS(Lp,0,strat,strat->
tl);
2870 Lp.sig =
pCopy(pSigMult);
2900 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2901 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2907 printf(
"\nDELETED!\n");
2930 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2987 Lp.sig =
pNeg(Lp.sig);
2998 Lp.sevSig = ~pSigMultNegSev;
3005 Lp.sevSig = ~sSigMultNegSev;
3017 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
3021 printf(
"\nrewCrit3 deletes it!\n");
3035 Lp.checked = strat->
sl+1;
3042 Lp.prod_crit =
TRUE;
3055 PrintS(
"SIGNATURE OF PAIR: ");
3059 Lp.p1 = strat->
S[
i];
3074 Lp.i_r1 = strat->
S_2_R[
i];
3093 printf(
"\nSigDrop in enteronepairSig\n");
pWrite(Lp.sig);
3099 int red_result =
redRing(&Lp,strat);
3104 printf(
"\nCancel the sigdrop after redRing (=0)\n");
3113 printf(
"\nAfter redRing still sigdrop:\n");
pWrite(Lp.p);
3115 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
3118 strat->
enterS(Lp,0,strat, strat->
tl+1);
3124 printf(
"\nThis spair was added to B:\n");
3158 pLcm(p,strat->
S[i],Lp.lcm);
3179 Lp.p1 = strat->
S[
i];
3183 Lp.i_r1 = strat->
S_2_R[
i];
3198 l = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
3209 int j=strat->
Ll+strat->
Bl+1;
3219 for (i=strat->
Bl; i>=0; i--)
3221 j = strat->
posInL(strat->
L,j,&(strat->
B[i]),strat);
3232 int j=strat->
Ll+strat->
Bl+1;
3242 for (i=strat->
Bl; i>=0; i--)
3244 j = strat->
posInLSba(strat->
L,j,&(strat->
B[i]),strat);
3265 for (j=0; j<=strat->
sl; j++)
3269 for (i=strat->
Bl; i>=0; i--)
3291 for (j=strat->
Ll; j>=0; j--)
3297 if (strat->
L[j].p == strat->
tail)
3317 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3343 for (j=strat->
Ll; j>=0; j--)
3363 for(i=j-1; i>=0; i--)
3365 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3382 for (j=strat->
Ll; j>=0; j--)
3413 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3416 if (strat->
L[j].p2 == p)
3422 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3436 strat->
L[
i].p2 = strat->
tail;
3453 else if (strat->
L[j].p2 == strat->
tail)
3492 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3495 if (strat->
L[j].p2 == p)
3501 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3515 strat->
L[
i].p2 = strat->
tail;
3532 else if (strat->
L[j].p2 == strat->
tail)
3540 #ifdef HAVE_RATGRING 3553 for (j=0; j<=strat->
sl; j++)
3557 for (i=strat->
Bl; i>=0; i--)
3565 Print(
"chain-crit-part: S[%d]=",j);
3567 Print(
" divide B[%d].lcm=",i);
3589 for (j=strat->
Ll; j>=0; j--)
3595 if (strat->
L[j].p == strat->
tail)
3599 PrintS(
"chain-crit-part: pCompareChainPart p=");
3601 Print(
" delete L[%d]",j);
3623 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3630 Print(
"chain-crit-part: sugar B[%d].lcm=",j);
3632 Print(
" delete B[%d]",i);
3643 Print(
"chain-crit-part: sugar B[%d].lcm=",i);
3645 Print(
" delete B[%d]",j);
3665 for (j=strat->
Ll; j>=0; j--)
3673 PrintS(
"chain-crit-part: sugar:pCompareChainPart p=");
3675 Print(
" delete L[%d]",j);
3693 for(i=j-1; i>=0; i--)
3695 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3699 Print(
"chain-crit-part: equal lcm B[%d].lcm=",j);
3701 Print(
" delete B[%d]\n",i);
3718 for (j=strat->
Ll; j>=0; j--)
3726 PrintS(
"chain-crit-part: pCompareChainPart p=");
3728 Print(
" delete L[%d]",j);
3757 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3760 if (strat->
L[j].p2 == p)
3766 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3783 strat->
L[
i].p2 = strat->
tail;
3790 PrintS(
"chain-crit-part: divisible_by p=");
3792 Print(
" delete L[%d]",l);
3803 PrintS(
"chain-crit-part: divisible_by(2) p=");
3805 Print(
" delete L[%d]",i);
3816 else if (strat->
L[j].p2 == strat->
tail)
3844 for (j=0; j<=
k; j++)
3846 if (!strat->
fromQ[j])
3857 for (j=0; j<=
k; j++)
3860 PrintS(
"\n Trying to add spoly : \n");
3871 for (j=0; j<=
k; j++)
3884 #ifdef HAVE_RATGRING 3914 for (j=0; j<=
k; j++)
3916 if (!strat->
fromQ[j])
3927 for (j=0; j<=
k; j++)
3936 for (j=0; j<=
k; j++)
3950 #ifdef HAVE_RATGRING 3973 for (j=0; j<=k && !strat->
sigdrop; j++)
3975 if (!strat->
fromQ[j])
3984 for (j=0; j<=k && !strat->
sigdrop; j++)
3993 for (j=0; j<=k && !strat->
sigdrop; j++)
4007 #ifdef HAVE_RATGRING 4035 for (j=0; j<=strat->
sl; j++)
4039 for (i=strat->
Bl; i>=0; i--)
4046 PrintS(
"--- chain criterion func chainCritRing type 1\n");
4049 PrintS(
" strat->B[i].lcm:");
4054 wrp(strat->
B[i].lcm);
4059 printf(
"\nChainCrit1\n");
4075 for (j=strat->
Ll; j>=0; j--)
4084 printf(
"\nChainCrit2\n");
4094 PrintS(
"--- chain criterion func chainCritRing type 2\n");
4095 PrintS(
"strat->L[j].p:");
4126 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
4129 if (strat->
L[j].p2 == p)
4137 &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
4144 PrintS(
"--- chain criterion func chainCritRing type 3\n");
4145 PrintS(
"strat->L[j].lcm:");
4146 wrp(strat->
L[j].lcm);
4147 PrintS(
" strat->L[i].lcm:");
4148 wrp(strat->
L[i].lcm);
4153 printf(
"\nChainCrit3\n");
4168 strat->
L[
i].p2 = strat->
tail;
4185 else if (strat->
L[j].p2 == strat->
tail)
4199 if (arg <= 0)
return 0;
4211 if (arg <= 0)
return 0;
4212 if (arg%2 == 1) { arg--; }
4222 #ifdef HAVE_VANIDEAL 4233 int l,
j,compare,compareCoeff;
4237 Lp.ecart=0; Lp.length=0;
4253 for(j = strat->
Bl;j>=0;j--)
4257 if (compareCoeff == 0 || compare == compareCoeff)
4275 if (compareCoeff == 1)
4282 if (compareCoeff == -1)
4293 if ((f==
NULL) || (p==
NULL))
return;
4325 tmp_h.SetShortExpVector();
4330 enterT(tmp_h, strat, strat->
tl + 1);
4335 Lp.i_r1 = strat->
tl;
4339 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
4353 if ((*cabsind < bound) && (*cabsind - step[1] + add < bound))
4362 if (N == 1)
return 0;
4364 while (exp[i] == cexp[i] && i <= N) i++;
4366 *cabsind -= cind[
i];
4369 *cabsind += cind[
i];
4372 if (i > N)
return 0;
4376 for (
int j = i + 1;
j <=
N;
j++)
4378 if (step[1] > step[
j]) step[1] = step[
j];
4380 add =
ind2(cexp[i] + 2);
4381 if (*cabsind - step[1] + add >= bound)
4384 *cabsind -= cind[
i];
4386 *cabsind += cind[
i];
4389 if (i > N)
return 0;
4392 }
while (step[1] != -1);
4397 if (add < step[i]) step[
i] =
add;
4398 for (i = 2; i <=
N; i++)
4400 if (step[1] > step[i]) step[1] = step[
i];
4426 for (
int i = 1; i <= leadRing->N; i++)
4432 if (cabsind < leadRing->ch)
4434 zeroPoly =
p_ISet(
twoPow(leadRing->ch - cabsind), tailRing);
4438 zeroPoly =
p_ISet(1, tailRing);
4440 for (
int i = 1; i <= leadRing->N; i++)
4442 for (
long j = 1;
j <= exp[
i];
j++)
4445 tmp2 =
p_ISet(1, tailRing);
4450 zeroPoly =
p_Mult_q(zeroPoly, tmp2, tailRing);
4455 zeroPoly =
p_Mult_q(zeroPoly,
p_Add_q(tmp3, tmp2, tailRing), tailRing);
4460 for (
int i = 1; i <= leadRing->N; i++)
4466 zeroPoly =
pNext(zeroPoly);
4468 pNext(tmp2) = zeroPoly;
4489 for (
int i = 1; i <=
currRing->N; i++)
4492 if (exp[i] & 1 != 0)
4494 exp[
i] = exp[
i] - 1;
4507 PrintS(
"-------------\npoly :");
4509 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
4510 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4511 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4513 Print(
"cind : %d\n", cabsind);
4530 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4555 for (
int i = 1; i <=
currRing->N; i++)
4566 PrintS(
"-------------\npoly :");
4568 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
4569 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4570 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4571 Print(
"bound : %d\n", bound);
4572 Print(
"cind : %d\n", cabsind);
4590 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4598 G0->m[
IDELEMS(G0) - 1] = zeroPoly;
4617 for (j=0; j<=
k; j++)
4639 for (j=0; j<=k && !strat->
sigdrop; j++)
4693 PrintS(
"--- create zero spoly: ");
4722 posx = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
4775 PrintS(
"--- create zero spoly: ");
4802 printf(
"\nSigdrop in enterextended spoly\n");
pWrite(h);
pWrite(hSig);
4806 int red_result =
redRing(&Lp,strat);
4808 printf(
"\nAfter redRing reduce:\n");
pWrite(Lp.p);
4814 printf(
"\nCancel the sigdrop. It reduced to 0\n");
4823 printf(
"\nSigdrop. end\n");
4825 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
4827 strat->
enterS(Lp,0,strat,strat->
tl);
4875 if ( (!strat->
fromT)
4885 clearS(h,h_sev, &j,&k,strat);
4913 printf(
"\n Trying to add extended spolys\n");
4918 printf(
"\n Trying to add spolys\n");
4923 printf(
"\n Trying to add gcd-polys\n");
4941 if ( (!strat->
fromT)
4949 clearS(h,h_sev, &j,&k,strat);
4966 if ( (!strat->
fromT)
4974 clearS(h,h_sev, &j,&k,strat);
4991 for (j=0; j<=
k; j++)
4993 const int iCompSj =
pGetComp(strat->
S[j]);
4994 if ((iCompH==iCompSj)
5005 for (j=0; j<=
k; j++)
5007 const int iCompSj =
pGetComp(strat->
S[j]);
5008 if ((iCompH==iCompSj)
5047 clearS(h,h_sev,&j,&k,strat);
5064 int new_suc=strat->
sl+1;
5068 for (; i<=strat->
sl; i++)
5073 if (new_suc > at) new_suc = at;
5076 sev = strat->
sevS[
i];
5079 for (j=i; j>=at+1; j--)
5081 strat->
S[
j] = strat->
S[j-1];
5088 strat->
sevS[at] = sev;
5089 strat->
S_2_R[at] = s2r;
5092 for (j=i; j>=at+1; j--)
5096 strat->
fromQ[at]=fq;
5100 if (new_suc <= strat->sl) *suc=new_suc;
5114 if(length==-1)
return 0;
5133 || ((o==oo) && (
pLmCmp(
set[length],p)!= cmp_int)))
5155 if (
pLmCmp(
set[length],p)== -cmp_int)
5163 if (cmp == cmp_int)
return an;
5164 if (cmp == -cmp_int)
return en;
5170 if (cmp == cmp_int) en =
i;
5171 else if (cmp == -cmp_int) an =
i;
5180 if (
pLmCmp(
set[length],p)== -cmp_int)
5187 if (
pLmCmp(
set[an],p) == cmp_int)
return an;
5188 if (
pLmCmp(
set[an],p) == -cmp_int)
return en;
5190 && ((strat->
ecartS[an])>ecart_p))
5195 if (
pLmCmp(
set[i],p) == cmp_int) en=i;
5196 else if (
pLmCmp(
set[i],p) == -cmp_int) an=i;
5200 &&((strat->
ecartS[
i])<ecart_p))
5214 if (length<0)
return 0;
5219 for(
int i = 0;i<=
length;i++)
5228 || ((op == o) && (
pLtCmp(
set[mon],p) == -1)))
5239 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5246 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5258 || ((op == o) && (
pLtCmp(
set[length],p) == -1)))
5272 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5279 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5291 if(end < 0 || end >=
IDELEMS(F))
5293 if (end<0)
return 0;
5300 for(i=start;i<end;i++)
5314 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5321 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5346 if (length==-1)
return 0;
5348 if (
pLmCmp(
set[length].p,p.p)!=
currRing->OrdSgn)
return length+1;
5377 if (
set[length].length<p.length)
5388 if (
set[an].length>p.length)
return an;
5392 if (
set[i].length>p.length) en=
i;
5404 if (length==-1)
return 0;
5406 int o = p.GetpFDeg();
5407 int op =
set[
length].GetpFDeg();
5410 || ((op == o) && (
pLmCmp(
set[length].p,p.p) !=
currRing->OrdSgn)))
5421 op=
set[an].GetpFDeg();
5428 op =
set[
i].GetpFDeg();
5440 if (length==-1)
return 0;
5442 int o = p.GetpFDeg();
5443 int op =
set[
length].GetpFDeg();
5457 op=
set[an].GetpFDeg();
5464 op =
set[
i].GetpFDeg();
5481 if (length==-1)
return 0;
5482 int o = p.GetpFDeg();
5483 int op =
set[
length].GetpFDeg();
5488 if ((op < o) || (
pLmCmp(
set[length].p,p.p)== -cmp_int))
5495 op =
set[an].GetpFDeg();
5496 if (op > o)
return an;
5497 if (op < 0)
return en;
5498 cmp =
pLmCmp(
set[an].p,p.p);
5499 if (cmp == cmp_int)
return an;
5500 if (cmp == -cmp_int)
return en;
5505 op =
set[
i].GetpFDeg();
5507 else if (op < o) an =
i;
5510 cmp =
pLmCmp(
set[i].p,p.p);
5511 if (cmp == cmp_int) en =
i;
5512 else if (cmp == -cmp_int) an =
i;
5558 if (length==-1)
return 0;
5560 int o = p.GetpFDeg();
5561 int op =
set[
length].GetpFDeg();
5564 || (( op == o) && (
set[length].length<p.length))
5565 || (( op == o) && (
set[length].length == p.length)
5576 op =
set[an].GetpFDeg();
5578 || (( op == o) && (
set[an].length > p.length))
5579 || (( op == o) && (
set[an].length == p.length)
5585 op =
set[
i].GetpFDeg();
5587 || (( op == o) && (
set[i].length > p.length))
5588 || (( op == o) && (
set[i].length == p.length)
5600 if (length==-1)
return 0;
5602 int o = p.GetpFDeg();
5603 int op =
set[
length].GetpFDeg();
5606 || (( op == o) && (
set[length].length<p.length))
5607 || (( op == o) && (
set[length].length == p.length)
5618 op =
set[an].GetpFDeg();
5620 || (( op == o) && (
set[an].length > p.length))
5621 || (( op == o) && (
set[an].length == p.length)
5627 op =
set[
i].GetpFDeg();
5629 || (( op == o) && (
set[i].length > p.length))
5630 || (( op == o) && (
set[i].length == p.length)
5646 if (length==-1)
return 0;
5648 int o = p.GetpFDeg();
5675 int ol = p.GetpLength();
5676 if (length==-1)
return 0;
5680 int oo=
set[
length].ecart;
5681 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
5691 int oo=
set[an].ecart;
5693 || ((oo==op) && (
set[an].
pLength > ol)))
5698 int oo=
set[
i].ecart;
5700 || ((oo == op) && (
set[i].
pLength > ol)))
5732 if (length==-1)
return 0;
5734 int o = p.GetpFDeg() + p.ecart;
5749 op =
set[an].GetpFDeg()+
set[an].ecart;
5756 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5768 if (length==-1)
return 0;
5770 int o = p.GetpFDeg() + p.ecart;
5785 op =
set[an].GetpFDeg()+
set[an].ecart;
5792 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5829 if (length==-1)
return 0;
5831 int o = p.GetpFDeg() + p.ecart;
5835 || (( op == o) && (
set[length].ecart > p.ecart))
5836 || (( op == o) && (
set[length].ecart==p.ecart)
5847 op =
set[an].GetpFDeg()+
set[an].ecart;
5849 || (( op == o) && (
set[an].ecart < p.ecart))
5850 || (( op == o) && (
set[an].ecart==p.ecart)
5856 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5858 || (( op == o) && (
set[i].ecart < p.ecart))
5859 || (( op == o) && (
set[i].ecart == p.ecart)
5870 if (length==-1)
return 0;
5872 int o = p.GetpFDeg() + p.ecart;
5876 || (( op == o) && (
set[length].ecart > p.ecart))
5877 || (( op == o) && (
set[length].ecart==p.ecart)
5888 op =
set[an].GetpFDeg()+
set[an].ecart;
5890 || (( op == o) && (
set[an].ecart < p.ecart))
5891 || (( op == o) && (
set[an].ecart==p.ecart)
5897 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5899 || (( op == o) && (
set[i].ecart < p.ecart))
5900 || (( op == o) && (
set[i].ecart == p.ecart)
5916 if (length==-1)
return 0;
5920 int o = p.GetpFDeg() + p.ecart;
5923 if (
pGetComp(
set[length].p)*cc < c)
5925 if (
pGetComp(
set[length].p)*cc == c)
5929 || ((op == o) && (
set[length].ecart > p.ecart))
5930 || ((op == o) && (
set[length].ecart==p.ecart)
5946 int op =
set[an].GetpFDeg()+
set[an].ecart;
5948 || ((op == o) && (
set[an].ecart < p.ecart))
5949 || ((op == o) && (
set[an].ecart==p.ecart)
5958 else if (
pGetComp(
set[i].p)*cc == c)
5960 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
5962 || ((op == o) && (
set[i].ecart < p.ecart))
5963 || ((op == o) && (
set[i].ecart == p.ecart)
5977 if (length==-1)
return 0;
5981 int o = p.GetpFDeg() + p.ecart;
5984 if (
pGetComp(
set[length].p)*cc < c)
5986 if (
pGetComp(
set[length].p)*cc == c)
5990 || ((op == o) && (
set[length].ecart > p.ecart))
5991 || ((op == o) && (
set[length].ecart==p.ecart)
6007 int op =
set[an].GetpFDeg()+
set[an].ecart;
6009 || ((op == o) && (
set[an].ecart < p.ecart))
6010 || ((op == o) && (
set[an].ecart==p.ecart)
6019 else if (
pGetComp(
set[i].p)*cc == c)
6021 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
6023 || ((op == o) && (
set[i].ecart < p.ecart))
6024 || ((op == o) && (
set[i].ecart == p.ecart)
6044 if (length==-1)
return 0;
6047 int op=p.GetpFDeg();
6049 if (
set[length].ecart < o)
6051 if (
set[length].ecart == o)
6053 int oo=
set[
length].GetpFDeg();
6054 if ((oo < op) || ((oo==op) && (
set[length].length < p.length)))
6065 if (
set[an].ecart > o)
6067 if (
set[an].ecart == o)
6069 int oo=
set[an].GetpFDeg();
6071 || ((oo==op) && (
set[an].length > p.length)))
6077 if (
set[i].ecart > o)
6079 else if (
set[i].ecart == o)
6081 int oo=
set[
i].GetpFDeg();
6083 || ((oo == op) && (
set[i].length > p.length)))
6101 if (length<0)
return 0;
6103 int d=p->GetpFDeg();
6104 int op=
set[
length].GetpFDeg();
6107 || ((op == d) && (p->p1!=
NULL)&&(
set[length].p1==
NULL))
6118 op=
set[an].GetpFDeg();
6120 || ((op == d) && (p->p1!=
NULL) && (
set[an].p1==
NULL))
6126 op=
set[
i].GetpFDeg();
6128 || ((op==d) && (p->p1!=
NULL) && (
set[i].p1==
NULL))
6144 if (length<0)
return 0;
6170 if (length<0)
return 0;
6202 if (length<0)
return 0;
6227 if (length<0)
return 0;
6241 cmp =
pLtCmp(
set[an].sig,p->sig);
6248 if (
set[an].
FDeg > p->FDeg)
6250 if (
set[an].FDeg < p->
FDeg)
6252 if (
set[an].FDeg == p->FDeg)
6254 cmp =
pLtCmp(
set[an].p,p->p);
6263 cmp =
pLtCmp(
set[i].sig,p->sig);
6270 if (
set[i].
FDeg > p->FDeg)
6272 if (
set[i].FDeg < p->
FDeg)
6274 if (
set[i].FDeg == p->FDeg)
6276 cmp =
pLtCmp(
set[i].p,p->p);
6289 if (length < 0)
return 0;
6290 if (
set[length].
FDeg > p->FDeg)
6292 if (
set[length].
FDeg == p->FDeg)
6293 if(
set[length].
GetpLength() > p->GetpLength())
6304 if (
set[an].
FDeg > p->FDeg)
6306 if(
set[an].
FDeg == p->FDeg)
6314 if(
nGreater(
set[an].p->coef, p->p->coef))
6329 if (
set[i].
FDeg > p->FDeg)
6333 if(
set[i].
FDeg == p->FDeg)
6341 if(
nGreater(
set[i].p->coef, p->p->coef))
6361 if (strat->
syzl==0)
return 0;
6366 int en= strat->
syzl-1;
6402 if (length<0)
return 0;
6404 int o = p->GetpFDeg();
6405 int op =
set[
length].GetpFDeg();
6408 || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6417 op =
set[an].GetpFDeg();
6424 op =
set[
i].GetpFDeg();
6444 if (length<0)
return 0;
6446 int o = p->GetpFDeg();
6447 int op =
set[
length].GetpFDeg();
6459 op =
set[an].GetpFDeg();
6466 op =
set[
i].GetpFDeg();
6478 if (length<0)
return 0;
6479 if(start == (length +1))
return (length+1);
6480 int o = p->GetpFDeg();
6481 int op =
set[
length].GetpFDeg();
6493 op =
set[an].GetpFDeg();
6500 op =
set[
i].GetpFDeg();
6514 if (length < 0)
return 0;
6524 if (
set[an].
FDeg > p->FDeg)
6526 if (
set[an].FDeg < p->
FDeg)
6528 if (
set[an].FDeg == p->FDeg)
6558 if (
set[i].
FDeg > p->FDeg)
6560 if (
set[i].FDeg < p->
FDeg)
6562 if (
set[i].FDeg == p->FDeg)
6602 if (coeff == 0)
return -1;
6605 while (tmp % 2 == 0)
6624 if (length < 0)
return 0;
6626 int o = p->GetpFDeg();
6627 int op =
set[
length].GetpFDeg();
6629 if ((op > o) || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6638 op =
set[an].GetpFDeg();
6639 if ((op > o) || ((op == o) && (
pLmCmp(
set[an].p,p->p) != -
currRing->OrdSgn)))
6644 op =
set[
i].GetpFDeg();
6645 if ((op > o) || ((op == o) && (
pLmCmp(
set[i].p,p->p) != -
currRing->OrdSgn)))
6700 if (length<0)
return 0;
6702 int o = p->GetpFDeg();
6703 int op =
set[
length].GetpFDeg();
6706 || ((op == o) && (
set[length].length >p->length))
6707 || ((op == o) && (
set[length].length <= p->length)
6717 op =
set[an].GetpFDeg();
6719 || ((op == o) && (
set[an].length >p->length))
6720 || ((op == o) && (
set[an].length <=p->length)
6726 op =
set[
i].GetpFDeg();
6728 || ((op == o) && (
set[i].length > p->length))
6729 || ((op == o) && (
set[i].length <= p->length)
6741 if (length<0)
return 0;
6743 int o = p->GetpFDeg();
6744 int op =
set[
length].GetpFDeg();
6747 || ((op == o) && (
set[length].length >p->length))
6748 || ((op == o) && (
set[length].length <= p->length)
6758 op =
set[an].GetpFDeg();
6760 || ((op == o) && (
set[an].length >p->length))
6761 || ((op == o) && (
set[an].length <=p->length)
6767 op =
set[
i].GetpFDeg();
6769 || ((op == o) && (
set[i].length > p->length))
6770 || ((op == o) && (
set[i].length <= p->length)
6788 if (length<0)
return 0;
6790 int o = p->GetpFDeg();
6823 if (length<0)
return 0;
6825 int o = p->GetpFDeg() + p->ecart;
6829 || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6838 op =
set[an].GetpFDeg() +
set[an].ecart;
6845 op =
set[
i].GetpFDeg() +
set[
i].ecart;
6858 if (length<0)
return 0;
6860 int o = p->GetpFDeg() + p->ecart;
6873 op =
set[an].GetpFDeg() +
set[an].ecart;
6880 op =
set[
i].GetpFDeg() +
set[
i].ecart;
6899 if (length<0)
return 0;
6901 int o = p->GetpFDeg() + p->ecart;
6903 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6904 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6905 && (
set[length].ecart > p->ecart))
6906 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6907 && (
set[length].ecart == p->ecart)
6917 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
6918 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6919 && (
set[an].ecart > p->ecart))
6920 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6921 && (
set[an].ecart == p->ecart)
6927 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
6928 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6929 && (
set[i].ecart > p->ecart))
6930 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6931 && (
set[i].ecart == p->ecart)
6943 if (length<0)
return 0;
6945 int o = p->GetpFDeg() + p->ecart;
6947 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6948 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6949 && (
set[length].ecart > p->ecart))
6950 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6951 && (
set[length].ecart == p->ecart)
6961 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
6962 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6963 && (
set[an].ecart > p->ecart))
6964 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6965 && (
set[an].ecart == p->ecart)
6971 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
6972 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6973 && (
set[i].ecart > p->ecart))
6974 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6975 && (
set[i].ecart == p->ecart)
6993 if (length<0)
return 0;
6997 unsigned long c =
pGetComp(p->p)*cc;
6998 int o = p->GetpFDeg() + p->ecart;
7000 if (
pGetComp(
set[length].p)*cc > c)
7002 if (
pGetComp(
set[length].p)*cc == c)
7004 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
7005 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
7006 && (
set[length].ecart > p->ecart))
7007 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
7008 && (
set[length].ecart == p->ecart)
7023 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
7024 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7025 && (
set[an].ecart > p->ecart))
7026 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7027 && (
set[an].ecart == p->ecart)
7036 else if (
pGetComp(
set[i].p)*cc == c)
7038 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
7039 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7040 && (
set[i].ecart > p->ecart))
7041 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7042 && (
set[i].ecart == p->ecart)
7057 if (length<0)
return 0;
7061 unsigned long c =
pGetComp(p->p)*cc;
7062 int o = p->GetpFDeg() + p->ecart;
7064 if (
pGetComp(
set[length].p)*cc > c)
7066 if (
pGetComp(
set[length].p)*cc == c)
7068 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
7069 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
7070 && (
set[length].ecart > p->ecart))
7071 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
7072 && (
set[length].ecart == p->ecart)
7087 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
7088 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7089 && (
set[an].ecart > p->ecart))
7090 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7091 && (
set[an].ecart == p->ecart)
7100 else if (
pGetComp(
set[i].p)*cc == c)
7102 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
7103 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7104 && (
set[i].ecart > p->ecart))
7105 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7106 && (
set[i].ecart == p->ecart)
7125 PrintS(
"syzygy criterion checks: ");
7128 for (
int k=0;
k<strat->
syzl;
k++)
7133 Print(
"checking with: %d / %d -- \n",
k,strat->
syzl);
7165 PrintS(
"--- syzygy criterion checks: ");
7174 min = strat->
syzIdx[comp-2];
7184 max = strat->
syzIdx[comp-1];
7186 for (
int k=min;
k<
max;
k++)
7189 Print(
"COMP %d/%d - MIN %d - MAX %d - SYZL %ld\n",comp,strat->
currIdx,min,max,strat->
syzl);
7190 Print(
"checking with: %d -- ",
k);
7218 PrintS(
"rewritten criterion checks: ");
7221 for(
int k = strat->
sl;
k>=start;
k--)
7225 PrintS(
"checking with: ");
7236 printf(
"\nFaugere RewCrit: * divisible by *\n");
pWrite(sig);
pWrite(strat->
sig[
k]);
7244 PrintS(
"ALL ELEMENTS OF S\n----------------------------------------\n");
7245 for(
int kk = 0; kk<strat->
sl+1; kk++)
7249 PrintS(
"------------------------------\n");
7276 printf(
"\narriRewCrit\n");
7282 for (
int ii=strat->
sl; ii>start; ii--)
7288 if (!(
pLmCmp(p1,p2) == 1))
7291 printf(
"\narriRewCrit deleted: sig, P.sig\n");
7307 printf(
"\narriRewCritPre\n");
7313 for (
int i=strat->
Bl; i>-1; i--) {
7322 if (
pLmCmp(lm,strat->
B[found].GetLmCurrRing()) == -1)
7326 printf(
"\nDelete!\n");
7332 printf(
"\nDelete this one!\n");
7339 for (
int ii=strat->
sl; ii>-1; ii--)
7345 if (!(
pLmCmp(p1,p2) == 1))
7350 printf(
"\nDelete this one!\n");
7371 const unsigned long not_sev = ~L->sev;
7372 const unsigned long* sev = strat->
sevS;
7385 if (j > pos)
return NULL;
7386 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7388 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7393 if (!(sev[j] & not_sev) &&
7394 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]) &&
7408 if (j > pos)
return NULL;
7409 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7416 if (!(sev[j] & not_sev) &&
7417 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]) &&
7428 if (strat->
tl < 0 || strat->
S_2_R[j] == -1)
7430 T->Set(strat->
S[j], r, strat->
tailRing);
7438 return strat->
S_2_T(j);
7448 if (j > pos)
return NULL;
7450 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7451 t = strat->
S_2_T(j);
7454 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7459 if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7461 t = strat->
S_2_T(j);
7462 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[j]);
7477 if (j > pos)
return NULL;
7479 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7480 t = strat->
S_2_T(j);
7488 if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7490 t = strat->
S_2_T(j);
7491 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[j]);
7541 if (With ==
NULL)
break;
7551 return redtail(L, pos, strat);
7557 if (hn ==
NULL)
goto all_done;
7578 return redtail(&L, pos, strat);
7583 #define REDTAIL_CANONICALIZE 100 7587 p = h = L->GetLmTailRing();
7589 return L->GetLmCurrRing();
7596 Ln.pLength = L->GetpLength() - 1;
7620 Ln.SetShortExpVector();
7626 With = &(strat->
T[
j]);
7631 if (With ==
NULL)
break;
7658 pNext(h) = Ln.LmExtractAndIter();
7661 }
while (!Ln.IsNull());
7664 if (Ln.IsNull())
goto all_done;
7665 if (! withT) With_s.Init(
currRing);
7667 pNext(h) = Ln.LmExtractAndIter();
7686 return L->GetLmCurrRing();
7691 #define REDTAIL_CANONICALIZE 100 7695 p = h = L->GetLmTailRing();
7697 return L->GetLmCurrRing();
7704 Ln.pLength = L->GetpLength() - 1;
7728 Ln.SetShortExpVector();
7734 With = &(strat->
T[
j]);
7739 if (With ==
NULL)
break;
7766 pNext(h) = Ln.LmExtractAndIter();
7769 }
while (!Ln.IsNull());
7775 Ln.p =
pJet(Ln.p,bound);
7781 if (! withT) With_s.Init(
currRing);
7783 pNext(h) = Ln.LmExtractAndIter();
7802 return L->GetLmCurrRing();
7812 p = h = L->GetLmTailRing();
7814 return L->GetLmCurrRing();
7821 Ln.pLength = L->GetpLength() - 1;
7834 Ln.SetShortExpVector();
7836 if (With ==
NULL)
break;
7846 poly p_Ln=Ln.GetLmCurrRing();
7847 poly p_With=With->GetLmCurrRing();
7859 if (Ln.bucket!=
NULL)
7890 pNext(h) = Ln.LmExtractAndIter();
7893 }
while (!Ln.IsNull());
7896 if (Ln.IsNull())
goto all_done;
7899 pNext(h) = Ln.LmExtractAndIter();
7917 return L->GetLmCurrRing();
7933 if (strat->
Ll != *reduc)
7935 if (strat->
Ll != *reduc-1)
7947 if (red_result == 0)
7949 else if (red_result < 0)
7951 if ((red_result > 0) || ((strat->
Ll % 100)==99))
7953 if (strat->
Ll != *reduc && strat->
Ll > 0)
7970 Print(
"product criterion:%d chain criterion:%d\n",strat->
cp,strat->
c3);
7971 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7973 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7984 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7986 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
8001 for (i=0; i<=strat->
sl; i++)
8011 for (i=0; i<=strat->
tl; i++)
8015 Print(
" o:%ld e:%d l:%d",
8016 strat->
T[i].pFDeg(),strat->
T[
i].ecart,strat->
T[
i].length);
8021 for (i=strat->
Ll; i>=0; i--)
8030 Print(
" o:%ld e:%d l:%d",
8031 strat->
L[i].pFDeg(),strat->
L[
i].ecart,strat->
L[
i].length);
8053 strat->
S=strat->
Shdl->m;
8058 memset(strat->
fromQ,0,i*
sizeof(
int));
8064 h.p =
pCopy(Q->m[i]);
8085 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8088 strat->
enterS(h,pos,strat,-1);
8089 strat->
fromQ[pos]=1;
8099 h.p =
pCopy(F->m[i]);
8121 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8123 strat->
enterS(h,pos,strat,-1);
8149 strat->
S=strat->
Shdl->m;
8154 memset(strat->
fromQ,0,i*
sizeof(
int));
8160 h.p =
pCopy(Q->m[i]);
8181 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8184 strat->
enterS(h,pos,strat,-1);
8185 strat->
fromQ[pos]=1;
8195 h.p =
pCopy(F->m[i]);
8218 pos = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
8248 strat->
S = strat->
Shdl->m;
8261 memset(strat->
fromQ,0,i*
sizeof(
int));
8267 h.p =
pCopy(Q->m[i]);
8288 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8291 strat->
enterS(h,pos,strat,-1);
8292 strat->
fromQ[pos]=1;
8302 h.p =
pCopy(F->m[i]);
8403 for(i=1; i<=strat->
sl; i++)
8419 #if defined(DEBUGF5) || defined(DEBUGF51) 8420 PrintS(
"------------- GENERATING SYZ RULES NEW ---------------\n");
8427 while (i <= strat->sl)
8439 diff = comp - comp_old - 1;
8457 for (k = 0; k<
i; k++)
8484 diff = comp - comp_old - 1;
8501 for (k = 0; k<strat->
sl+1; k++)
8522 PrintS(
"Principal syzygies:\n");
8525 Print(
"ps %d\n",ps);
8526 PrintS(
"--------------------------------\n");
8527 for(i=0;i<=strat->
syzl-1;i++)
8536 PrintS(
"--------------------------------\n");
8556 strat->
S=strat->
Shdl->m;
8562 memset(strat->
fromQ,0,i*
sizeof(
int));
8568 h.p =
pCopy(Q->m[i]);
8589 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8592 strat->
enterS(h,pos,strat, strat->
tl+1);
8594 strat->
fromQ[pos]=1;
8605 h.p =
pCopy(F->m[i]);
8620 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8622 strat->
enterS(h,pos,strat, strat->
tl+1);
8664 h.is_normalized = 0;
8669 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8671 strat->
enterS(h,pos,strat, strat->
tl+1);
8679 strat->
enterS(h,0,strat, strat->
tl+1);
8701 strat->
S=strat->
Shdl->m;
8707 memset(strat->
fromQ,0,i*
sizeof(
int));
8713 h.p =
pCopy(Q->m[i]);
8734 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8737 strat->
enterS(h,pos,strat, strat->
tl+1);
8739 strat->
fromQ[pos]=1;
8750 h.p =
pCopy(F->m[i]);
8765 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8767 strat->
enterS(h,pos,strat, strat->
tl+1);
8809 h.is_normalized = 0;
8814 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8816 strat->
enterS(h,pos,strat, strat->
tl+1);
8824 strat->
enterS(h,0,strat, strat->
tl+1);
8840 while (j <= maxIndex)
8857 if (!
pIsVector((*p).p) && ((*p).ecart != 0))
8866 h1 = r =
pCopy((*p).p);
8919 while ((j <= strat->sl) && (
pGetComp(strat->
S[j])!=0)) j++;
8921 while (j<=strat->sl)
8945 while (j <= maxIndex)
8999 while (j <= maxIndex);
9029 while (i<=strat->sl)
9036 redSi =
pHead(strat->
S[i]);
9037 strat->
S[
i] =
redBba(strat->
S[i],i-1,strat);
9040 if (
pCmp(redSi,strat->
S[i])!=0)
9053 if (strat->
S[i]==
NULL)
9061 if (strat->
S[i]==
NULL)
9079 DENOMINATOR_LIST=denom;
9098 if (any_change)
reorderS(&suc,strat);
9103 for (i=0; i<=strat->
sl; i++)
9124 h.sev = strat->
sevS[
i];
9137 while (i<=strat->sl)
9142 redSi=
pHead((strat->
S)[i]);
9149 else if (
pCmp((strat->
S)[i],redSi)!=0)
9166 DENOMINATOR_LIST=denom;
9181 strat->
sevS[
i] = h.sev;
9191 if (any_change)
reorderS(&suc,strat);
9192 else { suc=-1;
break; }
9203 for (i=0; i<=strat->
sl; i++)
9207 strat->
S[
i] = h.p =
redtail(strat->
S[i],strat->
sl,strat);
9211 strat->
sevS[
i] = h.sev;
9217 h.sev = strat->
sevS[
i];
9218 h.length = h.pLength =
pLength(h.p);
9227 if (suc!= -1)
updateS(toT,strat);
9247 *
sizeof(
unsigned long));
9274 strat->
Shdl->m=strat->
S;
9276 if (atS <= strat->sl)
9278 #ifdef ENTER_USE_MEMMOVE 9279 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9280 (strat->
sl - atS + 1)*
sizeof(
poly));
9281 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9282 (strat->
sl - atS + 1)*
sizeof(
int));
9283 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9284 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9285 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9286 (strat->
sl - atS + 1)*
sizeof(
int));
9288 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9289 (strat->
sl - atS + 1)*
sizeof(
int));
9291 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9294 for (i=strat->
sl+1; i>=atS+1; i--)
9296 strat->
S[
i] = strat->
S[i-1];
9302 for (i=strat->
sl+1; i>=atS+1; i--)
9305 for (i=strat->
sl+1; i>=atS+1; i--)
9311 #ifdef ENTER_USE_MEMMOVE 9312 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9313 (strat->
sl - atS + 1)*
sizeof(
int));
9315 for (i=strat->
sl+1; i>=atS+1; i--)
9320 strat->
fromQ[atS]=0;
9324 strat->
S[atS] = p.p;
9330 strat->
sevS[atS] = p.sev;
9331 strat->
ecartS[atS] = p.ecart;
9332 strat->
S_2_R[atS] = atR;
9349 *
sizeof(
unsigned long));
9353 *
sizeof(
unsigned long));
9381 strat->
Shdl->m=strat->
S;
9388 if (atS <= strat->sl)
9390 #ifdef ENTER_USE_MEMMOVE 9391 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9392 (strat->
sl - atS + 1)*
sizeof(
poly));
9393 memmove(&(strat->
sig[atS+1]), &(strat->
sig[atS]),
9394 (strat->
sl - atS + 1)*
sizeof(
poly));
9395 memmove(&(strat->
sevSig[atS+1]), &(strat->
sevSig[atS]),
9396 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9397 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9398 (strat->
sl - atS + 1)*
sizeof(
int));
9399 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9400 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9401 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9402 (strat->
sl - atS + 1)*
sizeof(
int));
9404 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9405 (strat->
sl - atS + 1)*
sizeof(
int));
9407 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9410 for (i=strat->
sl+1; i>=atS+1; i--)
9412 strat->
S[
i] = strat->
S[i-1];
9416 strat->
sig[
i] = strat->
sig[i-1];
9420 for (i=strat->
sl+1; i>=atS+1; i--)
9423 for (i=strat->
sl+1; i>=atS+1; i--)
9429 #ifdef ENTER_USE_MEMMOVE 9430 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9431 (strat->
sl - atS + 1)*
sizeof(
int));
9433 for (i=strat->
sl+1; i>=atS+1; i--)
9438 strat->
fromQ[atS]=0;
9442 strat->
S[atS] = p.p;
9443 strat->
sig[atS] = p.sig;
9449 strat->
sevS[atS] = p.sev;
9459 strat->
sevSig[atS] = p.sevSig;
9461 strat->
ecartS[atS] = p.ecart;
9462 strat->
S_2_R[atS] = atR;
9466 Print(
"--- LIST S: %d ---\n",strat->
sl);
9467 for(k=0;k<=strat->
sl;k++)
9471 PrintS(
"--- LIST S END ---\n");
9487 assume(p.FDeg == p.pFDeg());
9492 for(i=strat->
tl;i>=0;i--)
9494 if (p.p==strat->
T[i].p)
9496 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
9502 #ifdef HAVE_TAIL_RING 9505 p.t_p=p.GetLmTailRing();
9510 atT = strat->
posInT(strat->
T, strat->
tl, p);
9511 if (strat->
tl == strat->
tmax-1)
9513 if (atT <= strat->tl)
9515 #ifdef ENTER_USE_MEMMOVE 9516 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9518 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9519 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9521 for (i=strat->
tl+1; i>=atT+1; i--)
9523 #ifndef ENTER_USE_MEMMOVE 9524 strat->
T[
i] = strat->
T[i-1];
9527 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9541 printf(
"\nenterT: add in position %i\n",atT);
9549 strat->
T[atT].max_exp =
NULL;
9552 strat->
R[strat->
tl] = &(strat->
T[atT]);
9553 strat->
T[atT].i_r = strat->
tl;
9573 assume(p.FDeg == p.pFDeg());
9578 for(i=strat->
tl;i>=0;i--)
9580 if (p.p==strat->
T[i].p)
9582 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
9588 #ifdef HAVE_TAIL_RING 9591 p.t_p=p.GetLmTailRing();
9596 atT = strat->
posInT(strat->
T, strat->
tl, p);
9597 if (strat->
tl == strat->
tmax-1)
9599 if (atT <= strat->tl)
9601 #ifdef ENTER_USE_MEMMOVE 9602 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9604 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9605 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9607 for (i=strat->
tl+1; i>=atT+1; i--)
9609 #ifndef ENTER_USE_MEMMOVE 9610 strat->
T[
i] = strat->
T[i-1];
9613 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9627 printf(
"\nenterT_strong: add in position %i\n",atT);
9635 strat->
T[atT].max_exp =
NULL;
9638 strat->
R[strat->
tl] = &(strat->
T[atT]);
9639 strat->
T[atT].i_r = strat->
tl;
9647 printf(
"\nDas ist p:\n");
pWrite(p.p);
9649 for(i=strat->
tl;i>=0;i--)
9654 printf(
"\nFound one: %i\n",i);
pWrite(strat->
T[i].p);
9678 printf(
"\n Entersyz:\n");
pWrite(p.sig);
9686 (strat->
syzmax)*
sizeof(
unsigned long),
9688 *
sizeof(
unsigned long));
9691 if (atT < strat->syzl)
9693 #ifdef ENTER_USE_MEMMOVE 9694 memmove(&(strat->
syz[atT+1]), &(strat->
syz[atT]),
9696 memmove(&(strat->
sevSyz[atT+1]), &(strat->
sevSyz[atT]),
9697 (strat->
syzl-atT+1)*
sizeof(
unsigned long));
9699 for (i=strat->
syzl; i>=atT+1; i--)
9701 #ifndef ENTER_USE_MEMMOVE 9702 strat->
syz[
i] = strat->
syz[i-1];
9714 strat->
syz[atT] = p.sig;
9715 strat->
sevSyz[atT] = p.sevSig;
9718 Print(
"element in strat->syz: %d--%d ",atT+1,strat->
syzmax);
9728 strat->
L[cc].sig, ~strat->
L[cc].sevSig,
currRing)
9737 printf(
"\n syzCrit deleted!\n");
pWrite(strat->
L[cc].p);
pWrite(strat->
L[cc].sig);
9745 PrintS(
"--- Syzygies ---\n");
9748 PrintS(
"--------------------------------\n");
9749 for(i=0;i<=strat->
syzl-1;i++)
9754 PrintS(
"--------------------------------\n");
9790 #ifdef HAVE_RATGRING 9835 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9836 else PrintS(
"ideal/module is not homogeneous\n");
9867 #ifdef HAVE_RATGRING 9906 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9907 else PrintS(
"ideal/module is not homogeneous\n");
10129 strat->
P.pLength=0;
10415 for (l=
IDELEMS(r)-1;l>=0;l--)
10426 for (l=
IDELEMS(r)-1;l>=0;l--)
10428 if ((r->m[l]!=
NULL)
10433 for(q=
IDELEMS(Q)-1; q>=0;q--)
10435 if ((Q->m[q]!=
NULL)
10457 for (l=
IDELEMS(r)-1;l>=0;l--)
10459 if ((r->m[l]!=
NULL)
10464 for(q=
IDELEMS(Q)-1; q>=0;q--)
10466 if ((Q->m[q]!=
NULL)
10497 for (l=
IDELEMS(r)-1;l>=0;l--)
10501 for(q=
IDELEMS(Q)-1; q>=0;q--)
10510 reduction_found=
TRUE;
10526 for (l=
IDELEMS(r)-1;l>=0;l--)
10530 for(q=
IDELEMS(Q)-1; q>=0;q--)
10541 reduction_found=
TRUE;
10555 if ( reduction_found)
10560 for (l=
IDELEMS(r)-1;l>=0;l--)
10591 for (l=
IDELEMS(r)-1;l>=0;l--)
10645 for (i=strat->
sl; i>=low; i--)
10647 int end_pos=strat->
sl;
10649 if (strat->
ak==0) end_pos=i-1;
10651 if ((T_j !=
NULL)&&(T_j->p==strat->
S[i]))
10657 Print(
"test S[%d]:",i);
10669 Print(
"to (tailR) S[%d]:",i);
10681 T_j->max_exp =
NULL;
10684 T_j->pCleardenom();
10692 Print(
"test S[%d]:",i);
10698 strat->
S[
i] =
redtailBba(strat->
S[i], end_pos, strat, withT);
10712 DENOMINATOR_LIST=denom;
10725 Print(
"to (-tailR) S[%d]:",i);
10736 sloppy_max =
FALSE;
10772 if (j < strat->
HCord)
10816 assume(L->i_r1 >= -1 && L->i_r1 <= strat->
tl);
10817 assume(L->i_r2 >= -1 && L->i_r2 <= strat->
tl);
10823 if ((L->i_r1 == -1) || (L->i_r2 == -1) )
10877 ideal F =
idCopy(Forig);
10881 ideal monred =
idInit(1,1);
10882 for(
int i=0; i<
idElem(F); i++)
10888 if((posconst != -1) && (!
nIsZero(F->m[posconst]->coef)))
10898 for(
int i=0; i<idelemQ; i++)
10906 if((posconst != -1) && (!
nIsZero(monred->m[posconst]->coef)))
10908 pmon =
pCopy(monred->m[posconst]);
10922 for(
int i = 0, j = 0; i<
IDELEMS(F); i++)
10923 II->m[j++] =
prMapR(F->m[i], nMap, origR, QQ_ring);
10924 for(
int i = 0, j =
IDELEMS(F); i<idelemQ; i++)
10925 II->m[j++] =
prMapR(Q->m[i], nMap, origR, QQ_ring);
10931 for(
int i =
IDELEMS(II)-1; i>=0; i--)
10932 if(II->m[i] !=
NULL)
10933 II->m[i+1] = II->m[
i];
10937 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
10944 integer =
pHead(syz->m[i]);
10951 pmon =
prMapR(integer, nMap2, QQ_ring, origR);
10966 for(
int i = 0; i<
IDELEMS(one); i++)
10970 if(mindegmon ==
NULL)
10971 mindegmon =
pCopy(one->m[i]);
10974 if(
p_Deg(one->m[i], QQ_ring) <
p_Deg(mindegmon, QQ_ring))
10975 mindegmon =
pCopy(one->m[i]);
10979 if(mindegmon !=
NULL)
10981 for(
int i =
IDELEMS(II)-1; i>=0; i--)
10982 if(II->m[i] !=
NULL)
10983 II->m[i+1] = II->m[
i];
10984 II->m[0] =
pCopy(mindegmon);
10987 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
11001 if (found ==
FALSE)
11013 pmon =
prMapR(mindegmon, nMap2, QQ_ring, origR);
11044 poly pH = h->GetP();
11048 for(
int i = 0; i<=strat->
sl; i++)
11100 h->SetLmCurrRing();
11109 poly hSig = h->sig;
11110 poly pH = h->GetP();
11114 for(
int i = 0; i<=strat->
sl; i++)
11125 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
11152 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
11183 h->SetLmCurrRing();
11199 for(
int j = 0; j<=strat->
sl; j++)
11203 for(
int i = 0; i<=strat->
sl; i++)
11205 if((i != j) && (strat->
S[i] !=
NULL))
11265 if (expbound == 0) expbound = strat->
tailRing->bitmask << 1;
11282 new_tailRing->pFDeg =
currRing->pFDeg;
11283 new_tailRing->pLDeg =
currRing->pLDeg;
11287 Print(
"[%lu:%d", (
unsigned long) new_tailRing->bitmask, new_tailRing->ExpL_Size);
11296 for (i=0; i<=strat->
tl; i++)
11298 strat->
T[
i].ShallowCopyDelete(new_tailRing, new_tailBin,
11299 p_shallow_copy_delete);
11301 for (i=0; i<=strat->
Ll; i++)
11305 strat->
L[
i].ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11307 if ((strat->
P.t_p !=
NULL) ||
11309 strat->
P.ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11311 if ((L !=
NULL) && (L->tailRing != new_tailRing))
11314 L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11320 L->tailRing = new_tailRing;
11323 L->max_exp = t_l->max_exp;
11327 if ((T !=
NULL) && (T->tailRing != new_tailRing && T->i_r < 0))
11328 T->ShallowCopyDelete(new_tailRing, new_tailBin, p_shallow_copy_delete);
11335 strat->
tailBin = new_tailBin;
11361 unsigned long l = 0;
11367 for (i=0; i<= strat->
Ll; i++)
11371 for (i=0; i<=strat->
tl; i++)
11397 res->order = (
int *)
omAlloc0((n+1)*
sizeof(int));
11398 res->block0 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11399 res->block1 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11400 int **wvhdl = (
int **)
omAlloc0((n+1)*
sizeof(
int*));
11401 res->wvhdl = wvhdl;
11402 for (
int i=1; i<n; i++)
11404 res->order[
i] = r->order[i-1];
11405 res->block0[
i] = r->block0[i-1];
11406 res->block1[
i] = r->block1[i-1];
11407 res->wvhdl[
i] = r->wvhdl[i-1];
11413 for (
int i=
rBlocks(res); i>0; --
i)
11426 #ifndef SING_NDEBUG 11427 WarnS(
"error in nc_rComplete");
11445 res->order = (
int *)
omAlloc0((n+2)*
sizeof(int));
11446 res->block0 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11447 res->block1 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11448 int **wvhdl = (
int **)
omAlloc0((n+2)*
sizeof(
int*));
11449 res->wvhdl = wvhdl;
11450 for (
int i=2; i<n+2; i++)
11452 res->order[
i] = r->order[i-2];
11453 res->block0[
i] = r->block0[i-2];
11454 res->block1[
i] = r->block1[i-2];
11455 res->wvhdl[
i] = r->wvhdl[i-2];
11460 res->block0[0] = 1;
11461 res->wvhdl[0] = (
int *)
omAlloc(res->N*
sizeof(
int));
11462 for (
int i=0; i<res->N; ++
i)
11463 res->wvhdl[0][i] = 1;
11467 res->wvhdl[1] =
NULL;
11469 for (
int i=
rBlocks(res); i>1; --
i)
11482 #ifndef SING_NDEBUG 11483 WarnS(
"error in nc_rComplete");
11620 #ifdef HAVE_TAIL_BIN 11632 if (tailBin !=
NULL)
11636 if (t_kHEdge !=
NULL)
11638 if (t_kNoether !=
NULL)
11647 Timings
for the different possibilities of posInT:
11648 T15 EDL DL EL L 1-2-3
11649 Gonnet 43.26 42.30 38.34 41.98 38.40 100.04
11650 Hairer_2_1 1.11 1.15 1.04 1.22 1.08 4.7
11651 Twomat3 1.62 1.69 1.70 1.65 1.54 11.32
11652 ahml 4.48 4.03 4.03 4.38 4.96 26.50
11653 c7 15.02 13.98 15.16 13.24 17.31 47.89
11654 c8 505.09 407.46 852.76 413.21 499.19 n/
a 11655 f855 12.65 9.27 14.97 8.78 14.23 33.12
11656 gametwo6 11.47 11.35 14.57 11.20 12.02 35.07
11657 gerhard_3 2.73 2.83 2.93 2.64 3.12 6.24
11658 ilias13 22.89 22.46 24.62 20.60 23.34 53.86
11659 noon8 40.68 37.02 37.99 36.82 35.59 877.16
11660 rcyclic_19 48.22 42.29 43.99 45.35 51.51 204.29
11661 rkat9 82.37 79.46 77.20 77.63 82.54 267.92
11662 schwarz_11 16.46 16.81 16.76 16.81 16.72 35.56
11663 test016 16.39 14.17 14.40 13.50 14.26 34.07
11664 test017 34.70 36.01 33.16 35.48 32.75 71.45
11665 test042 10.76 10.99 10.27 11.57 10.45 23.04
11666 test058 6.78 6.75 6.51 6.95 6.22 9.47
11667 test066 10.71 10.94 10.76 10.61 10.56 19.06
11668 test073 10.75 11.11 10.17 10.79 8.63 58.10
11669 test086 12.23 11.81 12.88 12.24 13.37 66.68
11670 test103 5.05 4.80 5.47 4.64 4.89 11.90
11671 test154 12.96 11.64 13.51 12.46 14.61 36.35
11672 test162 65.27 64.01 67.35 59.79 67.54 196.46
11673 test164 7.50 6.50 7.68 6.70 7.96 17.13
11674 virasoro 3.39 3.50 3.35 3.47 3.70 7.66
11684 if (length==-1)
return 0;
11687 int op=p.GetpFDeg();
11688 int ol = p.GetpLength();
11690 if (
set[length].ecart < o)
11692 if (
set[length].ecart == o)
11694 int oo=
set[
length].GetpFDeg();
11695 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
11706 if (
set[an].ecart > o)
11708 if (
set[an].ecart == o)
11710 int oo=
set[an].GetpFDeg();
11712 || ((oo==op) && (
set[an].
pLength > ol)))
11718 if (
set[i].ecart > o)
11720 else if (
set[i].ecart == o)
11722 int oo=
set[
i].GetpFDeg();
11724 || ((oo == op) && (
set[i].
pLength > ol)))
11738 if (length==-1)
return 0;
11740 int op=p.GetpFDeg();
11741 int ol = p.GetpLength();
11743 int oo=
set[
length].GetpFDeg();
11744 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
11754 int oo=
set[an].GetpFDeg();
11756 || ((oo==op) && (
set[an].
pLength > ol)))
11761 int oo=
set[
i].GetpFDeg();
11763 || ((oo == op) && (
set[i].
pLength > ol)))
11774 int ol = p.GetpLength();
11777 if (
set[length].length<p.length)
11788 if (
set[an].
pLength>ol)
return an;
11809 if (strat->
red==redFirst)
PrintS(
"redFirst\n");
11811 else if (strat->
red==redEcart)
PrintS(
"redEcart\n");
11813 else Print(
"%p\n",(
void*)strat->
red);
11832 #ifdef HAVE_MORE_POS_IN_T 11863 else if (strat->
enterS==enterSMora)
PrintS(
"enterSMora\n");
11864 else if (strat->
enterS==enterSMoraNF)
PrintS(
"enterSMoraNF\n");
11870 PrintS(
"initEcartPair: ");
11874 Print(
"homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
11876 Print(
"honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
11882 Print(
"posInLDependsOnLength=%d\n",
11914 PrintS(
"currRing->pFDeg: ");
11929 PrintS(
"ecartWeights: ");
11936 #ifndef SING_NDEBUG 11941 #ifdef HAVE_SHIFTBBA 11955 #ifdef HAVE_SHIFTBBA 11972 #ifdef HAVE_SHIFTBBA 12064 #ifdef HAVE_SHIFTBBA 12074 for (i=0; i<=strat->
sl; i++)
12076 memset(&h,0,
sizeof(h));
12079 h.sev = strat->
sevS[
i];
12093 #ifdef HAVE_SHIFTBBA 12169 #ifdef HAVE_SHIFTBBA 12209 qfromQ = strat->
fromQ[
i];
12221 enterOnePairShift(qq, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, 0, i, uptodeg, lV);
12223 for (j=1; j<= toInsert; j++)
12238 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, i, uptodeg, lV);
12243 #ifdef HAVE_SHIFTBBA 12285 for (; j<= toInsert; j++)
12302 enterOnePairShift(q, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, -1, uptodeg, lV);
12307 #ifdef HAVE_SHIFTBBA 12311 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)
12335 int qfromQ = qisFromQ;
12344 Lp.ecart=0; Lp.length=0;
12353 if (!
isInV(Lp.lcm, lV))
12358 PrintS(
"V crit applied to q = ");
12374 if((!((ecartq>0)&&(ecart>0)))
12397 Lp.ecart =
si_max(ecart,ecartq);
12398 if (strat->
fromT && (ecartq>ecart))
12416 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
12421 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12465 if (strat->
fromT && (ecartq>ecart))
12478 for(j = strat->
Bl;j>=0;j--)
12480 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
12484 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12508 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (qfromQ!=0))
12575 if ( (atR >= 0) && (shiftcount==0) && (ifromS >=0) )
12594 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
12600 #ifdef HAVE_SHIFTBBA 12613 if ( (!strat->
fromT)
12622 clearS(h,h_sev, &j,&k,strat);
12631 #ifdef HAVE_SHIFTBBA 12652 for (j=0; j<=
k; j++)
12654 if (!strat->
fromQ[j])
12667 for (j=0; j<=
k; j++)
12680 for (j=0; j<=
k; j++)
12705 #ifdef HAVE_SHIFTBBA 12725 atT = strat->
posInT(strat->
T, strat->
tl, p);
12732 for (i=1; i<=toInsert; i++)
12743 atT = strat->
posInT(strat->
T, strat->
tl, qq);
12752 #ifdef HAVE_SHIFTBBA 12759 p = h = L->GetLmTailRing();
12761 return L->GetLmCurrRing();
12768 Ln.pLength = L->GetpLength() - 1;
12776 while(!Ln.IsNull())
12780 Ln.SetShortExpVector();
12786 With = &(strat->
T[
j]);
12791 if (With ==
NULL)
break;
12807 pNext(h) = Ln.LmExtractAndIter();
12810 }
while (!Ln.IsNull());
12813 if (Ln.IsNull())
goto all_done;
12814 if (! withT) With_s.Init(
currRing);
12816 pNext(h) = Ln.LmExtractAndIter();
12831 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)
poly redtailBbaBound(LObject *L, int pos, kStrategy strat, int bound, BOOLEAN withT, BOOLEAN normalize)
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
denominator_list_s * denominator_list
int posInT_pLength(const TSet set, const int length, LObject &p)
#define omRealloc0Size(addr, o_size, size)
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
unsigned long p_GetMaxExpL(poly p, const ring r, unsigned long l_max)
return the maximal exponent of p in form of the maximal long var
static FORCE_INLINE number n_IntMod(number a, number b, const coeffs r)
for r a field, return n_Init(0,r) always: n_Div(a,b,r)*b+n_IntMod(a,b,r)==a n_IntMod(a,b,r) >=0
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
int posInSMonFirst(const kStrategy strat, const int length, const poly p)
KINLINE TObject ** initR()
const CanonicalForm int s
int posInTrg0(const TSet set, const int length, LObject &p)
void omMergeStickyBinIntoBin(omBin sticky_bin, omBin into_bin)
void initSbaPos(kStrategy strat)
poly redtail(LObject *L, int pos, kStrategy strat)
void enterOnePairShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS, int, int lV)
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
void enterSSba(LObject &p, int atS, kStrategy strat, int atR)
int posInL17(const LSet set, const int length, LObject *p, const kStrategy)
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
int itoInsert(poly p, int uptodeg, int lV, const ring r)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
int redRing(LObject *h, kStrategy strat)
void enterSMora(LObject &p, int atS, kStrategy strat, int atR=-1)
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
static FORCE_INLINE BOOLEAN n_IsUnit(number n, const coeffs r)
TRUE iff n has a multiplicative inverse in the given coeff field/ring r.
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
static CanonicalForm bound(const CFMatrix &M)
int posInT2(const TSet set, const int length, LObject &p)
long pLDeg1(poly p, int *l, const ring r)
static int p_Cmp(poly p1, poly p2, ring r)
KINLINE unsigned long * initsevT()
#define TEST_OPT_DEGBOUND
void pLcmRat(poly a, poly b, poly m, int rat_shift)
void initBuchMoraPos(kStrategy strat)
void clearSbatch(poly h, int k, int pos, kStrategy strat)
BOOLEAN(* rewCrit1)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
BOOLEAN p_LmCheckIsFromRing(poly p, ring r)
int posInL11Ring(const LSet set, const int length, LObject *p, const kStrategy)
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
int posInL11Ringls(const LSet set, const int length, LObject *p, const kStrategy)
pLDegProc pOrigLDeg_TailRing
#define idDelete(H)
delete an ideal
long pLDeg1c_Totaldegree(poly p, int *l, const ring r)
int posInLF5CRing(const LSet set, int start, const int length, LObject *p, const kStrategy)
static int * initS_2_R(const int maxnr)
#define pLtCmpOrdSgnDiffM(p, q)
void messageStat(int hilbcount, kStrategy strat)
void postReduceByMonSig(LObject *h, kStrategy strat)
static int min(int a, int b)
int posInL15Ring(const LSet set, const int length, LObject *p, const kStrategy)
static int si_min(const int a, const int b)
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly, kStrategy strat, int start=0)
long pLDeg1c(poly p, int *l, const ring r)
int posInIdealMonFirst(const ideal F, const poly p, int start, int end)
Compatiblity layer for legacy polynomial operations (over currRing)
int posInT1(const TSet set, const int length, LObject &p)
long totaldegreeWecart(poly p, ring r)
void chainCritNormal(poly p, int ecart, kStrategy strat)
void initenterpairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
KINLINE int ksReducePolyTail(LObject *PR, TObject *PW, LObject *Red)
int posInL17Ring(const LSet set, const int length, LObject *p, const kStrategy)
int posInLrg0(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
void initBuchMora(ideal F, ideal Q, kStrategy strat)
static poly p_Mult_mm(poly p, poly m, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
static BOOLEAN rIsSyzIndexRing(const ring r)
void cancelunit1(LObject *p, int *suc, int index, kStrategy strat)
int posInL15(const LSet set, const int length, LObject *p, const kStrategy)
void initenterpairsSigRing(poly h, poly hSig, int hFrom, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void enterOnePairSig(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
poly prMoveR(poly &p, ring src_r, ring dest_r)
void reorderS(int *suc, kStrategy strat)
static int rGetCurrSyzLimit(const ring r)
void initenterstrongPairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
static BOOLEAN p_LmExpVectorAddIsOk(const poly p1, const poly p2, const ring r)
static poly pp_Mult_nn(poly p, number n, const ring r)
int posInL13(const LSet set, const int length, LObject *p, const kStrategy)
static BOOLEAN rIsRatGRing(const ring r)
#define TEST_OPT_CONTENTSB
BOOLEAN posInLDependsOnLength
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
int kFindInT(poly p, TSet T, int tlength)
returns index of p in TSet, or -1 if not found
int(* posInLSba)(const LSet set, const int length, LObject *L, const kStrategy strat)
#define omFreeSize(addr, size)
int posInL110Ring(const LSet set, const int length, LObject *p, const kStrategy)
void cleanTSbaRing(kStrategy strat)
static short rVar(const ring r)
#define rVar(r) (r->N)
static int pDivComp(poly p, poly q)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
int ksCheckCoeff(number *a, number *b)
BOOLEAN sbaCheckGcdPair(LObject *h, kStrategy strat)
void initSyzRules(kStrategy strat)
int posInT15Ring(const TSet set, const int length, LObject &p)
long pLDeg0c(poly p, int *l, const ring r)
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
static unsigned long p_GetMaxExp(const unsigned long l, const ring r)
void initenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void initSL(ideal F, ideal Q, kStrategy strat)
ring rModifyRing(ring r, BOOLEAN omit_degree, BOOLEAN try_omit_comp, unsigned long exp_limit)
void scComputeHC(ideal S, ideal Q, int ak, poly &hEdge, ring tailRing)
int posInLRing(const LSet set, const int length, LObject *p, const kStrategy)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
#define pCmp(p1, p2)
pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2))) ...
static poly pp_Mult_mm(poly p, poly m, const ring r)
static BOOLEAN p_HasNotCF_Lift(poly p1, poly p2, const ring r)
p_HasNotCF for the IDLIFT case: ignore component
denominator_list DENOMINATOR_LIST
void enterpairsSpecial(poly h, int k, int ecart, int pos, kStrategy strat, int atR=-1)
poly pMove2CurrTail(poly p, kStrategy strat)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
#define pHasNotCF(p1, p2)
void initSSpecialSba(ideal F, ideal Q, ideal P, kStrategy strat)
static long p_Totaldegree(poly p, const ring r)
void deleteInS(int i, kStrategy strat)
static BOOLEAN rField_is_Domain(const ring r)
pShallowCopyDeleteProc p_shallow_copy_delete
BOOLEAN(* rewCrit3)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
ring sbaRing(kStrategy strat, const ring r, BOOLEAN, int)
poly preIntegerCheck(const ideal Forig, const ideal Q)
used for GB over ZZ: look for constant and monomial elements in the ideal background: any known const...
void initSLSba(ideal F, ideal Q, kStrategy strat)
void cancelunit(LObject *L, BOOLEAN inNF)
poly kCreateZeroPoly(long exp[], long cabsind, poly *t_p, ring leadRing, ring tailRing)
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
poly nc_CreateShortSpoly(poly p1, poly p2, const ring r)
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
poly redtailBba(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
int posInLF5C(const LSet, const int, LObject *, const kStrategy strat)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
long pLDeg1_Deg(poly p, int *l, const ring r)
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR, int uptodeg, int lV)
static unsigned long * initsevS(const int maxnr)
ring rAssure_c_dp(const ring r)
int posInL17_cRing(const LSet set, const int length, LObject *p, const kStrategy)
int posInT15(const TSet set, const int length, LObject &p)
int(* red)(LObject *L, kStrategy strat)
void initBuchMoraPosRing(kStrategy strat)
int nextZeroSimplexExponent(long exp[], long ind[], long cexp[], long cind[], long *cabsind, long step[], long bound, long N)
int redHomog(LObject *h, kStrategy strat)
static poly redBba1(poly h, int maxIndex, kStrategy strat)
int(* posInT)(const TSet T, const int tl, LObject &h)
static number p_SetCoeff(poly p, number n, ring r)
void HEckeTest(poly pp, kStrategy strat)
#define omCheckBinAddrSize(addr, size)
poly p_Sub(poly p1, poly p2, const ring r)
void chainCritSig(poly p, int, kStrategy strat)
static void p_LmFree(poly p, ring)
void enterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
#define pGetComp(p)
Component.
int posInL110(const LSet set, const int length, LObject *p, const kStrategy)
#define pLtCmpOrdSgnDiffP(p, q)
int posInT0(const TSet, const int length, LObject &)
static poly p_Copy(poly p, const ring r)
returns a copy of p
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void enterExtendedSpoly(poly h, kStrategy strat)
static FORCE_INLINE number n_Ann(number a, const coeffs r)
if r is a ring with zero divisors, return an annihilator!=0 of b otherwise return NULL ...
BOOLEAN(* syzCrit)(poly sig, unsigned long not_sevSig, kStrategy strat)
char completeReduce_retry
void initenterpairsShift(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
void kStratInitChangeTailRing(kStrategy strat)
static poly redBba(poly h, int maxIndex, kStrategy strat)
int posInLSig(const LSet set, const int length, LObject *p, const kStrategy)
long pLDeg1c_Deg(poly p, int *l, const ring r)
pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring, ring)
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
BOOLEAN kPosInLDependsOnLength(int(*pos_in_l)(const LSet set, const int length, LObject *L, const kStrategy strat))
void enterT(LObject &p, kStrategy strat, int atT)
poly prMapR(poly src, nMapFunc nMap, ring src_r, ring dest_r)
int redHoney(LObject *h, kStrategy strat)
void p_Cleardenom_n(poly ph, const ring r, number &c)
poly p_LPshift(poly p, int sh, int uptodeg, int lV, const ring r)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
void updateSShift(kStrategy strat, int uptodeg, int lV)
#define pFalseReturn(cond)
BOOLEAN p_CheckPolyRing(poly p, ring r)
#define omReallocSize(addr, o_size, size)
void(* initEcart)(TObject *L)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pGetExp(p, i)
Exponent.
void(* enterOnePair)(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
void initS(ideal F, ideal Q, kStrategy strat)
void enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV)
int posInT11(const TSet set, const int length, LObject &p)
static int rBlocks(ring r)
void initSSpecial(ideal F, ideal Q, ideal P, kStrategy strat)
int posInT17_c(const TSet set, const int length, LObject &p)
long p_Deg(poly a, const ring r)
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
void chainCritRing(poly p, int, kStrategy strat)
int posInT11Ring(const TSet set, const int length, LObject &p)
KINLINE TObject * S_2_T(int i)
void kBucketDestroy(kBucket_pt *bucket_pt)
void initEcartPairMora(LObject *Lp, poly, poly, int ecartF, int ecartG)
#define TEST_OPT_INTSTRATEGY
static void p_SetCompP(poly p, int i, ring r)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define TEST_OPT_NOT_SUGAR
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ...
static void enlargeT(TSet &T, TObject **&R, unsigned long *&sevT, int &length, const int incr)
const CanonicalForm CFMap CFMap & N
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
static int max(int a, int b)
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int syzComp
BOOLEAN isInPairsetL(int length, poly p1, poly p2, int *k, kStrategy strat)
void enterExtendedSpolySig(poly h, poly hSig, kStrategy strat)
void initHilbCrit(ideal, ideal, intvec **hilb, kStrategy strat)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
void enterOnePairSpecial(int i, poly p, int ecart, kStrategy strat, int atR=-1)
long p_WFirstTotalDegree(poly p, const ring r)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
void initEcartBBA(TObject *h)
int posInT17Ring(const TSet set, const int length, LObject &p)
void messageStatSBA(int hilbcount, kStrategy strat)
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
void enterOneZeroPairRing(poly f, poly t_p, poly p, int ecart, kStrategy strat, int atR=-1)
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z:...
long pLDeg0(poly p, int *l, const ring r)
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
#define pp_Test(p, lmRing, tailRing)
BOOLEAN pCompareChain(poly p, poly p1, poly p2, poly lcm, const ring R)
Returns TRUE if.
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
long kHomModDeg(poly p, ring r)
poly pMoveCurrTail2poly(poly p, kStrategy strat)
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
BOOLEAN enterOneStrongPolySig(int i, poly p, poly sig, int, int, kStrategy strat, int atR)
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted ...
static long p_FDeg(const poly p, const ring r)
static int p_LmCmp(poly p, poly q, const ring r)
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject *T, unsigned long expbound)
int posInL0(const LSet set, const int length, LObject *p, const kStrategy)
#define pIsConstant(p)
like above, except that Comp might be != 0
TObject * kFindDivisibleByInS(kStrategy strat, int pos, LObject *L, TObject *T, long ecart)
void initBuchMoraCrit(kStrategy strat)
static poly p_ShallowCopyDelete(poly p, const ring r, omBin bin)
static int si_max(const int a, const int b)
int posInL17_c(const LSet set, const int length, LObject *p, const kStrategy)
static void p_ExpVectorCopy(poly d_p, poly s_p, const ring r)
void exitSba(kStrategy strat)
void rDebugPrint(const ring r)
void PrintS(const char *s)
void kDebugPrint(kStrategy strat)
Output some debug info about a given strategy.
int isInV(poly p, int lV)
void deleteHC(LObject *L, kStrategy strat, BOOLEAN fromNext)
void superenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
static void p_ExpVectorAdd(poly p1, poly p2, const ring r)
int posInT17(const TSet set, const int length, LObject &p)
static poly p_LmFreeAndNext(poly p, ring)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
void deleteInSSba(int i, kStrategy strat)
static FORCE_INLINE int n_DivComp(number a, number b, const coeffs r)
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static FORCE_INLINE number n_Lcm(number a, number b, const coeffs r)
in Z: return the lcm of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
omBin omGetStickyBinOfBin(omBin bin)
void initBuchMoraShift(ideal F, ideal Q, kStrategy strat)
BOOLEAN rHasMixedOrdering(const ring r)
void enterT_strong(LObject &p, kStrategy strat, int atT)
static void enlargeL(LSet *L, int *length, const int incr)
static BOOLEAN _p_LmDivisibleByPart(poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
static int index(p_Length length, p_Ord ord)
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
void rChangeCurrRing(ring r)
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether)
poly redtailBba_Z(LObject *L, int pos, kStrategy strat)
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat)
BOOLEAN arriRewCriterion(poly, unsigned long, poly, kStrategy strat, int start=0)
void enterSMoraNF(LObject &p, int atS, kStrategy strat, int atR=-1)
#define rRing_has_Comp(r)
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
static void p_Delete(poly *p, const ring r)
static FORCE_INLINE number n_ExtGcd(number a, number b, number *s, number *t, const coeffs r)
beware that ExtGCD is only relevant for a few chosen coeff. domains and may perform something unexpec...
unsigned long p_GetShortExpVector(const poly p, const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
poly p_LPshiftT(poly p, int sh, int uptodeg, int lV, kStrategy strat, const ring r)
void kMergeBintoLSba(kStrategy strat)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
void initenterzeropairsRing(poly p, int ecart, kStrategy strat, int atR)
poly(* pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r, omBin dest_bin)
returns a poly from dest_r which is a ShallowCopy of s_p from source_r assumes that source_r->N == de...
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int)
#define TEST_OPT_SUGARCRIT
BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat)
void(* chainCrit)(poly p, int ecart, kStrategy strat)
void initPairtest(kStrategy strat)
long pLDegb(poly p, int *l, const ring r)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void postReduceByMon(LObject *h, kStrategy strat)
used for GB over ZZ: intermediate reduction by monomial elements background: any known constant eleme...
BOOLEAN p_CheckIsFromRing(poly p, ring r)
static BOOLEAN rField_is_Ring(const ring r)
void cleanT(kStrategy strat)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
void pEnlargeSet(poly **p, int l, int increment)
long pLDeg1_Totaldegree(poly p, int *l, const ring r)
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
int redEcart(LObject *h, kStrategy strat)
#define pLtCmpOrdSgnEqP(p, q)
BOOLEAN rHasGlobalOrdering(const ring r)
void rDelete(ring r)
unconditionally deletes fields in r
long ind_fact_2(long arg)
int posInSyz(const kStrategy strat, poly sig)
BOOLEAN enterOneStrongPoly(int i, poly p, int, int, kStrategy strat, int atR, bool enterTstrong)
int posInT110(const TSet set, const int length, LObject &p)
#define pInit()
allocates a new monomial and initializes everything to 0
#define TEST_OPT_CANCELUNIT
void initSbaCrit(kStrategy strat)
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
#define omSizeWOfBin(bin_ptr)
void updateS(BOOLEAN toT, kStrategy strat)
int posInT110Ring(const TSet set, const int length, LObject &p)
static bool rIsSCA(const ring r)
void completeReduce(kStrategy strat, BOOLEAN withT)
int posInL0Ring(const LSet set, const int length, LObject *p, const kStrategy)
#define REDTAIL_CANONICALIZE
BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat)
void chainCritOpt_1(poly, int, kStrategy strat)
void rKillModifiedRing(ring r)
long maxdegreeWecart(poly p, int *l, ring r)
void enterOnePairLift(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
static void p_Setm(poly p, const ring r)
void updateResult(ideal r, ideal Q, kStrategy strat)
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
KINLINE TObject * s_2_t(int i)
long pLDeg1_WFirstTotalDegree(poly p, int *l, const ring r)
int redFirst(LObject *h, kStrategy strat)
int posInLSpecial(const LSet set, const int length, LObject *p, const kStrategy)
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring tailRing)
static nc_type & ncRingType(nc_struct *p)
static intset initec(const int maxnr)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
static int pDivCompRing(poly p, poly q)
long pLDeg1c_WFirstTotalDegree(poly p, int *l, const ring r)
poly pCopyL2p(LObject H, kStrategy strat)
int idElem(const ideal F)
count non-zero elements
int dReportError(const char *fmt,...)
#define ALLOW_PROD_CRIT(A)
static poly p_Neg(poly p, const ring r)
static void p_LmDelete(poly p, const ring r)
BOOLEAN isInPairsetB(poly q, int *k, kStrategy strat)
static void initenterstrongPairsSig(poly h, poly hSig, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
long p_WTotaldegree(poly p, const ring r)
static poly redMora(poly h, int maxIndex, kStrategy strat)
void kMergeBintoL(kStrategy strat)
void p_wrp(poly p, ring lmRing, ring tailRing)
void p_Write(poly p, ring lmRing, ring tailRing)
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
int kFindDivisibleByInT(const kStrategy strat, const LObject *L, const int start)
return -1 if no divisor is found number of first divisor in T, otherwise
BOOLEAN newHEdge(kStrategy strat)
int posInT19(const TSet set, const int length, LObject &p)
poly redtailBbaShift(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
void initEcartNormal(TObject *h)
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r1, const ring r2)
static LSet initL(int nr=setmaxL)
static poly p_Add_q(poly p, poly q, const ring r)
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
int posInT_EcartpLength(const TSet set, const int length, LObject &p)
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
KINLINE poly kNoetherTail()
static BOOLEAN sugarDivisibleBy(int ecart1, int ecart2)
void enterOnePairRing(int i, poly p, int, int isFromQ, kStrategy strat, int atR=-1)
void enterOnePairManyShifts(int i, poly p, int ecart, int isFromQ, kStrategy strat, int, int uptodeg, int lV)
poly p_Cleardenom(poly p, const ring r)
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
void chainCritPart(poly p, int ecart, kStrategy strat)
void nKillChar(coeffs r)
undo all initialisations
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static poly p_Mult_q(poly p, poly q, const ring r)
void enterOnePairSelfShifts(poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int, int uptodeg, int lV)
void exitBuchMora(kStrategy strat)
pFDegProc pOrigFDeg_TailRing
#define ENTER_USE_MEMMOVE
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
void enterOnePairSigRing(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
static int p_LtCmpNoAbs(poly p, poly q, const ring r)
int posInT17_cRing(const TSet set, const int length, LObject &p)
int posInT13(const TSet set, const int length, LObject &p)
void enterSyz(LObject &p, kStrategy strat, int atT)
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
BOOLEAN p_OneComp(poly p, const ring r)
return TRUE if all monoms have the same component
#define pCopy(p)
return a copy of the poly
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
void kBucket_Add_q(kBucket_pt bucket, poly q, int *l)
Add to Bucket a poly ,i.e. Bpoly == q+Bpoly.
poly p_GetMaxExpP(poly p, const ring r)
return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0...
int posInLSigRing(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN pCompareChainPart(poly p, poly p1, poly p2, poly lcm, const ring R)
KINLINE long GetpFDeg() const