21 #define EXT_POLY_NEW 0 51 #define ENTER_USE_MEMMOVE 91 #ifdef ENTER_USE_MYMEMMOVE 92 inline void _my_memmove_d_gt_s(
unsigned long* d,
unsigned long*
s,
long l)
94 REGISTER unsigned long* _dl = (
unsigned long*) d;
95 REGISTER unsigned long* _sl = (
unsigned long*) s;
106 inline void _my_memmove_d_lt_s(
unsigned long* d,
unsigned long*
s,
long l)
109 REGISTER unsigned long* _dl = (
unsigned long*) d;
110 REGISTER unsigned long* _sl = (
unsigned long*)
s;
121 inline void _my_memmove(
void* d,
void*
s,
long l)
123 unsigned long _d = (
unsigned long) d;
124 unsigned long _s = (
unsigned long)
s;
125 unsigned long _l = ((
l) + SIZEOF_LONG - 1) >> LOG_SIZEOF_LONG;
127 if (_d > _s) _my_memmove_d_gt_s(_d, _s, _l);
128 else _my_memmove_d_lt_s(_d, _s, _l);
132 #define memmove(d,s,l) _my_memmove(d, s, l) 139 #define pDivComp_EQUAL 2 140 #define pDivComp_LESS 1 141 #define pDivComp_GREATER -1 142 #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))
204 unsigned long la, lb;
205 unsigned long divmask =
currRing->divmask;
206 for (i=0; i<
currRing->VarL_Size; i++)
215 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
222 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
229 if (b) {
return -1; }
250 poly
p = L->GetLmTailRing();
253 if (L->bucket !=
NULL)
291 L->ecart = L->pLDeg() - L->GetpFDeg();
300 L->ecart = L->pLDeg(strat->
LDegLast) - L->GetpFDeg();
340 ring r = L->tailRing;
341 poly
p = L->GetLmTailRing();
370 number eins=
nCopy(lc);
420 number eins=
nInit(1);
508 inline static unsigned long*
initsevS (
const int maxnr)
510 return (
unsigned long*)
omAlloc0(maxnr*
sizeof(
unsigned long));
514 return (
int*)
omAlloc0(maxnr*
sizeof(
int));
518 int &
length,
const int incr)
523 assume((length+incr) > 0);
527 (length+incr)*
sizeof(
TObject));
529 sevT = (
unsigned long*)
omReallocSize(sevT, length*
sizeof(
long*),
530 (length+incr)*
sizeof(
long*));
533 (length+incr)*
sizeof(
TObject*));
534 for (i=length-1;i>=0;i--) R[T[i].i_r] = &(T[i]);
548 for (j=0; j<=strat->
tl; j++)
552 if (strat->
T[j].max_exp !=
NULL)
562 if (strat->
T[j].t_p !=
NULL)
570 if (
currRing->isLPring && strat->
T[j].shift > 0)
579 if (p == strat->
S[i])
581 if (strat->
T[j].t_p !=
NULL)
583 if (p_shallow_copy_delete!=
NULL)
607 for (j=0; j<=strat->
tl; j++)
611 if (strat->
T[j].max_exp !=
NULL)
621 if (strat->
T[j].t_p !=
NULL)
633 if (p == strat->
S[i])
635 if (strat->
T[j].t_p !=
NULL)
659 assume(((*length)+incr)>0);
662 ((*length)+incr)*
sizeof(
LObject));
682 if ((*k) < 0)
return FALSE;
683 if (((p1 == (*p).p1) && (p2 == (*p).p2))
684 || ((p1 == (*p).p2) && (p2 == (*p).p1)))
703 if ((*k) < 0)
return FALSE;
715 for (i=0; i<=tlength; i++)
717 if (T[i].p == p)
return i;
728 if (i >= 0)
return i;
731 while (strat !=
NULL);
744 #define kFalseReturn(x) do { if (!x) return FALSE;} while (0) 747 static const char* kTest_LmEqual(poly
p, poly
t_p, ring
tailRing)
750 for (i=1; i<=tailRing->N; i++)
753 return "Lm[i] different";
756 return "Lm[0] different";
758 return "Lm.next different";
760 return "Lm.coeff different";
769 r_assume(strat_tailRing == tailRing);
791 if (
T->t_p ==
NULL &&
i > 0)
797 const char* msg = kTest_LmEqual(
T->p,
T->t_p,
T->tailRing);
808 if (
T->t_p !=
NULL &&
i >= 0 && TN ==
'T')
812 if (
T->max_exp !=
NULL)
813 return dReportError(
"%c[%d].max_exp is not NULL as it should be", TN,
i);
817 if (
T->max_exp ==
NULL)
829 p_Setm(test_max, tailRing);
841 if (
T->p ==
NULL &&
i > 0)
857 if ((
i >= 0) && (
T->pLength != 0)
862 return dReportError(
"%c[%d] pLength error: has %d, specified to have %d",
867 if (
i >= 0 && (TN ==
'T' || TN ==
'L'))
870 if (
T->FDeg !=
T->pFDeg())
874 return dReportError(
"%c[%d] FDeg error: has %d, specified to have %d",
875 TN,
i ,
T->pFDeg(), d);
880 if (
i >= 0 && TN ==
'T')
916 if (L->bucket !=
NULL)
918 kFalseReturn(
kbTest(L->bucket));
919 r_assume(L->bucket->bucket_ring == L->tailRing);
926 if (testp!=2) kFalseReturn(
kTest_T(L, strat_tailRing, lpos,
'L'));
935 return dReportError(
"L[%d] wrong sev: has %o, specified to have %o",
944 else if (tlength > 0 &&
T !=
NULL && (lpos >=0) && (testp!=2))
966 -1, strat->
T, strat->
tl));
969 if (strat->
T !=
NULL)
971 for (i=0; i<=strat->
tl; i++)
980 if (strat->
L !=
NULL)
985 for (i=0; i<=strat->
Ll; i++)
989 strat->
T, strat->
tl));
994 for (i=0; i<=strat->
Ll; i++)
997 strat->
L[i].Next() != strat->
tail,
i,
998 strat->
T, strat->
tl));
1009 if (strat->
S !=
NULL)
1019 for (i=0; i<=strat->
sl; i++)
1021 if (strat->
S[i] !=
NULL &&
1024 return dReportError(
"S[%d] wrong sev: has %o, specified to have %o",
1037 kFalseReturn(
kTest(strat));
1040 for (i=0; i<=strat->
tl; i++)
1042 if (strat->
T[i].i_r < 0 || strat->
T[i].i_r > strat->
tl)
1043 return dReportError(
"strat->T[%d].i_r == %d out of bounds", i,
1045 if (strat->
R[strat->
T[i].i_r] != &(strat->
T[i]))
1046 return dReportError(
"T[%d].i_r with R out of sync", i);
1049 if (strat->
S !=
NULL)
1051 for (i=0; i<=strat->
sl; i++)
1056 if (strat->
S_2_R[i] != strat->
T[j].i_r)
1058 i, strat->
S_2_R[i], j, strat->
T[j].i_r);
1062 #ifdef HAVE_SHIFTBBA 1065 for (i=0; i<=strat->
Ll; i++)
1067 if (strat->
L[i].p1 !=
NULL && strat->
L[i].p2)
1069 if (strat->
L[i].i_r1 < 0 ||
1070 strat->
L[i].i_r1 > strat->
tl ||
1071 strat->
L[i].T_1(strat)->p != strat->
L[
i].p1)
1073 if (strat->
L[i].i_r2 < 0 ||
1074 strat->
L[i].i_r2 > strat->
tl ||
1075 strat->
L[i].T_2(strat)->p != strat->
L[
i].p2)
1080 if (strat->
L[i].i_r1 != -1)
1082 if (strat->
L[i].i_r2 != -1)
1085 if (strat->
L[i].i_r != -1)
1098 #ifdef ENTER_USE_MEMMOVE 1099 memmove(&(strat->
S[i]), &(strat->
S[i+1]), (strat->
sl - i)*
sizeof(poly));
1100 memmove(&(strat->
ecartS[i]),&(strat->
ecartS[i+1]),(strat->
sl - i)*
sizeof(
int));
1101 memmove(&(strat->
sevS[i]),&(strat->
sevS[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1102 memmove(&(strat->
S_2_R[i]),&(strat->
S_2_R[i+1]),(strat->
sl - i)*
sizeof(
int));
1105 for (j=i; j<strat->
sl; j++)
1107 strat->
S[
j] = strat->
S[j+1];
1115 #ifdef ENTER_USE_MEMMOVE 1116 memmove(&(strat->
lenS[i]),&(strat->
lenS[i+1]),(strat->
sl - i)*
sizeof(
int));
1118 for (j=i; j<strat->
sl; j++) strat->
lenS[j] = strat->
lenS[j+1];
1123 #ifdef ENTER_USE_MEMMOVE 1126 for (j=i; j<strat->
sl; j++) strat->
lenSw[j] = strat->
lenSw[j+1];
1131 #ifdef ENTER_USE_MEMMOVE 1132 memmove(&(strat->
fromQ[i]),&(strat->
fromQ[i+1]),(strat->
sl - i)*
sizeof(
int));
1134 for (j=i; j<strat->
sl; j++)
1150 #ifdef ENTER_USE_MEMMOVE 1151 memmove(&(strat->
S[i]), &(strat->
S[i+1]), (strat->
sl - i)*
sizeof(poly));
1152 memmove(&(strat->
sig[i]), &(strat->
sig[i+1]), (strat->
sl - i)*
sizeof(poly));
1153 memmove(&(strat->
ecartS[i]),&(strat->
ecartS[i+1]),(strat->
sl - i)*
sizeof(
int));
1154 memmove(&(strat->
sevS[i]),&(strat->
sevS[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1155 memmove(&(strat->
sevSig[i]),&(strat->
sevSig[i+1]),(strat->
sl - i)*
sizeof(
unsigned long));
1156 memmove(&(strat->
S_2_R[i]),&(strat->
S_2_R[i+1]),(strat->
sl - i)*
sizeof(
int));
1159 for (j=i; j<strat->
sl; j++)
1161 strat->
S[
j] = strat->
S[j+1];
1162 strat->
sig[
j] = strat->
sig[j+1];
1171 #ifdef ENTER_USE_MEMMOVE 1172 memmove(&(strat->
lenS[i]),&(strat->
lenS[i+1]),(strat->
sl - i)*
sizeof(
int));
1174 for (j=i; j<strat->
sl; j++) strat->
lenS[j] = strat->
lenS[j+1];
1179 #ifdef ENTER_USE_MEMMOVE 1182 for (j=i; j<strat->
sl; j++) strat->
lenSw[j] = strat->
lenSw[j+1];
1187 #ifdef ENTER_USE_MEMMOVE 1188 memmove(&(strat->
fromQ[i]),&(strat->
fromQ[i+1]),(strat->
sl - i)*
sizeof(
int));
1190 for (j=i; j<strat->
sl; j++)
1241 if (*length > 0 && j < *length)
1243 #ifdef ENTER_USE_MEMMOVE 1244 memmove(&(
set[j]), &(
set[j+1]), (*length - j)*
sizeof(
LObject));
1247 for (i=j; i < (*length); i++)
1252 memset(&(
set[*length]),0,
sizeof(
LObject));
1263 assume(p.FDeg == p.pFDeg());
1268 if (at <= (*length))
1270 memmove(&((*
set)[at+1]), &((*set)[at]), ((*length)-at+1)*
sizeof(
LObject));
1272 for (
i=(*length)+1;
i>=at+1;
i--) (*
set)[
i] = (*set)[
i-1];
1286 h->FDeg = h->pFDeg();
1287 h->ecart = h->pLDeg() - h->FDeg;
1289 h->length=h->pLength=
pLength(h->p);
1294 h->FDeg = h->pFDeg();
1296 h->length=h->pLength=
pLength(h->p);
1301 Lp->FDeg = Lp->pFDeg();
1308 Lp->FDeg = Lp->pFDeg();
1309 (*Lp).ecart =
si_max(ecartF,ecartG);
1310 (*Lp).ecart = (*Lp).ecart- (Lp->FDeg -
p_FDeg((*Lp).lcm,
currRing));
1319 return (ecart1 <= ecart2);
1351 int j,compare,compareCoeff;
1355 h.ecart=0; h.length=0;
1379 for(j = strat->
Bl;j>=0;j--)
1388 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1403 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1416 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
1442 poly si =
pCopy(strat->
S[i]);
1500 h.i_r1 = -1;h.i_r2 = -1;
1510 h.i_r2 = strat->
S_2_R[
i];
1516 posx = strat->
posInL(strat->
B,strat->
Bl,&h,strat);
1533 poly m1, m2,
gcd,si;
1561 for (
int j = 0;
j < strat->
sl;
j++) {
1566 !(strat->
sevS[
j] & ~sev) &&
1608 PrintS(
"\n--- create strong gcd poly: ");
1609 Print(
"\n p: %d", i);
1611 Print(
"\n strat->S[%d]: ", i);
1635 h.i_r1 = -1;h.i_r2 = -1;
1641 h.p1 =
p;h.p2 = strat->
S[
i];
1645 h.i_r2 = strat->
S_2_R[
i];
1656 posx = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
1661 if(h.IsNull())
return FALSE;
1678 if(strat->
sl < 0)
return FALSE;
1680 for(i=0;i<strat->
sl;i++)
1706 if(pairsig!=
NULL &&
pLtCmp(pairsig,h->sig) == 0)
1716 h->i_r1 = -1;h->i_r2 = -1;
1738 poly m1, m2,
gcd,si;
1786 PrintS(
"\n--- create strong gcd poly: ");
1787 Print(
"\n p: %d", i);
1789 Print(
"\n strat->S[%d]: ", i);
1813 if(
pLmCmp(pSigMult,sSigMult) == 0)
1822 if(
pLtCmp(pSigMult,sSigMult)==1)
1842 h.i_r1 = -1;h.i_r2 = -1;
1850 int red_result =
redRing(&h,strat);
1860 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1862 strat->
enterS(h,0,strat,strat->
tl);
1869 h.sig =
pNeg(h.sig);
1877 int red_result =
redRing(&h,strat);
1887 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1890 strat->
enterS(h,0,strat, strat->
tl+1);
1900 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1901 strat->
enterS(h,strat->
sl+1,strat,strat->
tl+1);
1904 h.p1 =
p;h.p2 = strat->
S[
i];
1908 h.i_r2 = strat->
S_2_R[
i];
1938 Lp.ecart=0; Lp.length=0;
1943 #ifndef HAVE_RATGRING 1944 pLcm(p,strat->
S[i],Lp.lcm);
1945 #elif defined(HAVE_RATGRING) 1949 pLcm(p,strat->
S[i],Lp.lcm);
1956 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
1996 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2001 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2056 for(j = strat->
Bl;j>=0;j--)
2058 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2062 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2088 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2155 Lp.p1 = strat->
S[
i];
2169 Lp.i_r1 = strat->
S_2_R[
i];
2183 && (Lp.p->coef!=
NULL))
2187 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2225 Lp.ecart=0; Lp.length=0;
2232 if((!((strat->
ecartS[i]>0)&&(ecart>0)))
2272 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2277 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2328 for(j = strat->
Bl;j>=0;j--)
2330 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
2334 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (strat->
fromQ[i]==0))
2356 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2384 Lp.p1 = strat->
S[
i];
2391 Lp.i_r1 = strat->
S_2_R[
i];
2405 && (Lp.p->coef!=
NULL))
2409 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2433 unsigned long pSigMultNegSev,sSigMultNegSev;
2437 Lp.ecart=0; Lp.length=0;
2442 #ifndef HAVE_RATGRING 2443 pLcm(p,strat->
S[i],Lp.lcm);
2444 #elif defined(HAVE_RATGRING) 2448 pLcm(p,strat->
S[i],Lp.lcm);
2474 PrintS(
"----------------\n");
2477 PrintS(
"----------------\n");
2483 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2504 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2505 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2506 || strat->
rewCrit1(sSigMult,sSigMultNegSev,Lp.lcm,strat,i+1)
2529 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2583 Lp.sevSig = ~pSigMultNegSev;
2590 Lp.sevSig = ~sSigMultNegSev;
2601 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
2615 Lp.checked = strat->
sl+1;
2622 Lp.prod_crit =
TRUE;
2634 PrintS(
"SIGNATURE OF PAIR: ");
2638 Lp.p1 = strat->
S[
i];
2652 Lp.i_r1 = strat->
S_2_R[
i];
2666 && (Lp.p->coef!=
NULL))
2708 unsigned long pSigMultNegSev,sSigMultNegSev;
2712 Lp.ecart=0; Lp.length=0;
2717 #ifndef HAVE_RATGRING 2718 pLcm(p,strat->
S[i],Lp.lcm);
2719 #elif defined(HAVE_RATGRING) 2723 pLcm(p,strat->
S[i],Lp.lcm);
2755 if(pSigMult !=
NULL)
2758 if(sSigMult !=
NULL)
2762 Print(
"----------------\n");
2765 Print(
"----------------\n");
2769 if(pSigMult !=
NULL && sSigMult !=
NULL)
2778 if(pSigMult ==
NULL)
2780 if(sSigMult ==
NULL)
2790 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2812 int red_result =
redRing(&Lp,strat);
2822 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
2824 strat->
enterS(Lp,0,strat,strat->
tl);
2838 Lp.sig =
pCopy(pSigMult);
2867 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2868 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2893 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (strat->
fromQ[i]!=0))
2950 Lp.sig =
pNeg(Lp.sig);
2961 Lp.sevSig = ~pSigMultNegSev;
2968 Lp.sevSig = ~sSigMultNegSev;
2980 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
2994 Lp.checked = strat->
sl+1;
3001 Lp.prod_crit =
TRUE;
3013 PrintS(
"SIGNATURE OF PAIR: ");
3017 Lp.p1 = strat->
S[
i];
3032 Lp.i_r1 = strat->
S_2_R[
i];
3046 && (Lp.p->coef!=
NULL))
3054 int red_result =
redRing(&Lp,strat);
3064 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
3067 strat->
enterS(Lp,0,strat, strat->
tl+1);
3119 Lp.p1 = strat->
S[
i];
3123 Lp.i_r1 = strat->
S_2_R[
i];
3138 && (Lp.p->coef!=
NULL))
3141 l = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
3152 int j=strat->
Ll+strat->
Bl+1;
3160 for (i=strat->
Bl; i>=0; i--)
3162 j = strat->
posInL(strat->
L,j,&(strat->
B[i]),strat);
3173 int j=strat->
Ll+strat->
Bl+1;
3181 for (i=strat->
Bl; i>=0; i--)
3183 j = strat->
posInLSba(strat->
L,j,&(strat->
B[i]),strat);
3204 for (j=0; j<=strat->
sl; j++)
3208 for (i=strat->
Bl; i>=0; i--)
3230 for (j=strat->
Ll; j>=0; j--)
3236 if (strat->
L[j].p == strat->
tail)
3256 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3282 for (j=strat->
Ll; j>=0; j--)
3302 for(i=j-1; i>=0; i--)
3304 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3321 for (j=strat->
Ll; j>=0; j--)
3352 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3355 if (strat->
L[j].p2 == p)
3361 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3375 strat->
L[
i].p2 = strat->
tail;
3392 else if (strat->
L[j].p2 == strat->
tail)
3431 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3434 if (strat->
L[j].p2 == p)
3440 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3454 strat->
L[
i].p2 = strat->
tail;
3471 else if (strat->
L[j].p2 == strat->
tail)
3479 #ifdef HAVE_RATGRING 3492 for (j=0; j<=strat->
sl; j++)
3496 for (i=strat->
Bl; i>=0; i--)
3504 Print(
"chain-crit-part: S[%d]=",j);
3506 Print(
" divide B[%d].lcm=",i);
3528 for (j=strat->
Ll; j>=0; j--)
3534 if (strat->
L[j].p == strat->
tail)
3538 PrintS(
"chain-crit-part: pCompareChainPart p=");
3540 Print(
" delete L[%d]",j);
3562 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3569 Print(
"chain-crit-part: sugar B[%d].lcm=",j);
3571 Print(
" delete B[%d]",i);
3582 Print(
"chain-crit-part: sugar B[%d].lcm=",i);
3584 Print(
" delete B[%d]",j);
3604 for (j=strat->
Ll; j>=0; j--)
3612 PrintS(
"chain-crit-part: sugar:pCompareChainPart p=");
3614 Print(
" delete L[%d]",j);
3632 for(i=j-1; i>=0; i--)
3634 if (
pLmEqual(strat->
B[j].lcm,strat->
B[i].lcm))
3638 Print(
"chain-crit-part: equal lcm B[%d].lcm=",j);
3640 Print(
" delete B[%d]\n",i);
3657 for (j=strat->
Ll; j>=0; j--)
3665 PrintS(
"chain-crit-part: pCompareChainPart p=");
3667 Print(
" delete L[%d]",j);
3696 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3699 if (strat->
L[j].p2 == p)
3705 if ((strat->
L[i].p2 == p) &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
3722 strat->
L[
i].p2 = strat->
tail;
3729 PrintS(
"chain-crit-part: divisible_by p=");
3731 Print(
" delete L[%d]",l);
3742 PrintS(
"chain-crit-part: divisible_by(2) p=");
3744 Print(
" delete L[%d]",i);
3755 else if (strat->
L[j].p2 == strat->
tail)
3783 for (j=0; j<=
k; j++)
3785 if (!strat->
fromQ[j])
3796 for (j=0; j<=
k; j++)
3805 for (j=0; j<=
k; j++)
3818 #ifdef HAVE_RATGRING 3848 for (j=0; j<=
k; j++)
3850 if (!strat->
fromQ[j])
3861 for (j=0; j<=
k; j++)
3870 for (j=0; j<=
k; j++)
3884 #ifdef HAVE_RATGRING 3907 for (j=0; j<=k && !strat->
sigdrop; j++)
3909 if (!strat->
fromQ[j])
3918 for (j=0; j<=k && !strat->
sigdrop; j++)
3927 for (j=0; j<=k && !strat->
sigdrop; j++)
3941 #ifdef HAVE_RATGRING 3968 for (j=0; j<=strat->
sl; j++)
3972 for (i=strat->
Bl; i>=0; i--)
3979 PrintS(
"--- chain criterion func chainCritRing type 1\n");
3982 PrintS(
" strat->B[i].lcm:");
3987 wrp(strat->
B[i].lcm);
4002 for (j=strat->
Ll; j>=0; j--)
4015 PrintS(
"--- chain criterion func chainCritRing type 2\n");
4016 PrintS(
"strat->L[j].p:");
4047 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
4050 if (strat->
L[j].p2 == p)
4058 &&
pLmEqual(strat->
L[j].lcm,strat->
L[i].lcm))
4065 PrintS(
"--- chain criterion func chainCritRing type 3\n");
4066 PrintS(
"strat->L[j].lcm:");
4067 wrp(strat->
L[j].lcm);
4068 PrintS(
" strat->L[i].lcm:");
4069 wrp(strat->
L[i].lcm);
4083 strat->
L[
i].p2 = strat->
tail;
4100 else if (strat->
L[j].p2 == strat->
tail)
4114 if (arg <= 0)
return 0;
4126 if (arg <= 0)
return 0;
4127 if (arg%2 == 1) { arg--; }
4137 #ifdef HAVE_VANIDEAL 4148 int l,
j,compare,compareCoeff;
4152 Lp.ecart=0; Lp.length=0;
4165 for(j = strat->
Bl;j>=0;j--)
4169 if (compareCoeff == 0 || compare == compareCoeff)
4187 if (compareCoeff == 1)
4194 if (compareCoeff == -1)
4205 if ((f==
NULL) || (p==
NULL))
return;
4237 tmp_h.SetShortExpVector();
4242 enterT(tmp_h, strat, strat->
tl + 1);
4247 Lp.i_r1 = strat->
tl;
4251 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
4265 if ((*cabsind < bound) && (*cabsind - step[1] + add < bound))
4274 if (N == 1)
return 0;
4276 while (exp[i] == cexp[i] && i <= N) i++;
4278 *cabsind -= cind[
i];
4281 *cabsind += cind[
i];
4284 if (i > N)
return 0;
4288 for (
int j = i + 1;
j <=
N;
j++)
4290 if (step[1] > step[
j]) step[1] = step[
j];
4292 add =
ind2(cexp[i] + 2);
4293 if (*cabsind - step[1] + add >= bound)
4296 *cabsind -= cind[
i];
4298 *cabsind += cind[
i];
4301 if (i > N)
return 0;
4304 }
while (step[1] != -1);
4309 if (add < step[i]) step[
i] =
add;
4310 for (i = 2; i <=
N; i++)
4312 if (step[1] > step[i]) step[1] = step[
i];
4330 poly zeroPoly =
NULL;
4338 for (
int i = 1; i <= leadRing->N; i++)
4344 if (cabsind < leadRing->ch)
4346 zeroPoly =
p_ISet(
twoPow(leadRing->ch - cabsind), tailRing);
4350 zeroPoly =
p_ISet(1, tailRing);
4352 for (
int i = 1; i <= leadRing->N; i++)
4354 for (
long j = 1;
j <= exp[
i];
j++)
4357 tmp2 =
p_ISet(1, tailRing);
4362 zeroPoly =
p_Mult_q(zeroPoly, tmp2, tailRing);
4367 zeroPoly =
p_Mult_q(zeroPoly,
p_Add_q(tmp3, tmp2, tailRing), tailRing);
4372 for (
int i = 1; i <= leadRing->N; i++)
4378 zeroPoly =
pNext(zeroPoly);
4380 pNext(tmp2) = zeroPoly;
4401 for (
int i = 1; i <=
currRing->N; i++)
4404 if (exp[i] & 1 != 0)
4406 exp[
i] = exp[
i] - 1;
4419 PrintS(
"-------------\npoly :");
4421 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
4422 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4423 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4425 Print(
"cind : %d\n", cabsind);
4442 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4467 for (
int i = 1; i <=
currRing->N; i++)
4478 PrintS(
"-------------\npoly :");
4480 Print(
"\nexp : (%d, %d)\n", exp[1] + mult[1], exp[2] + mult[1]);
4481 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4482 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4483 Print(
"bound : %d\n", bound);
4484 Print(
"cind : %d\n", cabsind);
4502 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4510 G0->m[
IDELEMS(G0) - 1] = zeroPoly;
4534 for (j=0; j<=
k; j++)
4536 if (!strat->
fromQ[j])
4546 for (j=0; j<=
k; j++)
4554 for (j=0; j<=
k; j++)
4566 #ifdef HAVE_RATGRING 4584 for (j=0; j<=k && !strat->
sigdrop; j++)
4591 && ((iCompH<=strat->syzComp)||(strat->
syzComp==0)))
4638 PrintS(
"--- create zero spoly: ");
4667 posx = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
4720 PrintS(
"--- create zero spoly: ");
4748 int red_result =
redRing(&Lp,strat);
4758 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
4760 strat->
enterS(Lp,0,strat,strat->
tl);
4808 if ( (!strat->
fromT)
4818 clearS(h,h_sev, &j,&k,strat);
4865 if ( (!strat->
fromT)
4873 clearS(h,h_sev, &j,&k,strat);
4890 if ( (!strat->
fromT)
4898 clearS(h,h_sev, &j,&k,strat);
4915 for (j=0; j<=
k; j++)
4917 const int iCompSj =
pGetComp(strat->
S[j]);
4918 if ((iCompH==iCompSj)
4929 for (j=0; j<=
k; j++)
4931 const int iCompSj =
pGetComp(strat->
S[j]);
4932 if ((iCompH==iCompSj)
4971 clearS(h,h_sev,&j,&k,strat);
4988 int new_suc=strat->
sl+1;
4992 for (; i<=strat->
sl; i++)
4997 if (new_suc > at) new_suc = at;
5000 sev = strat->
sevS[
i];
5003 for (j=i; j>=at+1; j--)
5005 strat->
S[
j] = strat->
S[j-1];
5012 strat->
sevS[at] = sev;
5013 strat->
S_2_R[at] = s2r;
5016 for (j=i; j>=at+1; j--)
5020 strat->
fromQ[at]=fq;
5024 if (new_suc <= strat->sl) *suc=new_suc;
5038 if(length==-1)
return 0;
5057 || ((o==oo) && (
pLmCmp(
set[length],p)!= cmp_int)))
5079 if (
pLmCmp(
set[length],p)== -cmp_int)
5087 if (cmp == cmp_int)
return an;
5088 if (cmp == -cmp_int)
return en;
5094 if (cmp == cmp_int) en =
i;
5095 else if (cmp == -cmp_int) an =
i;
5104 if (
pLmCmp(
set[length],p)== -cmp_int)
5111 if (
pLmCmp(
set[an],p) == cmp_int)
return an;
5112 if (
pLmCmp(
set[an],p) == -cmp_int)
return en;
5114 && ((strat->
ecartS[an])>ecart_p))
5119 if (
pLmCmp(
set[i],p) == cmp_int) en=i;
5120 else if (
pLmCmp(
set[i],p) == -cmp_int) an=i;
5124 &&((strat->
ecartS[
i])<ecart_p))
5138 if (length<0)
return 0;
5143 for(
int i = 0;i<=
length;i++)
5152 || ((op == o) && (
pLtCmp(
set[mon],p) == -1)))
5163 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5170 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5182 || ((op == o) && (
pLtCmp(
set[length],p) == -1)))
5196 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5203 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5215 if(end < 0 || end >=
IDELEMS(F))
5217 if (end<0)
return 0;
5224 for(i=start;i<end;i++)
5238 || ((op == o) && (
pLtCmp(
set[an],p) == -1)))
5245 || ((op == o) && (
pLtCmp(
set[i],p) == -1)))
5270 if (length==-1)
return 0;
5272 if (
pLmCmp(
set[length].p,p.p)!=
currRing->OrdSgn)
return length+1;
5301 if (
set[length].length<p.length)
5312 if (
set[an].length>p.length)
return an;
5316 if (
set[i].length>p.length) en=
i;
5328 if (length==-1)
return 0;
5330 int o = p.GetpFDeg();
5331 int op =
set[
length].GetpFDeg();
5334 || ((op == o) && (
pLmCmp(
set[length].p,p.p) !=
currRing->OrdSgn)))
5345 op=
set[an].GetpFDeg();
5352 op =
set[
i].GetpFDeg();
5364 if (length==-1)
return 0;
5366 int o = p.GetpFDeg();
5367 int op =
set[
length].GetpFDeg();
5381 op=
set[an].GetpFDeg();
5388 op =
set[
i].GetpFDeg();
5405 if (length==-1)
return 0;
5406 int o = p.GetpFDeg();
5407 int op =
set[
length].GetpFDeg();
5412 if ((op < o) || (
pLmCmp(
set[length].p,p.p)== -cmp_int))
5419 op =
set[an].GetpFDeg();
5420 if (op > o)
return an;
5421 if (op < 0)
return en;
5422 cmp =
pLmCmp(
set[an].p,p.p);
5423 if (cmp == cmp_int)
return an;
5424 if (cmp == -cmp_int)
return en;
5429 op =
set[
i].GetpFDeg();
5431 else if (op < o) an =
i;
5434 cmp =
pLmCmp(
set[i].p,p.p);
5435 if (cmp == cmp_int) en =
i;
5436 else if (cmp == -cmp_int) an =
i;
5482 if (length==-1)
return 0;
5484 int o = p.GetpFDeg();
5485 int op =
set[
length].GetpFDeg();
5488 || (( op == o) && (
set[length].length<p.length))
5489 || (( op == o) && (
set[length].length == p.length)
5500 op =
set[an].GetpFDeg();
5502 || (( op == o) && (
set[an].length > p.length))
5503 || (( op == o) && (
set[an].length == p.length)
5509 op =
set[
i].GetpFDeg();
5511 || (( op == o) && (
set[i].length > p.length))
5512 || (( op == o) && (
set[i].length == p.length)
5524 if (length==-1)
return 0;
5526 int o = p.GetpFDeg();
5527 int op =
set[
length].GetpFDeg();
5530 || (( op == o) && (
set[length].length<p.length))
5531 || (( op == o) && (
set[length].length == p.length)
5542 op =
set[an].GetpFDeg();
5544 || (( op == o) && (
set[an].length > p.length))
5545 || (( op == o) && (
set[an].length == p.length)
5551 op =
set[
i].GetpFDeg();
5553 || (( op == o) && (
set[i].length > p.length))
5554 || (( op == o) && (
set[i].length == p.length)
5570 if (length==-1)
return 0;
5572 int o = p.GetpFDeg();
5599 int ol = p.GetpLength();
5600 if (length==-1)
return 0;
5604 int oo=
set[
length].ecart;
5605 if ((oo < op) || ((oo==op) && (
set[length].length <= ol)))
5615 int oo=
set[an].ecart;
5617 || ((oo==op) && (
set[an].
pLength > ol)))
5622 int oo=
set[
i].ecart;
5624 || ((oo == op) && (
set[i].
pLength > ol)))
5656 if (length==-1)
return 0;
5658 int o = p.GetpFDeg() + p.ecart;
5673 op =
set[an].GetpFDeg()+
set[an].ecart;
5680 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5692 if (length==-1)
return 0;
5694 int o = p.GetpFDeg() + p.ecart;
5709 op =
set[an].GetpFDeg()+
set[an].ecart;
5716 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5753 if (length==-1)
return 0;
5755 int o = p.GetpFDeg() + p.ecart;
5759 || (( op == o) && (
set[length].ecart > p.ecart))
5760 || (( op == o) && (
set[length].ecart==p.ecart)
5771 op =
set[an].GetpFDeg()+
set[an].ecart;
5773 || (( op == o) && (
set[an].ecart < p.ecart))
5774 || (( op == o) && (
set[an].ecart==p.ecart)
5780 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5782 || (( op == o) && (
set[i].ecart < p.ecart))
5783 || (( op == o) && (
set[i].ecart == p.ecart)
5794 if (length==-1)
return 0;
5796 int o = p.GetpFDeg() + p.ecart;
5800 || (( op == o) && (
set[length].ecart > p.ecart))
5801 || (( op == o) && (
set[length].ecart==p.ecart)
5812 op =
set[an].GetpFDeg()+
set[an].ecart;
5814 || (( op == o) && (
set[an].ecart < p.ecart))
5815 || (( op == o) && (
set[an].ecart==p.ecart)
5821 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5823 || (( op == o) && (
set[i].ecart < p.ecart))
5824 || (( op == o) && (
set[i].ecart == p.ecart)
5840 if (length==-1)
return 0;
5844 int o = p.GetpFDeg() + p.ecart;
5847 if (
pGetComp(
set[length].p)*cc < c)
5849 if (
pGetComp(
set[length].p)*cc == c)
5853 || ((op == o) && (
set[length].ecart > p.ecart))
5854 || ((op == o) && (
set[length].ecart==p.ecart)
5870 int op =
set[an].GetpFDeg()+
set[an].ecart;
5872 || ((op == o) && (
set[an].ecart < p.ecart))
5873 || ((op == o) && (
set[an].ecart==p.ecart)
5882 else if (
pGetComp(
set[i].p)*cc == c)
5884 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
5886 || ((op == o) && (
set[i].ecart < p.ecart))
5887 || ((op == o) && (
set[i].ecart == p.ecart)
5901 if (length==-1)
return 0;
5905 int o = p.GetpFDeg() + p.ecart;
5908 if (
pGetComp(
set[length].p)*cc < c)
5910 if (
pGetComp(
set[length].p)*cc == c)
5914 || ((op == o) && (
set[length].ecart > p.ecart))
5915 || ((op == o) && (
set[length].ecart==p.ecart)
5931 int op =
set[an].GetpFDeg()+
set[an].ecart;
5933 || ((op == o) && (
set[an].ecart < p.ecart))
5934 || ((op == o) && (
set[an].ecart==p.ecart)
5943 else if (
pGetComp(
set[i].p)*cc == c)
5945 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
5947 || ((op == o) && (
set[i].ecart < p.ecart))
5948 || ((op == o) && (
set[i].ecart == p.ecart)
5968 if (length==-1)
return 0;
5971 int op=p.GetpFDeg();
5973 if (
set[length].ecart < o)
5975 if (
set[length].ecart == o)
5977 int oo=
set[
length].GetpFDeg();
5978 if ((oo < op) || ((oo==op) && (
set[length].length < p.length)))
5989 if (
set[an].ecart > o)
5991 if (
set[an].ecart == o)
5993 int oo=
set[an].GetpFDeg();
5995 || ((oo==op) && (
set[an].length > p.length)))
6001 if (
set[i].ecart > o)
6003 else if (
set[i].ecart == o)
6005 int oo=
set[
i].GetpFDeg();
6007 || ((oo == op) && (
set[i].length > p.length)))
6025 if (length<0)
return 0;
6027 int d=p->GetpFDeg();
6028 int op=
set[
length].GetpFDeg();
6031 || ((op == d) && (p->p1!=
NULL)&&(
set[length].p1==
NULL))
6042 op=
set[an].GetpFDeg();
6044 || ((op == d) && (p->p1!=
NULL) && (
set[an].p1==
NULL))
6050 op=
set[
i].GetpFDeg();
6052 || ((op==d) && (p->p1!=
NULL) && (
set[i].p1==
NULL))
6068 if (length<0)
return 0;
6094 if (length<0)
return 0;
6126 if (length<0)
return 0;
6151 if (length<0)
return 0;
6165 cmp =
pLtCmp(
set[an].sig,p->sig);
6172 if (
set[an].
FDeg > p->FDeg)
6174 if (
set[an].FDeg < p->
FDeg)
6176 if (
set[an].FDeg == p->FDeg)
6178 cmp =
pLtCmp(
set[an].p,p->p);
6187 cmp =
pLtCmp(
set[i].sig,p->sig);
6194 if (
set[i].
FDeg > p->FDeg)
6196 if (
set[i].FDeg < p->
FDeg)
6198 if (
set[i].FDeg == p->FDeg)
6200 cmp =
pLtCmp(
set[i].p,p->p);
6213 if (length < 0)
return 0;
6214 if (
set[length].
FDeg > p->FDeg)
6216 if (
set[length].
FDeg == p->FDeg)
6217 if(
set[length].
GetpLength() > p->GetpLength())
6228 if (
set[an].
FDeg > p->FDeg)
6230 if(
set[an].
FDeg == p->FDeg)
6238 if(
nGreater(
set[an].p->coef, p->p->coef))
6253 if (
set[i].
FDeg > p->FDeg)
6257 if(
set[i].
FDeg == p->FDeg)
6265 if(
nGreater(
set[i].p->coef, p->p->coef))
6285 if (strat->
syzl==0)
return 0;
6290 int en= strat->
syzl-1;
6326 if (length<0)
return 0;
6328 int o = p->GetpFDeg();
6329 int op =
set[
length].GetpFDeg();
6332 || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6341 op =
set[an].GetpFDeg();
6348 op =
set[
i].GetpFDeg();
6368 if (length<0)
return 0;
6370 int o = p->GetpFDeg();
6371 int op =
set[
length].GetpFDeg();
6383 op =
set[an].GetpFDeg();
6390 op =
set[
i].GetpFDeg();
6402 if (length<0)
return 0;
6403 if(start == (length +1))
return (length+1);
6404 int o = p->GetpFDeg();
6405 int op =
set[
length].GetpFDeg();
6417 op =
set[an].GetpFDeg();
6424 op =
set[
i].GetpFDeg();
6438 if (length < 0)
return 0;
6448 if (
set[an].
FDeg > p->FDeg)
6450 if (
set[an].FDeg < p->
FDeg)
6452 if (
set[an].FDeg == p->FDeg)
6482 if (
set[i].
FDeg > p->FDeg)
6484 if (
set[i].FDeg < p->
FDeg)
6486 if (
set[i].FDeg == p->FDeg)
6526 if (coeff == 0)
return -1;
6529 while (tmp % 2 == 0)
6548 if (length < 0)
return 0;
6550 int o = p->GetpFDeg();
6551 int op =
set[
length].GetpFDeg();
6553 if ((op > o) || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6562 op =
set[an].GetpFDeg();
6563 if ((op > o) || ((op == o) && (
pLmCmp(
set[an].p,p->p) != -
currRing->OrdSgn)))
6568 op =
set[
i].GetpFDeg();
6569 if ((op > o) || ((op == o) && (
pLmCmp(
set[i].p,p->p) != -
currRing->OrdSgn)))
6624 if (length<0)
return 0;
6626 int o = p->GetpFDeg();
6627 int op =
set[
length].GetpFDeg();
6630 || ((op == o) && (
set[length].length >p->length))
6631 || ((op == o) && (
set[length].length <= p->length)
6641 op =
set[an].GetpFDeg();
6643 || ((op == o) && (
set[an].length >p->length))
6644 || ((op == o) && (
set[an].length <=p->length)
6650 op =
set[
i].GetpFDeg();
6652 || ((op == o) && (
set[i].length > p->length))
6653 || ((op == o) && (
set[i].length <= p->length)
6665 if (length<0)
return 0;
6667 int o = p->GetpFDeg();
6668 int op =
set[
length].GetpFDeg();
6671 || ((op == o) && (
set[length].length >p->length))
6672 || ((op == o) && (
set[length].length <= p->length)
6682 op =
set[an].GetpFDeg();
6684 || ((op == o) && (
set[an].length >p->length))
6685 || ((op == o) && (
set[an].length <=p->length)
6691 op =
set[
i].GetpFDeg();
6693 || ((op == o) && (
set[i].length > p->length))
6694 || ((op == o) && (
set[i].length <= p->length)
6712 if (length<0)
return 0;
6714 int o = p->GetpFDeg();
6747 if (length<0)
return 0;
6749 int o = p->GetpFDeg() + p->ecart;
6753 || ((op == o) && (
pLmCmp(
set[length].p,p->p) != -
currRing->OrdSgn)))
6762 op =
set[an].GetpFDeg() +
set[an].ecart;
6769 op =
set[
i].GetpFDeg() +
set[
i].ecart;
6782 if (length<0)
return 0;
6784 int o = p->GetpFDeg() + p->ecart;
6797 op =
set[an].GetpFDeg() +
set[an].ecart;
6804 op =
set[
i].GetpFDeg() +
set[
i].ecart;
6823 if (length<0)
return 0;
6825 int o = p->GetpFDeg() + p->ecart;
6827 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6828 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6829 && (
set[length].ecart > p->ecart))
6830 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6831 && (
set[length].ecart == p->ecart)
6841 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
6842 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6843 && (
set[an].ecart > p->ecart))
6844 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6845 && (
set[an].ecart == p->ecart)
6851 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
6852 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6853 && (
set[i].ecart > p->ecart))
6854 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6855 && (
set[i].ecart == p->ecart)
6867 if (length<0)
return 0;
6869 int o = p->GetpFDeg() + p->ecart;
6871 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6872 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6873 && (
set[length].ecart > p->ecart))
6874 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6875 && (
set[length].ecart == p->ecart)
6885 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
6886 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6887 && (
set[an].ecart > p->ecart))
6888 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6889 && (
set[an].ecart == p->ecart)
6895 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
6896 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6897 && (
set[i].ecart > p->ecart))
6898 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6899 && (
set[i].ecart == p->ecart)
6917 if (length<0)
return 0;
6921 unsigned long c =
pGetComp(p->p)*cc;
6922 int o = p->GetpFDeg() + p->ecart;
6924 if (
pGetComp(
set[length].p)*cc > c)
6926 if (
pGetComp(
set[length].p)*cc == c)
6928 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6929 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6930 && (
set[length].ecart > p->ecart))
6931 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6932 && (
set[length].ecart == p->ecart)
6947 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
6948 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6949 && (
set[an].ecart > p->ecart))
6950 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
6951 && (
set[an].ecart == p->ecart)
6960 else if (
pGetComp(
set[i].p)*cc == c)
6962 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
6963 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6964 && (
set[i].ecart > p->ecart))
6965 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
6966 && (
set[i].ecart == p->ecart)
6981 if (length<0)
return 0;
6985 unsigned long c =
pGetComp(p->p)*cc;
6986 int o = p->GetpFDeg() + p->ecart;
6988 if (
pGetComp(
set[length].p)*cc > c)
6990 if (
pGetComp(
set[length].p)*cc == c)
6992 if ((
set[length].
GetpFDeg() +
set[length].ecart > o)
6993 || ((
set[length].
GetpFDeg() +
set[length].ecart == o)
6994 && (
set[length].ecart > p->ecart))
6995 || ((
set[length].GetpFDeg() +
set[
length].ecart == o)
6996 && (
set[length].ecart == p->ecart)
7011 if ((
set[an].
GetpFDeg() +
set[an].ecart > o)
7012 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7013 && (
set[an].ecart > p->ecart))
7014 || ((
set[an].
GetpFDeg() +
set[an].ecart == o)
7015 && (
set[an].ecart == p->ecart)
7024 else if (
pGetComp(
set[i].p)*cc == c)
7026 if ((
set[i].
GetpFDeg() +
set[
i].ecart > o)
7027 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7028 && (
set[i].ecart > p->ecart))
7029 || ((
set[i].
GetpFDeg() +
set[
i].ecart == o)
7030 && (
set[i].ecart == p->ecart)
7049 PrintS(
"syzygy criterion checks: ");
7052 for (
int k=0;
k<strat->
syzl;
k++)
7057 Print(
"checking with: %d / %d -- \n",
k,strat->
syzl);
7086 PrintS(
"--- syzygy criterion checks: ");
7095 min = strat->
syzIdx[comp-2];
7105 max = strat->
syzIdx[comp-1];
7107 for (
int k=min;
k<
max;
k++)
7110 Print(
"COMP %d/%d - MIN %d - MAX %d - SYZL %ld\n",comp,strat->
currIdx,min,max,strat->
syzl);
7111 Print(
"checking with: %d -- ",
k);
7136 PrintS(
"rewritten criterion checks: ");
7139 for(
int k = strat->
sl;
k>=start;
k--)
7143 PrintS(
"checking with: ");
7159 PrintS(
"ALL ELEMENTS OF S\n----------------------------------------\n");
7160 for(
int kk = 0; kk<strat->
sl+1; kk++)
7164 PrintS(
"------------------------------\n");
7194 for (
int ii=strat->
sl; ii>start; ii--)
7200 if (!(
pLmCmp(p1,p2) == 1))
7219 for (
int i=strat->
Bl; i>-1; i--) {
7228 if (
pLmCmp(lm,strat->
B[found].GetLmCurrRing()) == -1)
7239 for (
int ii=strat->
sl; ii>-1; ii--)
7245 if (!(
pLmCmp(p1,p2) == 1))
7266 const unsigned long not_sev = ~L->sev;
7267 const unsigned long* sev = strat->
sevS;
7280 if (j > end_pos)
return NULL;
7281 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7283 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7288 if (!(sev[j] & not_sev) &&
7289 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]) &&
7303 if (j > end_pos)
return NULL;
7304 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7311 if (!(sev[j] & not_sev) &&
7312 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]) &&
7323 if (strat->
tl < 0 || strat->
S_2_R[j] == -1)
7325 T->Set(strat->
S[j], r, strat->
tailRing);
7326 assume(T->GetpLength()==
pLength(T->p != __null ? T->p : T->t_p));
7334 return strat->
S_2_T(j);
7344 if (j > end_pos)
return NULL;
7346 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7347 t = strat->
S_2_T(j);
7350 (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7356 if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7358 t = strat->
S_2_T(j);
7359 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[j]);
7375 if (j > end_pos)
return NULL;
7377 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7378 t = strat->
S_2_T(j);
7387 if (! (sev[j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[j]))
7389 t = strat->
S_2_T(j);
7390 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[j]);
7441 if (With ==
NULL)
break;
7451 return redtail(L, end_pos, strat);
7457 if (hn ==
NULL)
goto all_done;
7478 return redtail(&L, end_pos, strat);
7483 #define REDTAIL_CANONICALIZE 100 7487 p = h = L->GetLmTailRing();
7489 return L->GetLmCurrRing();
7524 Ln.SetShortExpVector();
7530 With = &(strat->
T[
j]);
7531 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
7536 if (With ==
NULL)
break;
7537 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
7564 pNext(h) = Ln.LmExtractAndIter();
7567 }
while (!Ln.IsNull());
7570 if (Ln.IsNull())
goto all_done;
7571 if (! withT) With_s.Init(
currRing);
7573 pNext(h) = Ln.LmExtractAndIter();
7592 return L->GetLmCurrRing();
7600 p = h = L->GetLmTailRing();
7602 return L->GetLmCurrRing();
7609 Ln.pLength = L->GetpLength() - 1;
7633 Ln.SetShortExpVector();
7639 With = &(strat->
T[
j]);
7644 if (With ==
NULL)
break;
7671 pNext(h) = Ln.LmExtractAndIter();
7674 }
while (!Ln.IsNull());
7680 Ln.p =
pJet(Ln.p,bound);
7686 if (! withT) With_s.Init(
currRing);
7688 pNext(h) = Ln.LmExtractAndIter();
7707 return L->GetLmCurrRing();
7717 p = h = L->GetLmTailRing();
7752 Ln.SetShortExpVector();
7761 With = &(strat->
T[
j]);
7762 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
7779 pNext(h) = Ln.LmExtractAndIter();
7782 }
while (!Ln.IsNull());
7790 With = &(strat->
T[
j]);
7791 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
7808 pNext(h) = Ln.LmExtractAndIter();
7811 }
while (!Ln.IsNull());
7815 if (Ln.IsNull())
goto all_done;
7817 pNext(h) = Ln.LmExtractAndIter();
7842 p = h = L->GetLmTailRing();
7844 return L->GetLmCurrRing();
7851 Ln.pLength = L->GetpLength() - 1;
7864 Ln.SetShortExpVector();
7866 if (With ==
NULL)
break;
7876 poly p_Ln=Ln.GetLmCurrRing();
7877 poly p_With=With->GetLmCurrRing();
7889 if (Ln.bucket!=
NULL)
7920 pNext(h) = Ln.LmExtractAndIter();
7923 }
while (!Ln.IsNull());
7926 if (Ln.IsNull())
goto all_done;
7929 pNext(h) = Ln.LmExtractAndIter();
7947 return L->GetLmCurrRing();
7963 if (strat->
Ll != *reduc)
7965 if (strat->
Ll != *reduc-1)
7977 if (red_result == 0)
7979 else if (red_result < 0)
7981 if ((red_result > 0) || ((strat->
Ll % 100)==99))
7983 if (strat->
Ll != *reduc && strat->
Ll > 0)
8000 Print(
"product criterion:%d chain criterion:%d\n",strat->
cp,strat->
c3);
8001 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
8002 #ifdef HAVE_SHIFTBBA 8004 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
8015 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
8016 #ifdef HAVE_SHIFTBBA 8018 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
8033 for (i=0; i<=strat->
sl; i++)
8043 for (i=0; i<=strat->
tl; i++)
8047 if (strat->
T[i].length==0) strat->
T[
i].length=
pLength(strat->
T[i].p);
8048 Print(
" o:%ld e:%d l:%d",
8049 strat->
T[i].pFDeg(),strat->
T[
i].ecart,strat->
T[
i].length);
8054 for (i=strat->
Ll; i>=0; i--)
8063 Print(
" o:%ld e:%d l:%d",
8064 strat->
L[i].pFDeg(),strat->
L[
i].ecart,strat->
L[
i].length);
8086 strat->
S=strat->
Shdl->m;
8091 memset(strat->
fromQ,0,i*
sizeof(
int));
8097 h.p =
pCopy(Q->m[i]);
8117 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8120 strat->
enterS(h,pos,strat,-1);
8121 strat->
fromQ[pos]=1;
8131 h.p =
pCopy(F->m[i]);
8152 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8154 strat->
enterS(h,pos,strat,-1);
8180 strat->
S=strat->
Shdl->m;
8185 memset(strat->
fromQ,0,i*
sizeof(
int));
8191 h.p =
pCopy(Q->m[i]);
8211 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8214 strat->
enterS(h,pos,strat,-1);
8215 strat->
fromQ[pos]=1;
8225 h.p =
pCopy(F->m[i]);
8247 pos = strat->
posInL(strat->
L,strat->
Ll,&h,strat);
8277 strat->
S = strat->
Shdl->m;
8290 memset(strat->
fromQ,0,i*
sizeof(
int));
8296 h.p =
pCopy(Q->m[i]);
8316 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8319 strat->
enterS(h,pos,strat,-1);
8320 strat->
fromQ[pos]=1;
8330 h.p =
pCopy(F->m[i]);
8430 for(i=1; i<=strat->
sl; i++)
8442 strat->
syz = (poly *)
omAlloc(ps*
sizeof(poly));
8446 #if defined(DEBUGF5) || defined(DEBUGF51) 8447 PrintS(
"------------- GENERATING SYZ RULES NEW ---------------\n");
8454 while (i <= strat->sl)
8466 diff = comp - comp_old - 1;
8484 for (k = 0; k<
i; k++)
8511 diff = comp - comp_old - 1;
8528 for (k = 0; k<strat->
sl+1; k++)
8549 PrintS(
"Principal syzygies:\n");
8552 Print(
"ps %d\n",ps);
8553 PrintS(
"--------------------------------\n");
8554 for(i=0;i<=strat->
syzl-1;i++)
8563 PrintS(
"--------------------------------\n");
8583 strat->
S=strat->
Shdl->m;
8589 memset(strat->
fromQ,0,i*
sizeof(
int));
8595 h.p =
pCopy(Q->m[i]);
8615 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8618 strat->
enterS(h,pos,strat, strat->
tl+1);
8620 strat->
fromQ[pos]=1;
8631 h.p =
pCopy(F->m[i]);
8646 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8648 strat->
enterS(h,pos,strat, strat->
tl+1);
8690 h.is_normalized = 0;
8695 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8697 strat->
enterS(h,pos,strat, strat->
tl+1);
8705 strat->
enterS(h,0,strat, strat->
tl+1);
8727 strat->
S=strat->
Shdl->m;
8733 memset(strat->
fromQ,0,i*
sizeof(
int));
8739 h.p =
pCopy(Q->m[i]);
8759 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8762 strat->
enterS(h,pos,strat, strat->
tl+1);
8764 strat->
fromQ[pos]=1;
8775 h.p =
pCopy(F->m[i]);
8790 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8792 strat->
enterS(h,pos,strat, strat->
tl+1);
8834 h.is_normalized = 0;
8839 pos =
posInS(strat,strat->
sl,h.p,h.ecart);
8841 strat->
enterS(h,pos,strat, strat->
tl+1);
8849 strat->
enterS(h,0,strat, strat->
tl+1);
8865 while (j <= maxIndex)
8882 if (!
pIsVector((*p).p) && ((*p).ecart != 0))
8891 h1 = r =
pCopy((*p).p);
8944 while ((j <= strat->sl) && (
pGetComp(strat->
S[j])!=0)) j++;
8946 while (j<=strat->sl)
8970 while (j <= maxIndex)
9024 while (j <= maxIndex);
9054 while (i<=strat->sl)
9061 redSi =
pHead(strat->
S[i]);
9062 strat->
S[
i] =
redBba(strat->
S[i],i-1,strat);
9065 if (
pCmp(redSi,strat->
S[i])!=0)
9078 if (strat->
S[i]==
NULL)
9086 if (strat->
S[i]==
NULL)
9104 DENOMINATOR_LIST=denom;
9122 if (any_change)
reorderS(&suc,strat);
9127 for (i=0; i<=strat->
sl; i++)
9148 h.sev = strat->
sevS[
i];
9161 while (i<=strat->sl)
9166 redSi=
pHead((strat->
S)[i]);
9167 (strat->
S)[i] =
redMora((strat->
S)[
i],i-1,strat);
9173 else if (
pCmp((strat->
S)[i],redSi)!=0)
9190 DENOMINATOR_LIST=denom;
9204 strat->
sevS[
i] = h.sev;
9214 if (any_change)
reorderS(&suc,strat);
9215 else { suc=-1;
break; }
9226 for (i=0; i<=strat->
sl; i++)
9230 strat->
S[
i] = h.p =
redtail(strat->
S[i],strat->
sl,strat);
9234 strat->
sevS[
i] = h.sev;
9240 h.sev = strat->
sevS[
i];
9241 h.length = h.pLength =
pLength(h.p);
9250 if (suc!= -1)
updateS(toT,strat);
9270 *
sizeof(
unsigned long));
9297 strat->
Shdl->m=strat->
S;
9299 if (atS <= strat->sl)
9301 #ifdef ENTER_USE_MEMMOVE 9302 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9303 (strat->
sl - atS + 1)*
sizeof(poly));
9304 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9305 (strat->
sl - atS + 1)*
sizeof(
int));
9306 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9307 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9308 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9309 (strat->
sl - atS + 1)*
sizeof(
int));
9311 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9312 (strat->
sl - atS + 1)*
sizeof(
int));
9314 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9317 for (i=strat->
sl+1; i>=atS+1; i--)
9319 strat->
S[
i] = strat->
S[i-1];
9325 for (i=strat->
sl+1; i>=atS+1; i--)
9328 for (i=strat->
sl+1; i>=atS+1; i--)
9334 #ifdef ENTER_USE_MEMMOVE 9335 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9336 (strat->
sl - atS + 1)*
sizeof(
int));
9338 for (i=strat->
sl+1; i>=atS+1; i--)
9343 strat->
fromQ[atS]=0;
9354 strat->
sevS[atS] = p.sev;
9355 strat->
ecartS[atS] = p.ecart;
9356 strat->
S_2_R[atS] = atR;
9360 #ifdef HAVE_SHIFTBBA 9364 for (
int i = toInsert; i > 0; i--)
9389 *
sizeof(
unsigned long));
9393 *
sizeof(
unsigned long));
9421 strat->
Shdl->m=strat->
S;
9428 if (atS <= strat->sl)
9430 #ifdef ENTER_USE_MEMMOVE 9431 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9432 (strat->
sl - atS + 1)*
sizeof(poly));
9433 memmove(&(strat->
sig[atS+1]), &(strat->
sig[atS]),
9434 (strat->
sl - atS + 1)*
sizeof(poly));
9435 memmove(&(strat->
sevSig[atS+1]), &(strat->
sevSig[atS]),
9436 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9437 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9438 (strat->
sl - atS + 1)*
sizeof(
int));
9439 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9440 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9441 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9442 (strat->
sl - atS + 1)*
sizeof(
int));
9444 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9445 (strat->
sl - atS + 1)*
sizeof(
int));
9447 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9450 for (i=strat->
sl+1; i>=atS+1; i--)
9452 strat->
S[
i] = strat->
S[i-1];
9456 strat->
sig[
i] = strat->
sig[i-1];
9460 for (i=strat->
sl+1; i>=atS+1; i--)
9463 for (i=strat->
sl+1; i>=atS+1; i--)
9469 #ifdef ENTER_USE_MEMMOVE 9470 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9471 (strat->
sl - atS + 1)*
sizeof(
int));
9473 for (i=strat->
sl+1; i>=atS+1; i--)
9478 strat->
fromQ[atS]=0;
9482 strat->
S[atS] = p.p;
9483 strat->
sig[atS] = p.sig;
9489 strat->
sevS[atS] = p.sev;
9499 strat->
sevSig[atS] = p.sevSig;
9501 strat->
ecartS[atS] = p.ecart;
9502 strat->
S_2_R[atS] = atR;
9506 Print(
"--- LIST S: %d ---\n",strat->
sl);
9507 for(k=0;k<=strat->
sl;k++)
9511 PrintS(
"--- LIST S END ---\n");
9517 p.GetP(strat->
lmBin);
9534 poly tp = strat->
T[tj].p;
9539 for (j = 0; j <= strat->
sl; ++
j) {
9540 if (
pLtCmp(tp, strat->
S[j]) == 0) {
9546 if (j <= strat->sl) {
9550 pos =
posInS(strat, strat->
sl, p.p, p.ecart);
9553 assume(p.FDeg == p.pFDeg());
9556 for (i = 0; i <= strat->
Ll; ++
i) {
9557 if (strat->
L[i].p1 !=
NULL &&
pLtCmp(tp, strat->
L[i].p1) == 0) {
9562 if (strat->
L[i].p2 !=
NULL &&
pLtCmp(tp, strat->
L[i].p2) == 0) {
9570 strat->
enterS(p, pos, strat, strat->
tl);
9581 #ifdef HAVE_SHIFTBBA 9582 if (
currRing->isLPring && p.shift > 0)
9598 assume(p.FDeg == p.pFDeg());
9603 for(i=strat->
tl;i>=0;i--)
9605 if (p.p==strat->
T[i].p)
9607 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
9613 #ifdef HAVE_TAIL_RING 9616 p.t_p=p.GetLmTailRing();
9621 atT = strat->
posInT(strat->
T, strat->
tl, p);
9622 if (strat->
tl == strat->
tmax-1)
9624 if (atT <= strat->tl)
9626 #ifdef ENTER_USE_MEMMOVE 9627 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9629 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9630 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9632 for (i=strat->
tl+1; i>=atT+1; i--)
9634 #ifndef ENTER_USE_MEMMOVE 9635 strat->
T[
i] = strat->
T[i-1];
9638 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9644 #ifdef HAVE_SHIFTBBA 9646 if (!(
currRing->isLPring && p.shift > 0))
9662 strat->
T[atT].max_exp =
NULL;
9665 strat->
R[strat->
tl] = &(strat->
T[atT]);
9666 strat->
T[atT].i_r = strat->
tl;
9686 assume(p.FDeg == p.pFDeg());
9691 for(i=strat->
tl;i>=0;i--)
9693 if (p.p==strat->
T[i].p)
9695 printf(
"already in T at pos %d of %d, atT=%d\n",i,strat->
tl,atT);
9701 #ifdef HAVE_TAIL_RING 9704 p.t_p=p.GetLmTailRing();
9709 atT = strat->
posInT(strat->
T, strat->
tl, p);
9710 if (strat->
tl == strat->
tmax-1)
9712 if (atT <= strat->tl)
9714 #ifdef ENTER_USE_MEMMOVE 9715 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9717 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9718 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9720 for (i=strat->
tl+1; i>=atT+1; i--)
9722 #ifndef ENTER_USE_MEMMOVE 9723 strat->
T[
i] = strat->
T[i-1];
9726 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9744 strat->
T[atT].max_exp =
NULL;
9747 strat->
R[strat->
tl] = &(strat->
T[atT]);
9748 strat->
T[atT].i_r = strat->
tl;
9755 for(i=strat->
tl;i>=0;i--)
9786 (strat->
syzmax)*
sizeof(
unsigned long),
9788 *
sizeof(
unsigned long));
9791 if (atT < strat->syzl)
9793 #ifdef ENTER_USE_MEMMOVE 9794 memmove(&(strat->
syz[atT+1]), &(strat->
syz[atT]),
9795 (strat->
syzl-atT+1)*
sizeof(poly));
9796 memmove(&(strat->
sevSyz[atT+1]), &(strat->
sevSyz[atT]),
9797 (strat->
syzl-atT+1)*
sizeof(
unsigned long));
9799 for (i=strat->
syzl; i>=atT+1; i--)
9801 #ifndef ENTER_USE_MEMMOVE 9802 strat->
syz[
i] = strat->
syz[i-1];
9814 strat->
syz[atT] = p.sig;
9815 strat->
sevSyz[atT] = p.sevSig;
9818 Print(
"element in strat->syz: %d--%d ",atT+1,strat->
syzmax);
9828 strat->
L[cc].sig, ~strat->
L[cc].sevSig,
currRing)
9842 PrintS(
"--- Syzygies ---\n");
9845 PrintS(
"--------------------------------\n");
9846 for(i=0;i<=strat->
syzl-1;i++)
9851 PrintS(
"--------------------------------\n");
9887 #ifdef HAVE_RATGRING 9932 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9933 else PrintS(
"ideal/module is not homogeneous\n");
9964 #ifdef HAVE_RATGRING 10003 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
10004 else PrintS(
"ideal/module is not homogeneous\n");
10226 strat->
P.pLength=0;
10512 for (l=
IDELEMS(r)-1;l>=0;l--)
10523 for (l=
IDELEMS(r)-1;l>=0;l--)
10525 if ((r->m[l]!=
NULL)
10530 for(q=
IDELEMS(Q)-1; q>=0;q--)
10532 if ((Q->m[q]!=
NULL)
10554 for (l=
IDELEMS(r)-1;l>=0;l--)
10556 if ((r->m[l]!=
NULL)
10561 for(q=
IDELEMS(Q)-1; q>=0;q--)
10563 if ((Q->m[q]!=
NULL)
10594 for (l=
IDELEMS(r)-1;l>=0;l--)
10598 for(q=
IDELEMS(Q)-1; q>=0;q--)
10607 reduction_found=
TRUE;
10623 for (l=
IDELEMS(r)-1;l>=0;l--)
10627 for(q=
IDELEMS(Q)-1; q>=0;q--)
10638 reduction_found=
TRUE;
10652 if ( reduction_found)
10657 for (l=
IDELEMS(r)-1;l>=0;l--)
10688 for (l=
IDELEMS(r)-1;l>=0;l--)
10742 for (i=strat->
sl; i>=low; i--)
10744 int end_pos=strat->
sl;
10746 if (strat->
ak==0) end_pos=i-1;
10748 if ((T_j !=
NULL)&&(T_j->p==strat->
S[i]))
10754 Print(
"test S[%d]:",i);
10766 Print(
"to (tailR) S[%d]:",i);
10778 T_j->max_exp =
NULL;
10781 T_j->pCleardenom();
10789 Print(
"test S[%d]:",i);
10795 strat->
S[
i] =
redtailBba(strat->
S[i], end_pos, strat, withT);
10809 DENOMINATOR_LIST=denom;
10821 Print(
"to (-tailR) S[%d]:",i);
10832 sloppy_max =
FALSE;
10869 if (j < strat->
HCord)
10910 assume(L->i_r1 >= -1 && L->i_r1 <= strat->
tl);
10911 assume(L->i_r2 >= -1 && L->i_r2 <= strat->
tl);
10917 if ((L->i_r1 == -1) || (L->i_r2 == -1) )
10922 if (L->i_r1>=0) p1_max = (strat->
R[L->i_r1])->
max_exp;
10924 if (L->i_r2>=0) p2_max = (strat->
R[L->i_r2])->
max_exp;
10950 poly p1_max = (strat->
R[atR])->
max_exp;
10972 ideal F =
idCopy(Forig);
10976 ideal monred =
idInit(1,1);
10977 for(
int i=0; i<
idElem(F); i++)
10983 if((posconst != -1) && (!
nIsZero(F->m[posconst]->coef)))
10993 for(
int i=0; i<idelemQ; i++)
11001 if((posconst != -1) && (!
nIsZero(monred->m[posconst]->coef)))
11003 pmon =
pCopy(monred->m[posconst]);
11017 for(
int i = 0, j = 0; i<
IDELEMS(F); i++)
11018 II->m[j++] =
prMapR(F->m[i], nMap, origR, QQ_ring);
11019 for(
int i = 0, j =
IDELEMS(F); i<idelemQ; i++)
11020 II->m[j++] =
prMapR(Q->m[i], nMap, origR, QQ_ring);
11026 for(
int i =
IDELEMS(II)-1; i>=0; i--)
11027 if(II->m[i] !=
NULL)
11028 II->m[i+1] = II->m[
i];
11031 poly integer =
NULL;
11032 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
11039 integer =
pHead(syz->m[i]);
11046 pmon =
prMapR(integer, nMap2, QQ_ring, origR);
11060 poly mindegmon =
NULL;
11061 for(
int i = 0; i<
IDELEMS(one); i++)
11065 if(mindegmon ==
NULL)
11066 mindegmon =
pCopy(one->m[i]);
11069 if(
p_Deg(one->m[i], QQ_ring) <
p_Deg(mindegmon, QQ_ring))
11070 mindegmon =
pCopy(one->m[i]);
11074 if(mindegmon !=
NULL)
11076 for(
int i =
IDELEMS(II)-1; i>=0; i--)
11077 if(II->m[i] !=
NULL)
11078 II->m[i+1] = II->m[
i];
11079 II->m[0] =
pCopy(mindegmon);
11082 for(
int i =
IDELEMS(syz)-1;i>=0; i--)
11096 if (found ==
FALSE)
11108 pmon =
prMapR(mindegmon, nMap2, QQ_ring, origR);
11139 poly pH = h->GetP();
11143 for(
int i = 0; i<=strat->
sl; i++)
11198 h->SetLmCurrRing();
11199 if((deleted)&&(h->p!=
NULL))
11207 poly hSig = h->sig;
11208 poly pH = h->GetP();
11212 for(
int i = 0; i<=strat->
sl; i++)
11223 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
11250 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
11281 h->SetLmCurrRing();
11306 if((i != j) && (strat->
Shdl->m[
i] !=
NULL))
11308 p = strat->
Shdl->m[
i];
11312 if (!
nEqual(dummy,p->coef))
11318 p=strat->
Shdl->m[
i];
11340 if (!
nEqual(dummy,pp->coef))
11382 if (expbound == 0) expbound = strat->
tailRing->bitmask << 1;
11399 new_tailRing->pFDeg =
currRing->pFDeg;
11400 new_tailRing->pLDeg =
currRing->pLDeg;
11404 Print(
"[%lu:%d", (
unsigned long) new_tailRing->bitmask, new_tailRing->ExpL_Size);
11413 for (i=0; i<=strat->
tl; i++)
11415 strat->
T[
i].ShallowCopyDelete(new_tailRing, new_tailBin,
11416 p_shallow_copy_delete);
11418 for (i=0; i<=strat->
Ll; i++)
11422 strat->
L[
i].ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11424 if ((strat->
P.t_p !=
NULL) ||
11426 strat->
P.ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11428 if ((L !=
NULL) && (L->tailRing != new_tailRing))
11431 L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11437 L->tailRing = new_tailRing;
11440 L->max_exp = t_l->max_exp;
11444 if ((T !=
NULL) && (T->tailRing != new_tailRing && T->i_r < 0))
11445 T->ShallowCopyDelete(new_tailRing, new_tailBin, p_shallow_copy_delete);
11452 strat->
tailBin = new_tailBin;
11478 unsigned long l = 0;
11484 for (i=0; i<= strat->
Ll; i++)
11488 for (i=0; i<=strat->
tl; i++)
11515 res->block0 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11516 res->block1 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11517 int **wvhdl = (
int **)
omAlloc0((n+1)*
sizeof(
int*));
11518 res->wvhdl = wvhdl;
11519 for (
int i=1; i<n; i++)
11521 res->order[
i] = r->order[i-1];
11522 res->block0[
i] = r->block0[i-1];
11523 res->block1[
i] = r->block1[i-1];
11524 res->wvhdl[
i] = r->wvhdl[i-1];
11530 for (
int i=
rBlocks(res); i>0; --
i)
11543 #ifndef SING_NDEBUG 11544 WarnS(
"error in nc_rComplete");
11563 res->block0 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11564 res->block1 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11565 int **wvhdl = (
int **)
omAlloc0((n+2)*
sizeof(
int*));
11566 res->wvhdl = wvhdl;
11567 for (
int i=2; i<n+2; i++)
11569 res->order[
i] = r->order[i-2];
11570 res->block0[
i] = r->block0[i-2];
11571 res->block1[
i] = r->block1[i-2];
11572 res->wvhdl[
i] = r->wvhdl[i-2];
11577 res->block0[0] = 1;
11578 res->wvhdl[0] = (
int *)
omAlloc(res->N*
sizeof(
int));
11579 for (
int i=0; i<res->N; ++
i)
11580 res->wvhdl[0][i] = 1;
11584 res->wvhdl[1] =
NULL;
11586 for (
int i=
rBlocks(res); i>1; --
i)
11599 #ifndef SING_NDEBUG 11600 WarnS(
"error in nc_rComplete");
11737 #ifdef HAVE_TAIL_BIN 11749 if (tailBin !=
NULL)
11753 if (t_kHEdge !=
NULL)
11755 if (t_kNoether !=
NULL)
11764 Timings
for the different possibilities of posInT:
11765 T15 EDL DL EL L 1-2-3
11766 Gonnet 43.26 42.30 38.34 41.98 38.40 100.04
11767 Hairer_2_1 1.11 1.15 1.04 1.22 1.08 4.7
11768 Twomat3 1.62 1.69 1.70 1.65 1.54 11.32
11769 ahml 4.48 4.03 4.03 4.38 4.96 26.50
11770 c7 15.02 13.98 15.16 13.24 17.31 47.89
11771 c8 505.09 407.46 852.76 413.21 499.19 n/a
11772 f855 12.65 9.27 14.97 8.78 14.23 33.12
11773 gametwo6 11.47 11.35 14.57 11.20 12.02 35.07
11774 gerhard_3 2.73 2.83 2.93 2.64 3.12 6.24
11775 ilias13 22.89 22.46 24.62 20.60 23.34 53.86
11776 noon8 40.68 37.02 37.99 36.82 35.59 877.16
11777 rcyclic_19 48.22 42.29 43.99 45.35 51.51 204.29
11778 rkat9 82.37 79.46 77.20 77.63 82.54 267.92
11779 schwarz_11 16.46 16.81 16.76 16.81 16.72 35.56
11780 test016 16.39 14.17 14.40 13.50 14.26 34.07
11781 test017 34.70 36.01 33.16 35.48 32.75 71.45
11782 test042 10.76 10.99 10.27 11.57 10.45 23.04
11783 test058 6.78 6.75 6.51 6.95 6.22 9.47
11784 test066 10.71 10.94 10.76 10.61 10.56 19.06
11785 test073 10.75 11.11 10.17 10.79 8.63 58.10
11786 test086 12.23 11.81 12.88 12.24 13.37 66.68
11787 test103 5.05 4.80 5.47 4.64 4.89 11.90
11788 test154 12.96 11.64 13.51 12.46 14.61 36.35
11789 test162 65.27 64.01 67.35 59.79 67.54 196.46
11790 test164 7.50 6.50 7.68 6.70 7.96 17.13
11791 virasoro 3.39 3.50 3.35 3.47 3.70 7.66
11801 if (length==-1)
return 0;
11804 int op=p.GetpFDeg();
11805 int ol = p.GetpLength();
11807 if (
set[length].ecart < o)
11809 if (
set[length].ecart == o)
11811 int oo=
set[
length].GetpFDeg();
11812 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
11823 if (
set[an].ecart > o)
11825 if (
set[an].ecart == o)
11827 int oo=
set[an].GetpFDeg();
11829 || ((oo==op) && (
set[an].
pLength > ol)))
11835 if (
set[i].ecart > o)
11837 else if (
set[i].ecart == o)
11839 int oo=
set[
i].GetpFDeg();
11841 || ((oo == op) && (
set[i].
pLength > ol)))
11855 if (length==-1)
return 0;
11857 int op=p.GetpFDeg();
11858 int ol = p.GetpLength();
11860 int oo=
set[
length].GetpFDeg();
11861 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
11871 int oo=
set[an].GetpFDeg();
11873 || ((oo==op) && (
set[an].
pLength > ol)))
11878 int oo=
set[
i].GetpFDeg();
11880 || ((oo == op) && (
set[i].
pLength > ol)))
11891 int ol = p.GetpLength();
11894 if (
set[length].length<p.length)
11905 if (
set[an].
pLength>ol)
return an;
11926 if (strat->
red==redFirst)
PrintS(
"redFirst\n");
11928 else if (strat->
red==redEcart)
PrintS(
"redEcart\n");
11930 else Print(
"%p\n",(
void*)strat->
red);
11949 #ifdef HAVE_MORE_POS_IN_T 11980 else if (strat->
enterS==enterSMora)
PrintS(
"enterSMora\n");
11981 else if (strat->
enterS==enterSMoraNF)
PrintS(
"enterSMoraNF\n");
11987 PrintS(
"initEcartPair: ");
11991 Print(
"homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
11993 Print(
"honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
11999 Print(
"posInLDependsOnLength=%d\n",
12031 PrintS(
"currRing->pFDeg: ");
12046 PrintS(
"ecartWeights: ");
12053 #ifndef SING_NDEBUG 12058 #ifdef HAVE_SHIFTBBA 12072 #ifdef HAVE_SHIFTBBA 12089 #ifdef HAVE_SHIFTBBA 12181 #ifdef HAVE_SHIFTBBA 12191 for (i=0; i<=strat->
sl; i++)
12193 memset(&h,0,
sizeof(h));
12196 h.sev = strat->
sevS[
i];
12210 #ifdef HAVE_SHIFTBBA 12286 #ifdef HAVE_SHIFTBBA 12292 poly
s = strat->
S[
i];
12314 qfromQ = strat->
fromQ[
i];
12324 for (
int j = 1; j <= toInsert; j++)
12332 #ifdef HAVE_SHIFTBBA 12349 for (
int j = 1; j<= toInsert; j++)
12357 #ifdef HAVE_SHIFTBBA 12385 int qfromQ = qisFromQ;
12394 Lp.ecart=0; Lp.length=0;
12405 PrintS(
"V crit applied to q = ");
12420 if((!((ecartq>0)&&(ecart>0)))
12442 Lp.ecart =
si_max(ecart,ecartq);
12443 if (strat->
fromT && (ecartq>ecart))
12460 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
12465 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12508 if (strat->
fromT && (ecartq>ecart))
12520 for(j = strat->
Bl;j>=0;j--)
12522 compare=
pDivComp(strat->
B[j].lcm,Lp.lcm);
12526 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12550 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (qfromQ!=0))
12622 if ( (atR >= 0) && (shiftcount==0) && (ifromS >=0) )
12639 && (Lp.p->coef!=
NULL))
12643 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
12649 #ifdef HAVE_SHIFTBBA 12670 for (j=0; j<=
k; j++)
12672 if (!strat->
fromQ[j])
12685 for (j=0; j<=
k; j++)
12698 for (j=0; j<=
k; j++)
12723 #ifdef HAVE_SHIFTBBA 12736 if ( (!strat->
fromT)
12745 clearS(h,h_sev, &j,&k,strat);
12754 #ifdef HAVE_SHIFTBBA 12769 for (
int i = 1; i <= toInsert; i++)
12781 #ifdef HAVE_SHIFTBBA 12788 p = h = L->GetLmTailRing();
12790 return L->GetLmCurrRing();
12797 Ln.pLength = L->GetpLength() - 1;
12805 while(!Ln.IsNull())
12809 Ln.SetShortExpVector();
12815 With = &(strat->
T[
j]);
12820 if (With ==
NULL)
break;
12836 pNext(h) = Ln.LmExtractAndIter();
12839 }
while (!Ln.IsNull());
12842 if (Ln.IsNull())
goto all_done;
12843 if (! withT) With_s.Init(
currRing);
12845 pNext(h) = Ln.LmExtractAndIter();
12860 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 __p_GetComp(p, r)
#define pSetmComp(p)
TODO:
void initEcartPairBba(LObject *Lp, poly, poly, int, int)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
static void enterOnePairSig(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
int getIndexRng(long coeff)
int posInL11(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
denominator_list_s * denominator_list
void replaceInLAndSAndT(LObject &p, int tj, kStrategy strat)
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)
int itoInsert(poly p, const ring r)
void initSbaPos(kStrategy strat)
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)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
int redRing(LObject *h, kStrategy strat)
void updateSShift(kStrategy strat)
void enterSMora(LObject &p, int atS, kStrategy strat, int atR=-1)
int kFindDivisibleByInT_Z(const kStrategy strat, const LObject *L, const int start)
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 enterTShift(LObject p, kStrategy strat, int atT)
void enterOnePairSelfShifts(poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int)
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)
#define pHasNotCFRing(p1, p2)
static int * initS_2_R(const int maxnr)
gmp_float exp(const gmp_float &a)
#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)
void enterSBbaShift(LObject &p, int atS, kStrategy strat, int atR)
long totaldegreeWecart(poly p, ring r)
void chainCritNormal(poly p, int ecart, kStrategy strat)
void initenterpairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
KINLINE int ksReducePolyTail(LObject *PR, TObject *PW, LObject *Red)
static void enterOnePairLift(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
int posInL17Ring(const LSet set, const int length, LObject *p, const kStrategy)
int posInLrg0(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
void initBuchMora(ideal F, ideal Q, kStrategy strat)
static poly p_Mult_mm(poly p, poly m, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
#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)
#define pLPCopyAndShiftLM(p, sh)
poly prMoveR(poly &p, ring src_r, ring dest_r)
void reorderS(int *suc, kStrategy strat)
void redtailBbaAlsoLC_Z(LObject *L, int end_pos, 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)
int posInL13(const LSet set, const int length, LObject *p, const kStrategy)
static BOOLEAN rIsRatGRing(const ring r)
#define TEST_OPT_CONTENTSB
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)
KINLINE int ksReducePolyTailLC_Z(LObject *PR, TObject *PW, LObject *Red)
static short rVar(const ring r)
#define rVar(r) (r->N)
static int pDivComp(poly p, poly q)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
int ksCheckCoeff(number *a, number *b)
BOOLEAN sbaCheckGcdPair(LObject *h, kStrategy strat)
void initSyzRules(kStrategy strat)
int posInT15Ring(const TSet set, const int length, LObject &p)
long pLDeg0c(poly p, int *l, const ring r)
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
static unsigned long p_GetMaxExp(const unsigned long l, const ring r)
void initenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void initSL(ideal F, ideal Q, kStrategy strat)
ring rModifyRing(ring r, BOOLEAN omit_degree, BOOLEAN try_omit_comp, unsigned long exp_limit)
void scComputeHC(ideal S, ideal Q, int ak, poly &hEdge, ring tailRing)
int posInLRing(const LSet set, const int length, LObject *p, const kStrategy)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
#define pCmp(p1, p2)
pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2))) ...
void p_Lcm(const poly a, const poly b, poly m, const ring r)
static poly pp_Mult_mm(poly p, poly m, const ring r)
static BOOLEAN p_HasNotCF_Lift(poly p1, poly p2, const ring r)
p_HasNotCF for the IDLIFT case: ignore component
denominator_list DENOMINATOR_LIST
void enterpairsSpecial(poly h, int k, int ecart, int pos, kStrategy strat, int atR=-1)
static void kDeleteLcm(LObject *P)
poly redtailBba_Z(LObject *L, int end_pos, kStrategy strat)
poly pMove2CurrTail(poly p, kStrategy strat)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
#define pHasNotCF(p1, p2)
void initSSpecialSba(ideal F, ideal Q, ideal P, kStrategy strat)
static long p_Totaldegree(poly p, const ring r)
void deleteInS(int i, kStrategy strat)
static BOOLEAN rField_is_Domain(const ring r)
pShallowCopyDeleteProc p_shallow_copy_delete
BOOLEAN(* rewCrit3)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
ring sbaRing(kStrategy strat, const ring r, BOOLEAN, int)
poly preIntegerCheck(const ideal Forig, const ideal Q)
used for GB over ZZ: look for constant and monomial elements in the ideal background: any known const...
void initSLSba(ideal F, ideal Q, kStrategy strat)
void cancelunit(LObject *L, BOOLEAN inNF)
poly kCreateZeroPoly(long exp[], long cabsind, poly *t_p, ring leadRing, ring tailRing)
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
poly nc_CreateShortSpoly(poly p1, poly p2, const ring r)
static BOOLEAN enterOneStrongPolySig(int i, poly p, poly sig, int, int, kStrategy strat, int atR)
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
static void enterOnePairSigRing(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
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)
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)
#define omMergeStickyBinIntoBin(A, B)
void initBuchMoraPosRing(kStrategy strat)
int nextZeroSimplexExponent(long exp[], long ind[], long cexp[], long cind[], long *cabsind, long step[], long bound, long N)
int redHomog(LObject *h, kStrategy strat)
static void enterOnePairRing(int i, poly p, int, int isFromQ, kStrategy strat, int atR)
static poly redBba1(poly h, int maxIndex, kStrategy strat)
int(* posInT)(const TSet T, const int tl, LObject &h)
static number p_SetCoeff(poly p, number n, ring r)
void HEckeTest(poly pp, kStrategy strat)
#define omCheckBinAddrSize(addr, size)
poly p_Sub(poly p1, poly p2, const ring r)
void chainCritSig(poly p, int, kStrategy strat)
static FORCE_INLINE BOOLEAN nCoeff_is_Z(const coeffs r)
static void p_LmFree(poly p, ring)
void enterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
#define pGetComp(p)
Component.
int posInL110(const LSet set, const int length, LObject *p, const kStrategy)
#define pLtCmpOrdSgnDiffP(p, q)
int posInT0(const TSet, const int length, LObject &)
int redFirstShift(LObject *h, kStrategy strat)
static poly p_Copy(poly p, const ring r)
returns a copy of p
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void enterExtendedSpoly(poly h, kStrategy strat)
static FORCE_INLINE number n_Ann(number a, const coeffs r)
if r is a ring with zero divisors, return an annihilator!=0 of b otherwise return NULL ...
BOOLEAN(* syzCrit)(poly sig, unsigned long not_sevSig, kStrategy strat)
char completeReduce_retry
void 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)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
#define pFalseReturn(cond)
BOOLEAN p_CheckPolyRing(poly p, ring r)
#define omReallocSize(addr, o_size, size)
void(* initEcart)(TObject *L)
#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)
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)
poly redtail(LObject *L, int end_pos, kStrategy strat)
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)
void initenterpairsShift(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR)
int posInT17Ring(const TSet set, const int length, LObject &p)
void messageStatSBA(int hilbcount, kStrategy strat)
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
void enterOneZeroPairRing(poly f, poly t_p, poly p, int ecart, kStrategy strat, int atR=-1)
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z:...
long pLDeg0(poly p, int *l, const ring r)
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
#define pp_Test(p, lmRing, tailRing)
BOOLEAN pCompareChain(poly p, poly p1, poly p2, poly lcm, const ring R)
Returns TRUE if.
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
long kHomModDeg(poly p, ring r)
poly pMoveCurrTail2poly(poly p, kStrategy strat)
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted ...
static long p_FDeg(const poly p, const ring r)
static void enterOnePairManyShifts(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
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 must be 0
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)
#define __pp_Mult_nn(p, n, r)
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)
poly redtailBbaBound(LObject *L, int end_pos, kStrategy strat, int bound, BOOLEAN withT, BOOLEAN normalize)
void kDebugPrint(kStrategy strat)
Output some debug info about a given strategy.
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...
void initBuchMoraShift(ideal F, ideal Q, kStrategy strat)
BOOLEAN rHasMixedOrdering(const ring r)
void enterOnePairShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS)
void enterT_strong(LObject &p, kStrategy strat, int atT)
poly redtailBba(LObject *L, int end_pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
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)
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat)
BOOLEAN arriRewCriterion(poly, unsigned long, poly, kStrategy strat, int start=0)
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
void enterSMoraNF(LObject &p, int atS, kStrategy strat, int atR=-1)
#define rRing_has_Comp(r)
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
static void p_Delete(poly *p, const ring r)
static FORCE_INLINE number n_ExtGcd(number a, number b, number *s, number *t, const coeffs r)
beware that ExtGCD is only relevant for a few chosen coeff. domains and may perform something unexpec...
unsigned long p_GetShortExpVector(const poly p, const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void kMergeBintoLSba(kStrategy strat)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
void initenterzeropairsRing(poly p, int ecart, kStrategy strat, int atR)
poly(* pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r, omBin dest_bin)
returns a poly from dest_r which is a ShallowCopy of s_p from source_r assumes that source_r->N == de...
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int)
#define TEST_OPT_SUGARCRIT
BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat)
void(* chainCrit)(poly p, int ecart, kStrategy strat)
void initPairtest(kStrategy strat)
long pLDegb(poly p, int *l, const ring r)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void postReduceByMon(LObject *h, kStrategy strat)
used for GB over ZZ: intermediate reduction by monomial elements background: any known constant eleme...
BOOLEAN p_CheckIsFromRing(poly p, ring r)
static BOOLEAN rField_is_Ring(const ring r)
static BOOLEAN enterOneStrongPoly(int i, poly p, int, int, kStrategy strat, int atR, bool enterTstrong)
void cleanT(kStrategy strat)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
void pEnlargeSet(poly **p, int l, int increment)
long pLDeg1_Totaldegree(poly p, int *l, const ring r)
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
int redEcart(LObject *h, kStrategy strat)
#define pLtCmpOrdSgnEqP(p, q)
BOOLEAN rHasGlobalOrdering(const ring r)
void rDelete(ring r)
unconditionally deletes fields in r
long ind_fact_2(long arg)
int posInSyz(const kStrategy strat, poly sig)
int posInT110(const TSet set, const int length, LObject &p)
#define pInit()
allocates a new monomial and initializes everything to 0
static BOOLEAN length(leftv result, leftv arg)
#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)
#define omGetStickyBinOfBin(B)
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
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat)
void chainCritOpt_1(poly, int, kStrategy strat)
void rKillModifiedRing(ring r)
long maxdegreeWecart(poly p, int *l, ring r)
static void p_Setm(poly p, const ring r)
void updateResult(ideal r, ideal Q, kStrategy strat)
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
KINLINE TObject * s_2_t(int i)
long pLDeg1_WFirstTotalDegree(poly p, int *l, const ring r)
int redFirst(LObject *h, kStrategy strat)
int posInLSpecial(const LSet set, const int length, LObject *p, const kStrategy)
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring tailRing)
static nc_type & ncRingType(nc_struct *p)
static intset initec(const int maxnr)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
static int pDivCompRing(poly p, poly q)
long pLDeg1c_WFirstTotalDegree(poly p, int *l, const ring r)
poly pCopyL2p(LObject H, kStrategy strat)
int idElem(const ideal F)
count non-zero elements
int dReportError(const char *fmt,...)
char posInLDependsOnLength
#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)
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
int kFindDivisibleByInT(const kStrategy strat, const LObject *L, const int start)
return -1 if no divisor is found number of first divisor in T, otherwise
BOOLEAN newHEdge(kStrategy strat)
int posInT19(const TSet set, const int length, LObject &p)
poly redtailBbaShift(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
void initEcartNormal(TObject *h)
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r1, const ring r2)
static LSet initL(int nr=setmaxL)
static poly p_Add_q(poly p, poly q, const ring r)
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
int posInT_EcartpLength(const TSet set, const int length, LObject &p)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
KINLINE poly kNoetherTail()
static BOOLEAN sugarDivisibleBy(int ecart1, int ecart2)
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
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)
KINLINE int ksReducePolyTail_Z(LObject *PR, TObject *PW, LObject *Red)
void exitBuchMora(kStrategy strat)
pFDegProc pOrigFDeg_TailRing
TObject * kFindDivisibleByInS_T(kStrategy strat, int end_pos, LObject *L, TObject *T, long ecart)
#define ENTER_USE_MEMMOVE
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
static int p_LtCmpNoAbs(poly p, poly q, const ring r)
int posInT17_cRing(const TSet set, const int length, LObject &p)
int posInT13(const TSet set, const int length, LObject &p)
void enterSyz(LObject &p, kStrategy strat, int atT)
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
BOOLEAN p_OneComp(poly p, const ring r)
return TRUE if all monoms have the same component
#define pCopy(p)
return a copy of the poly
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
void kBucket_Add_q(kBucket_pt bucket, poly q, int *l)
Add to Bucket a poly ,i.e. Bpoly == q+Bpoly.
poly p_GetMaxExpP(poly p, const ring r)
return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0...
int posInLSigRing(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN pCompareChainPart(poly p, poly p1, poly p2, poly lcm, const ring R)
KINLINE long GetpFDeg() const