21 #define EXT_POLY_NEW 0
51 #define ENTER_USE_MEMMOVE
90 #ifdef ENTER_USE_MYMEMMOVE
91 inline void _my_memmove_d_gt_s(
unsigned long* d,
unsigned long*
s,
long l)
93 REGISTER unsigned long* _dl = (
unsigned long*) d;
94 REGISTER unsigned long* _sl = (
unsigned long*)
s;
105 inline void _my_memmove_d_lt_s(
unsigned long* d,
unsigned long*
s,
long l)
108 REGISTER unsigned long* _dl = (
unsigned long*) d;
109 REGISTER unsigned long* _sl = (
unsigned long*)
s;
120 inline void _my_memmove(
void* d,
void*
s,
long l)
122 unsigned long _d = (
unsigned long) d;
123 unsigned long _s = (
unsigned long)
s;
124 unsigned long _l = ((
l) + SIZEOF_LONG - 1) >> LOG_SIZEOF_LONG;
126 if (_d > _s) _my_memmove_d_gt_s(_d, _s, _l);
127 else _my_memmove_d_lt_s(_d, _s, _l);
131 #define memmove(d,s,l) _my_memmove(d, s, l)
138 #define pDivComp_EQUAL 2
139 #define pDivComp_LESS 1
140 #define pDivComp_GREATER -1
141 #define pDivComp_INCOMP 0
154 unsigned long la, lb;
155 unsigned long divmask =
currRing->divmask;
165 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
172 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
203 unsigned long la, lb;
204 unsigned long divmask =
currRing->divmask;
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();
339 ring r = L->tailRing;
340 poly
p = L->GetLmTailRing();
419 number eins=
nInit(1);
507 inline static unsigned long*
initsevS (
const int maxnr)
509 return (
unsigned long*)
omAlloc0(maxnr*
sizeof(
unsigned long));
513 return (
int*)
omAlloc0(maxnr*
sizeof(
int));
517 int &
length,
const int incr)
529 (
length+incr)*
sizeof(
long*));
547 for (
j=0;
j<=strat->
tl;
j++)
551 if (strat->
T[
j].max_exp !=
NULL)
561 if (strat->
T[
j].t_p !=
NULL)
572 if (
p == strat->
S[
i])
574 if (strat->
T[
j].t_p !=
NULL)
576 if (p_shallow_copy_delete!=
NULL)
600 for (
j=0;
j<=strat->
tl;
j++)
604 if (strat->
T[
j].max_exp !=
NULL)
614 if (strat->
T[
j].t_p !=
NULL)
626 if (
p == strat->
S[
i])
628 if (strat->
T[
j].t_p !=
NULL)
675 if ((*
k) < 0)
return FALSE;
676 if (((p1 == (*p).p1) && (p2 == (*p).p2))
677 || ((p1 == (*p).p2) && (p2 == (*p).p1)))
696 if ((*
k) < 0)
return FALSE;
708 for (
i=0;
i<=tlength;
i++)
710 if (
T[
i].
p ==
p)
return i;
721 if (
i >= 0)
return i;
724 while (strat !=
NULL);
737 #define kFalseReturn(x) do { if (!x) return FALSE;} while (0)
743 for (
i=1;
i<=tailRing->N;
i++)
746 return "Lm[i] different";
749 return "Lm[0] different";
751 return "Lm.next different";
753 return "Lm.coeff different";
760 ring tailRing =
T->tailRing;
761 if (strat_tailRing ==
NULL) strat_tailRing = tailRing;
762 r_assume(strat_tailRing == tailRing);
784 if (
T->t_p ==
NULL &&
i > 0)
801 if (
T->t_p !=
NULL &&
i >= 0 && TN ==
'T')
805 if (
T->max_exp !=
NULL)
806 return dReportError(
"%c[%d].max_exp is not NULL as it should be", TN,
i);
810 if (
T->max_exp ==
NULL)
822 p_Setm(test_max, tailRing);
834 if (
T->p ==
NULL &&
i > 0)
839 if ((
i >= 0) && (
T->pLength != 0)
844 return dReportError(
"%c[%d] pLength error: has %d, specified to have %d",
849 if (
i >= 0 && (TN ==
'T' || TN ==
'L'))
852 if (
T->FDeg !=
T->pFDeg())
856 return dReportError(
"%c[%d] FDeg error: has %d, specified to have %d",
857 TN,
i ,
T->pFDeg(), d);
862 if (
i >= 0 && TN ==
'T')
889 if (L->bucket !=
NULL)
892 r_assume(L->bucket->bucket_ring == L->tailRing);
908 return dReportError(
"L[%d] wrong sev: has %o, specified to have %o",
917 else if (tlength > 0 &&
T !=
NULL && (lpos >=0) && (testp!=2))
939 -1, strat->
T, strat->
tl));
942 if (strat->
T !=
NULL)
944 for (
i=0;
i<=strat->
tl;
i++)
953 if (strat->
L !=
NULL)
958 for (
i=0;
i<=strat->
Ll;
i++)
962 strat->
T, strat->
tl));
967 for (
i=0;
i<=strat->
Ll;
i++)
970 strat->
L[
i].Next() != strat->
tail,
i,
971 strat->
T, strat->
tl));
982 if (strat->
S !=
NULL)
992 for (
i=0;
i<=strat->
sl;
i++)
994 if (strat->
S[
i] !=
NULL &&
997 return dReportError(
"S[%d] wrong sev: has %o, specified to have %o",
1013 for (
i=0;
i<=strat->
tl;
i++)
1015 if (strat->
T[
i].i_r < 0 || strat->
T[
i].i_r > strat->
tl)
1016 return dReportError(
"strat->T[%d].i_r == %d out of bounds",
i,
1018 if (strat->
R[strat->
T[
i].i_r] != &(strat->
T[
i]))
1022 if (strat->
S !=
NULL)
1024 for (
i=0;
i<=strat->
sl;
i++)
1029 if (strat->
S_2_R[
i] != strat->
T[
j].i_r)
1035 #ifdef HAVE_SHIFTBBA
1038 for (
i=0;
i<=strat->
Ll;
i++)
1040 if (strat->
L[
i].p1 !=
NULL && strat->
L[
i].p2)
1042 if (strat->
L[
i].i_r1 < 0 ||
1043 strat->
L[
i].i_r1 > strat->
tl ||
1044 strat->
L[
i].T_1(strat)->p != strat->
L[
i].p1)
1046 if (strat->
L[
i].i_r2 < 0 ||
1047 strat->
L[
i].i_r2 > strat->
tl ||
1048 strat->
L[
i].T_2(strat)->p != strat->
L[
i].p2)
1053 if (strat->
L[
i].i_r1 != -1)
1055 if (strat->
L[
i].i_r2 != -1)
1058 if (strat->
L[
i].i_r != -1)
1071 #ifdef ENTER_USE_MEMMOVE
1072 memmove(&(strat->
S[
i]), &(strat->
S[
i+1]), (strat->
sl -
i)*
sizeof(poly));
1074 memmove(&(strat->
sevS[
i]),&(strat->
sevS[
i+1]),(strat->
sl -
i)*
sizeof(
unsigned long));
1075 memmove(&(strat->
S_2_R[
i]),&(strat->
S_2_R[
i+1]),(strat->
sl -
i)*
sizeof(
int));
1078 for (
j=
i;
j<strat->
sl;
j++)
1080 strat->
S[
j] = strat->
S[
j+1];
1088 #ifdef ENTER_USE_MEMMOVE
1089 memmove(&(strat->
lenS[
i]),&(strat->
lenS[
i+1]),(strat->
sl -
i)*
sizeof(
int));
1096 #ifdef ENTER_USE_MEMMOVE
1104 #ifdef ENTER_USE_MEMMOVE
1105 memmove(&(strat->
fromQ[
i]),&(strat->
fromQ[
i+1]),(strat->
sl -
i)*
sizeof(
int));
1107 for (
j=
i;
j<strat->
sl;
j++)
1123 #ifdef ENTER_USE_MEMMOVE
1124 memmove(&(strat->
S[
i]), &(strat->
S[
i+1]), (strat->
sl -
i)*
sizeof(poly));
1125 memmove(&(strat->
sig[
i]), &(strat->
sig[
i+1]), (strat->
sl -
i)*
sizeof(poly));
1127 memmove(&(strat->
sevS[
i]),&(strat->
sevS[
i+1]),(strat->
sl -
i)*
sizeof(
unsigned long));
1128 memmove(&(strat->
sevSig[
i]),&(strat->
sevSig[
i+1]),(strat->
sl -
i)*
sizeof(
unsigned long));
1129 memmove(&(strat->
S_2_R[
i]),&(strat->
S_2_R[
i+1]),(strat->
sl -
i)*
sizeof(
int));
1132 for (
j=
i;
j<strat->
sl;
j++)
1134 strat->
S[
j] = strat->
S[
j+1];
1144 #ifdef ENTER_USE_MEMMOVE
1145 memmove(&(strat->
lenS[
i]),&(strat->
lenS[
i+1]),(strat->
sl -
i)*
sizeof(
int));
1152 #ifdef ENTER_USE_MEMMOVE
1160 #ifdef ENTER_USE_MEMMOVE
1161 memmove(&(strat->
fromQ[
i]),&(strat->
fromQ[
i+1]),(strat->
sl -
i)*
sizeof(
int));
1163 for (
j=
i;
j<strat->
sl;
j++)
1182 if (set[
j].sig!=
NULL)
1216 #ifdef ENTER_USE_MEMMOVE
1220 for (
i=
j;
i < (*length);
i++)
1242 #ifdef ENTER_USE_MEMMOVE
1243 memmove(&((*set)[at+1]), &((*set)[at]), ((*
length)-at+1)*
sizeof(
LObject));
1245 for (
i=(*
length)+1;
i>=at+1;
i--) (*set)[
i] = (*set)[
i-1];
1259 h->FDeg =
h->pFDeg();
1260 h->ecart =
h->pLDeg() -
h->FDeg;
1267 h->FDeg =
h->pFDeg();
1274 Lp->FDeg = Lp->pFDeg();
1281 Lp->FDeg = Lp->pFDeg();
1282 (*Lp).ecart =
si_max(ecartF,ecartG);
1283 (*Lp).ecart = (*Lp).ecart- (Lp->FDeg -
p_FDeg((*Lp).lcm,
currRing));
1292 return (ecart1 <= ecart2);
1323 int j,compare,compareCoeff;
1327 h.ecart=0;
h.length=0;
1346 for(
j = strat->
Bl;
j>=0;
j--)
1467 h.i_r1 = -1;
h.i_r2 = -1;
1483 posx = strat->
posInL(strat->
B,strat->
Bl,&
h,strat);
1500 poly m1, m2,
gcd,si;
1556 PrintS(
"\n--- create strong gcd poly: ");
1559 Print(
"\n strat->S[%d]: ",
i);
1583 h.i_r1 = -1;
h.i_r2 = -1;
1589 h.p1 =
p;
h.p2 = strat->
S[
i];
1604 posx = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
1609 if(
h.IsNull())
return FALSE;
1626 if(strat->
sl < 0)
return FALSE;
1628 for(
i=0;
i<strat->
sl;
i++)
1664 h->i_r1 = -1;
h->i_r2 = -1;
1686 poly m1, m2,
gcd,si;
1734 PrintS(
"\n--- create strong gcd poly: ");
1737 Print(
"\n strat->S[%d]: ",
i);
1761 if(
pLmCmp(pSigMult,sSigMult) == 0)
1770 if(
pLtCmp(pSigMult,sSigMult)==1)
1790 h.i_r1 = -1;
h.i_r2 = -1;
1798 int red_result =
redRing(&
h,strat);
1808 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1825 int red_result =
redRing(&
h,strat);
1835 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1848 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1852 h.p1 =
p;
h.p2 = strat->
S[
i];
1886 Lp.ecart=0; Lp.length=0;
1891 #ifndef HAVE_RATGRING
1893 #elif defined(HAVE_RATGRING)
1904 if((!((strat->
ecartS[
i]>0)&&(ecart>0)))
2004 for(
j = strat->
Bl;
j>=0;
j--)
2103 Lp.p1 = strat->
S[
i];
2117 Lp.i_r1 = strat->
S_2_R[
i];
2131 && (Lp.p->coef!=
NULL))
2135 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2173 Lp.ecart=0; Lp.length=0;
2180 if((!((strat->
ecartS[
i]>0)&&(ecart>0)))
2276 for(
j = strat->
Bl;
j>=0;
j--)
2332 Lp.p1 = strat->
S[
i];
2339 Lp.i_r1 = strat->
S_2_R[
i];
2353 && (Lp.p->coef!=
NULL))
2357 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2381 unsigned long pSigMultNegSev,sSigMultNegSev;
2385 Lp.ecart=0; Lp.length=0;
2390 #ifndef HAVE_RATGRING
2392 #elif defined(HAVE_RATGRING)
2422 PrintS(
"----------------\n");
2425 PrintS(
"----------------\n");
2431 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2452 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2453 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2454 || strat->
rewCrit1(sSigMult,sSigMultNegSev,Lp.lcm,strat,
i+1)
2531 Lp.sevSig = ~pSigMultNegSev;
2538 Lp.sevSig = ~sSigMultNegSev;
2549 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
2563 Lp.checked = strat->
sl+1;
2570 Lp.prod_crit =
TRUE;
2582 PrintS(
"SIGNATURE OF PAIR: ");
2586 Lp.p1 = strat->
S[
i];
2600 Lp.i_r1 = strat->
S_2_R[
i];
2614 && (Lp.p->coef!=
NULL))
2656 unsigned long pSigMultNegSev,sSigMultNegSev;
2660 Lp.ecart=0; Lp.length=0;
2665 #ifndef HAVE_RATGRING
2667 #elif defined(HAVE_RATGRING)
2703 if(pSigMult !=
NULL)
2706 if(sSigMult !=
NULL)
2710 Print(
"----------------\n");
2713 Print(
"----------------\n");
2717 if(pSigMult !=
NULL && sSigMult !=
NULL)
2726 if(pSigMult ==
NULL)
2728 if(sSigMult ==
NULL)
2738 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2760 int red_result =
redRing(&Lp,strat);
2770 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
2772 strat->
enterS(Lp,0,strat,strat->
tl);
2786 Lp.sig =
pCopy(pSigMult);
2815 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2816 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2898 Lp.sig =
pNeg(Lp.sig);
2909 Lp.sevSig = ~pSigMultNegSev;
2916 Lp.sevSig = ~sSigMultNegSev;
2928 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
2942 Lp.checked = strat->
sl+1;
2949 Lp.prod_crit =
TRUE;
2961 PrintS(
"SIGNATURE OF PAIR: ");
2965 Lp.p1 = strat->
S[
i];
2980 Lp.i_r1 = strat->
S_2_R[
i];
2994 && (Lp.p->coef!=
NULL))
3002 int red_result =
redRing(&Lp,strat);
3012 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
3015 strat->
enterS(Lp,0,strat, strat->
tl+1);
3067 Lp.p1 = strat->
S[
i];
3071 Lp.i_r1 = strat->
S_2_R[
i];
3086 && (Lp.p->coef!=
NULL))
3089 l = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
3100 int j=strat->
Ll+strat->
Bl+1;
3108 for (
i=strat->
Bl;
i>=0;
i--)
3110 j = strat->
posInL(strat->
L,
j,&(strat->
B[
i]),strat);
3121 int j=strat->
Ll+strat->
Bl+1;
3129 for (
i=strat->
Bl;
i>=0;
i--)
3152 for (
j=0;
j<=strat->
sl;
j++)
3156 for (
i=strat->
Bl;
i>=0;
i--)
3178 for (
j=strat->
Ll;
j>=0;
j--)
3184 if (strat->
L[
j].p == strat->
tail)
3230 for (
j=strat->
Ll;
j>=0;
j--)
3250 for(
i=
j-1;
i>=0;
i--)
3269 for (
j=strat->
Ll;
j>=0;
j--)
3300 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3303 if (strat->
L[
j].p2 ==
p)
3309 if ((strat->
L[
i].p2 ==
p) &&
pLmEqual(strat->
L[
j].lcm,strat->
L[
i].lcm))
3323 strat->
L[
i].p2 = strat->
tail;
3340 else if (strat->
L[
j].p2 == strat->
tail)
3379 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3382 if (strat->
L[
j].p2 ==
p)
3388 if ((strat->
L[
i].p2 ==
p) &&
pLmEqual(strat->
L[
j].lcm,strat->
L[
i].lcm))
3402 strat->
L[
i].p2 = strat->
tail;
3419 else if (strat->
L[
j].p2 == strat->
tail)
3427 #ifdef HAVE_RATGRING
3440 for (
j=0;
j<=strat->
sl;
j++)
3444 for (
i=strat->
Bl;
i>=0;
i--)
3452 Print(
"chain-crit-part: S[%d]=",
j);
3454 Print(
" divide B[%d].lcm=",
i);
3476 for (
j=strat->
Ll;
j>=0;
j--)
3482 if (strat->
L[
j].p == strat->
tail)
3486 PrintS(
"chain-crit-part: pCompareChainPart p=");
3488 Print(
" delete L[%d]",
j);
3517 Print(
"chain-crit-part: sugar B[%d].lcm=",
j);
3519 Print(
" delete B[%d]",
i);
3530 Print(
"chain-crit-part: sugar B[%d].lcm=",
i);
3532 Print(
" delete B[%d]",
j);
3552 for (
j=strat->
Ll;
j>=0;
j--)
3560 PrintS(
"chain-crit-part: sugar:pCompareChainPart p=");
3562 Print(
" delete L[%d]",
j);
3580 for(
i=
j-1;
i>=0;
i--)
3586 Print(
"chain-crit-part: equal lcm B[%d].lcm=",
j);
3588 Print(
" delete B[%d]\n",
i);
3605 for (
j=strat->
Ll;
j>=0;
j--)
3613 PrintS(
"chain-crit-part: pCompareChainPart p=");
3615 Print(
" delete L[%d]",
j);
3644 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3647 if (strat->
L[
j].p2 ==
p)
3653 if ((strat->
L[
i].p2 ==
p) &&
pLmEqual(strat->
L[
j].lcm,strat->
L[
i].lcm))
3670 strat->
L[
i].p2 = strat->
tail;
3677 PrintS(
"chain-crit-part: divisible_by p=");
3679 Print(
" delete L[%d]",
l);
3690 PrintS(
"chain-crit-part: divisible_by(2) p=");
3692 Print(
" delete L[%d]",
i);
3703 else if (strat->
L[
j].p2 == strat->
tail)
3731 for (
j=0;
j<=
k;
j++)
3744 for (
j=0;
j<=
k;
j++)
3753 for (
j=0;
j<=
k;
j++)
3766 #ifdef HAVE_RATGRING
3796 for (
j=0;
j<=
k;
j++)
3809 for (
j=0;
j<=
k;
j++)
3818 for (
j=0;
j<=
k;
j++)
3832 #ifdef HAVE_RATGRING
3889 #ifdef HAVE_RATGRING
3917 for (
j=0;
j<=strat->
sl;
j++)
3921 for (
i=strat->
Bl;
i>=0;
i--)
3928 PrintS(
"--- chain criterion func chainCritRing type 1\n");
3931 PrintS(
" strat->B[i].lcm:");
3936 wrp(strat->
B[
i].lcm);
3951 for (
j=strat->
Ll;
j>=0;
j--)
3964 PrintS(
"--- chain criterion func chainCritRing type 2\n");
3965 PrintS(
"strat->L[j].p:");
3996 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3999 if (strat->
L[
j].p2 ==
p)
4014 PrintS(
"--- chain criterion func chainCritRing type 3\n");
4015 PrintS(
"strat->L[j].lcm:");
4016 wrp(strat->
L[
j].lcm);
4017 PrintS(
" strat->L[i].lcm:");
4018 wrp(strat->
L[
i].lcm);
4032 strat->
L[
i].p2 = strat->
tail;
4049 else if (strat->
L[
j].p2 == strat->
tail)
4063 if (arg <= 0)
return 0;
4075 if (arg <= 0)
return 0;
4076 if (arg%2 == 1) { arg--; }
4086 #ifdef HAVE_VANIDEAL
4097 int l,
j,compare,compareCoeff;
4101 Lp.ecart=0; Lp.length=0;
4114 for(
j = strat->
Bl;
j>=0;
j--)
4118 if (compareCoeff == 0 || compare == compareCoeff)
4136 if (compareCoeff == 1)
4143 if (compareCoeff == -1)
4186 tmp_h.SetShortExpVector();
4191 enterT(tmp_h, strat, strat->
tl + 1);
4196 Lp.i_r1 = strat->
tl;
4200 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
4214 if ((*cabsind <
bound) && (*cabsind - step[1] +
add <
bound))
4223 if (
N == 1)
return 0;
4225 while (
exp[
i] == cexp[
i] &&
i <=
N)
i++;
4227 *cabsind -= cind[
i];
4230 *cabsind += cind[
i];
4233 if (
i >
N)
return 0;
4237 for (
int j =
i + 1;
j <=
N;
j++)
4239 if (step[1] > step[
j]) step[1] = step[
j];
4242 if (*cabsind - step[1] +
add >=
bound)
4245 *cabsind -= cind[
i];
4247 *cabsind += cind[
i];
4250 if (
i >
N)
return 0;
4253 }
while (step[1] != -1);
4259 for (
i = 2;
i <=
N;
i++)
4261 if (step[1] > step[
i]) step[1] = step[
i];
4279 poly zeroPoly =
NULL;
4287 for (
int i = 1;
i <= leadRing->N;
i++)
4293 if (cabsind < leadRing->ch)
4295 zeroPoly =
p_ISet(
twoPow(leadRing->ch - cabsind), tailRing);
4299 zeroPoly =
p_ISet(1, tailRing);
4301 for (
int i = 1;
i <= leadRing->N;
i++)
4303 for (
long j = 1;
j <=
exp[
i];
j++)
4321 for (
int i = 1;
i <= leadRing->N;
i++)
4327 zeroPoly =
pNext(zeroPoly);
4353 if (
exp[
i] & 1 != 0)
4368 PrintS(
"-------------\npoly :");
4371 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4372 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4374 Print(
"cind : %d\n", cabsind);
4391 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4427 PrintS(
"-------------\npoly :");
4430 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4431 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4433 Print(
"cind : %d\n", cabsind);
4451 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4459 G0->m[
IDELEMS(G0) - 1] = zeroPoly;
4478 for (
j=0;
j<=
k;
j++)
4485 && ((iCompH<=strat->syzComp)||(strat->
syzComp==0)))
4507 && ((iCompH<=strat->syzComp)||(strat->
syzComp==0)))
4554 PrintS(
"--- create zero spoly: ");
4583 posx = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
4636 PrintS(
"--- create zero spoly: ");
4664 int red_result =
redRing(&Lp,strat);
4674 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
4676 strat->
enterS(Lp,0,strat,strat->
tl);
4724 if ( (!strat->
fromT)
4781 if ( (!strat->
fromT)
4806 if ( (!strat->
fromT)
4831 for (
j=0;
j<=
k;
j++)
4834 if ((iCompH==iCompSj)
4845 for (
j=0;
j<=
k;
j++)
4848 if ((iCompH==iCompSj)
4900 int i,
j,at,ecart, s2r;
4904 int new_suc=strat->
sl+1;
4908 for (;
i<=strat->
sl;
i++)
4913 if (new_suc > at) new_suc = at;
4916 sev = strat->
sevS[
i];
4919 for (
j=
i;
j>=at+1;
j--)
4921 strat->
S[
j] = strat->
S[
j-1];
4927 strat->
ecartS[at] = ecart;
4928 strat->
sevS[at] = sev;
4929 strat->
S_2_R[at] = s2r;
4932 for (
j=
i;
j>=at+1;
j--)
4936 strat->
fromQ[at]=fq;
4940 if (new_suc <= strat->sl) *suc=new_suc;
5003 if (cmp == cmp_int)
return an;
5004 if (cmp == -cmp_int)
return en;
5010 if (cmp == cmp_int) en =
i;
5011 else if (cmp == -cmp_int) an =
i;
5027 if (
pLmCmp(set[an],
p) == cmp_int)
return an;
5028 if (
pLmCmp(set[an],
p) == -cmp_int)
return en;
5030 && ((strat->
ecartS[an])>ecart_p))
5036 else if (
pLmCmp(set[
i],
p) == -cmp_int) an=
i;
5040 &&((strat->
ecartS[
i])<ecart_p))
5068 || ((op == o) && (
pLtCmp(set[mon],
p) == -1)))
5079 || ((op == o) && (
pLtCmp(set[an],
p) == -1)))
5086 || ((op == o) && (
pLtCmp(set[
i],
p) == -1)))
5112 || ((op == o) && (
pLtCmp(set[an],
p) == -1)))
5119 || ((op == o) && (
pLtCmp(set[
i],
p) == -1)))
5131 if(end < 0 || end >=
IDELEMS(F))
5133 if (end<0)
return 0;
5140 for(
i=start;
i<end;
i++)
5154 || ((op == o) && (
pLtCmp(set[an],
p) == -1)))
5161 || ((op == o) && (
pLtCmp(set[
i],
p) == -1)))
5186 if (
length==-1)
return 0;
5228 if (set[an].
length>
p.length)
return an;
5244 if (
length==-1)
return 0;
5246 int o =
p.GetpFDeg();
5247 int op = set[
length].GetpFDeg();
5261 op= set[an].GetpFDeg();
5268 op = set[
i].GetpFDeg();
5280 if (
length==-1)
return 0;
5282 int o =
p.GetpFDeg();
5283 int op = set[
length].GetpFDeg();
5297 op= set[an].GetpFDeg();
5304 op = set[
i].GetpFDeg();
5321 if (
length==-1)
return 0;
5322 int o =
p.GetpFDeg();
5323 int op = set[
length].GetpFDeg();
5335 op = set[an].GetpFDeg();
5336 if (op > o)
return an;
5337 if (op < 0)
return en;
5339 if (cmp == cmp_int)
return an;
5340 if (cmp == -cmp_int)
return en;
5345 op = set[
i].GetpFDeg();
5347 else if (op < o) an =
i;
5351 if (cmp == cmp_int) en =
i;
5352 else if (cmp == -cmp_int) an =
i;
5398 if (
length==-1)
return 0;
5400 int o =
p.GetpFDeg();
5401 int op = set[
length].GetpFDeg();
5405 || (( op == o) && (set[
length].length ==
p.length)
5416 op = set[an].GetpFDeg();
5418 || (( op == o) && (set[an].
length >
p.length))
5419 || (( op == o) && (set[an].length ==
p.length)
5425 op = set[
i].GetpFDeg();
5427 || (( op == o) && (set[
i].
length >
p.length))
5428 || (( op == o) && (set[
i].length ==
p.length)
5440 if (
length==-1)
return 0;
5442 int o =
p.GetpFDeg();
5443 int op = set[
length].GetpFDeg();
5447 || (( op == o) && (set[
length].length ==
p.length)
5458 op = set[an].GetpFDeg();
5460 || (( op == o) && (set[an].
length >
p.length))
5461 || (( op == o) && (set[an].length ==
p.length)
5467 op = set[
i].GetpFDeg();
5469 || (( op == o) && (set[
i].
length >
p.length))
5470 || (( op == o) && (set[
i].length ==
p.length)
5486 if (
length==-1)
return 0;
5488 int o =
p.GetpFDeg();
5490 if (set[
length].GetpFDeg() <= o)
5500 if (set[an].GetpFDeg() > o)
5505 if (set[
i].GetpFDeg() > o)
5515 int ol =
p.GetpLength();
5516 if (
length==-1)
return 0;
5520 int oo=set[
length].ecart;
5521 if ((oo < op) || ((oo==op) && (set[
length].
length < ol)))
5531 int oo=set[an].ecart;
5533 || ((oo==op) && (set[an].
pLength > ol)))
5538 int oo=set[
i].ecart;
5540 || ((oo == op) && (set[
i].
pLength > ol)))
5572 if (
length==-1)
return 0;
5574 int o =
p.GetpFDeg() +
p.ecart;
5589 op = set[an].GetpFDeg()+set[an].ecart;
5596 op = set[
i].GetpFDeg()+set[
i].ecart;
5608 if (
length==-1)
return 0;
5610 int o =
p.GetpFDeg() +
p.ecart;
5625 op = set[an].GetpFDeg()+set[an].ecart;
5632 op = set[
i].GetpFDeg()+set[
i].ecart;
5669 if (
length==-1)
return 0;
5671 int o =
p.GetpFDeg() +
p.ecart;
5675 || (( op == o) && (set[
length].ecart >
p.ecart))
5676 || (( op == o) && (set[
length].ecart==
p.ecart)
5687 op = set[an].GetpFDeg()+set[an].ecart;
5689 || (( op == o) && (set[an].ecart <
p.ecart))
5690 || (( op == o) && (set[an].ecart==
p.ecart)
5696 op = set[
i].GetpFDeg()+set[
i].ecart;
5698 || (( op == o) && (set[
i].ecart <
p.ecart))
5699 || (( op == o) && (set[
i].ecart ==
p.ecart)
5710 if (
length==-1)
return 0;
5712 int o =
p.GetpFDeg() +
p.ecart;
5716 || (( op == o) && (set[
length].ecart >
p.ecart))
5717 || (( op == o) && (set[
length].ecart==
p.ecart)
5728 op = set[an].GetpFDeg()+set[an].ecart;
5730 || (( op == o) && (set[an].ecart <
p.ecart))
5731 || (( op == o) && (set[an].ecart==
p.ecart)
5737 op = set[
i].GetpFDeg()+set[
i].ecart;
5739 || (( op == o) && (set[
i].ecart <
p.ecart))
5740 || (( op == o) && (set[
i].ecart ==
p.ecart)
5756 if (
length==-1)
return 0;
5760 int o =
p.GetpFDeg() +
p.ecart;
5769 || ((op == o) && (set[
length].ecart >
p.ecart))
5770 || ((op == o) && (set[
length].ecart==
p.ecart)
5786 int op = set[an].GetpFDeg()+set[an].ecart;
5788 || ((op == o) && (set[an].ecart <
p.ecart))
5789 || ((op == o) && (set[an].ecart==
p.ecart)
5800 int op = set[
i].GetpFDeg()+set[
i].ecart;
5802 || ((op == o) && (set[
i].ecart <
p.ecart))
5803 || ((op == o) && (set[
i].ecart ==
p.ecart)
5817 if (
length==-1)
return 0;
5821 int o =
p.GetpFDeg() +
p.ecart;
5830 || ((op == o) && (set[
length].ecart >
p.ecart))
5831 || ((op == o) && (set[
length].ecart==
p.ecart)
5847 int op = set[an].GetpFDeg()+set[an].ecart;
5849 || ((op == o) && (set[an].ecart <
p.ecart))
5850 || ((op == o) && (set[an].ecart==
p.ecart)
5861 int op = set[
i].GetpFDeg()+set[
i].ecart;
5863 || ((op == o) && (set[
i].ecart <
p.ecart))
5864 || ((op == o) && (set[
i].ecart ==
p.ecart)
5884 if (
length==-1)
return 0;
5887 int op=
p.GetpFDeg();
5889 if (set[
length].ecart < o)
5891 if (set[
length].ecart == o)
5893 int oo=set[
length].GetpFDeg();
5894 if ((oo < op) || ((oo==op) && (set[
length].
length <
p.length)))
5905 if (set[an].ecart > o)
5907 if (set[an].ecart == o)
5909 int oo=set[an].GetpFDeg();
5911 || ((oo==op) && (set[an].
length >
p.length)))
5917 if (set[
i].ecart > o)
5919 else if (set[
i].ecart == o)
5921 int oo=set[
i].GetpFDeg();
5923 || ((oo == op) && (set[
i].
length >
p.length)))
5943 int d=
p->GetpFDeg();
5944 int op=set[
length].GetpFDeg();
5958 op=set[an].GetpFDeg();
5960 || ((op == d) && (
p->p1!=
NULL) && (set[an].p1==
NULL))
5966 op=set[
i].GetpFDeg();
5968 || ((op==d) && (
p->p1!=
NULL) && (set[
i].p1==
NULL))
6081 cmp =
pLtCmp(set[an].sig,
p->sig);
6088 if (set[an].FDeg >
p->FDeg)
6090 if (set[an].FDeg < p->FDeg)
6092 if (set[an].FDeg ==
p->FDeg)
6110 if (set[
i].FDeg >
p->FDeg)
6112 if (set[
i].FDeg < p->FDeg)
6114 if (set[
i].FDeg ==
p->FDeg)
6129 if (
length < 0)
return 0;
6130 if (set[
length].FDeg >
p->FDeg)
6132 if (set[
length].FDeg ==
p->FDeg)
6133 if(set[
length].GetpLength() >
p->GetpLength())
6144 if (set[an].FDeg >
p->FDeg)
6146 if(set[an].FDeg ==
p->FDeg)
6148 if(set[an].GetpLength() >
p->GetpLength())
6152 if(set[an].GetpLength() ==
p->GetpLength())
6169 if (set[
i].FDeg >
p->FDeg)
6173 if(set[
i].FDeg ==
p->FDeg)
6175 if(set[
i].GetpLength() >
p->GetpLength())
6179 if(set[
i].GetpLength() ==
p->GetpLength())
6201 if (strat->
syzl==0)
return 0;
6206 int en= strat->
syzl-1;
6244 int o =
p->GetpFDeg();
6245 int op = set[
length].GetpFDeg();
6257 op = set[an].GetpFDeg();
6264 op = set[
i].GetpFDeg();
6286 int o =
p->GetpFDeg();
6287 int op = set[
length].GetpFDeg();
6299 op = set[an].GetpFDeg();
6306 op = set[
i].GetpFDeg();
6320 int o =
p->GetpFDeg();
6321 int op = set[
length].GetpFDeg();
6333 op = set[an].GetpFDeg();
6340 op = set[
i].GetpFDeg();
6354 if (
length < 0)
return 0;
6364 if (set[an].FDeg >
p->FDeg)
6366 if (set[an].FDeg < p->FDeg)
6368 if (set[an].FDeg ==
p->FDeg)
6376 if (set[an].t_p!=
NULL)
6398 if (set[
i].FDeg >
p->FDeg)
6400 if (set[
i].FDeg < p->FDeg)
6402 if (set[
i].FDeg ==
p->FDeg)
6410 if (set[
i].t_p!=
NULL)
6442 if (coeff == 0)
return -1;
6445 while (tmp % 2 == 0)
6464 if (
length < 0)
return 0;
6466 int o =
p->GetpFDeg();
6467 int op = set[
length].GetpFDeg();
6478 op = set[an].GetpFDeg();
6479 if ((op > o) || ((op == o) && (
pLmCmp(set[an].
p,
p->p) != -
currRing->OrdSgn)))
6484 op = set[
i].GetpFDeg();
6542 int o =
p->GetpFDeg();
6543 int op = set[
length].GetpFDeg();
6547 || ((op == o) && (set[
length].length <=
p->length)
6557 op = set[an].GetpFDeg();
6559 || ((op == o) && (set[an].
length >
p->length))
6560 || ((op == o) && (set[an].length <=
p->length)
6566 op = set[
i].GetpFDeg();
6568 || ((op == o) && (set[
i].
length >
p->length))
6569 || ((op == o) && (set[
i].length <=
p->length)
6583 int o =
p->GetpFDeg();
6584 int op = set[
length].GetpFDeg();
6588 || ((op == o) && (set[
length].length <=
p->length)
6598 op = set[an].GetpFDeg();
6600 || ((op == o) && (set[an].
length >
p->length))
6601 || ((op == o) && (set[an].length <=
p->length)
6607 op = set[
i].GetpFDeg();
6609 || ((op == o) && (set[
i].
length >
p->length))
6610 || ((op == o) && (set[
i].length <=
p->length)
6630 int o =
p->GetpFDeg();
6632 if (set[
length].GetpFDeg() > o)
6642 if (set[an].GetpFDeg() >= o)
6647 if (set[
i].GetpFDeg() >= o)
6665 int o =
p->GetpFDeg() +
p->ecart;
6678 op = set[an].GetpFDeg() + set[an].ecart;
6685 op = set[
i].GetpFDeg() + set[
i].ecart;
6700 int o =
p->GetpFDeg() +
p->ecart;
6713 op = set[an].GetpFDeg() + set[an].ecart;
6720 op = set[
i].GetpFDeg() + set[
i].ecart;
6741 int o =
p->GetpFDeg() +
p->ecart;
6745 && (set[
length].ecart >
p->ecart))
6747 && (set[
length].ecart ==
p->ecart)
6757 if ((set[an].GetpFDeg() + set[an].ecart > o)
6758 || ((set[an].GetpFDeg() + set[an].ecart == o)
6759 && (set[an].ecart >
p->ecart))
6760 || ((set[an].GetpFDeg() + set[an].ecart == o)
6761 && (set[an].ecart ==
p->ecart)
6767 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6768 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6769 && (set[
i].ecart >
p->ecart))
6770 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6771 && (set[
i].ecart ==
p->ecart)
6785 int o =
p->GetpFDeg() +
p->ecart;
6789 && (set[
length].ecart >
p->ecart))
6791 && (set[
length].ecart ==
p->ecart)
6801 if ((set[an].GetpFDeg() + set[an].ecart > o)
6802 || ((set[an].GetpFDeg() + set[an].ecart == o)
6803 && (set[an].ecart >
p->ecart))
6804 || ((set[an].GetpFDeg() + set[an].ecart == o)
6805 && (set[an].ecart ==
p->ecart)
6811 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6812 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6813 && (set[
i].ecart >
p->ecart))
6814 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6815 && (set[
i].ecart ==
p->ecart)
6838 int o =
p->GetpFDeg() +
p->ecart;
6846 && (set[
length].ecart >
p->ecart))
6848 && (set[
length].ecart ==
p->ecart)
6863 if ((set[an].GetpFDeg() + set[an].ecart > o)
6864 || ((set[an].GetpFDeg() + set[an].ecart == o)
6865 && (set[an].ecart >
p->ecart))
6866 || ((set[an].GetpFDeg() + set[an].ecart == o)
6867 && (set[an].ecart ==
p->ecart)
6878 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6879 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6880 && (set[
i].ecart >
p->ecart))
6881 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6882 && (set[
i].ecart ==
p->ecart)
6902 int o =
p->GetpFDeg() +
p->ecart;
6910 && (set[
length].ecart >
p->ecart))
6912 && (set[
length].ecart ==
p->ecart)
6927 if ((set[an].GetpFDeg() + set[an].ecart > o)
6928 || ((set[an].GetpFDeg() + set[an].ecart == o)
6929 && (set[an].ecart >
p->ecart))
6930 || ((set[an].GetpFDeg() + set[an].ecart == o)
6931 && (set[an].ecart ==
p->ecart)
6942 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6943 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6944 && (set[
i].ecart >
p->ecart))
6945 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6946 && (set[
i].ecart ==
p->ecart)
6965 PrintS(
"syzygy criterion checks: ");
6968 for (
int k=0;
k<strat->
syzl;
k++)
6973 Print(
"checking with: %d / %d -- \n",
k,strat->
syzl);
7002 PrintS(
"--- syzygy criterion checks: ");
7027 Print(
"checking with: %d -- ",
k);
7052 PrintS(
"rewritten criterion checks: ");
7055 for(
int k = strat->
sl;
k>=start;
k--)
7059 PrintS(
"checking with: ");
7075 PrintS(
"ALL ELEMENTS OF S\n----------------------------------------\n");
7076 for(
int kk = 0; kk<strat->
sl+1; kk++)
7080 PrintS(
"------------------------------\n");
7110 for (
int ii=strat->
sl; ii>start; ii--)
7116 if (!(
pLmCmp(p1,p2) == 1))
7135 for (
int i=strat->
Bl;
i>-1;
i--) {
7155 for (
int ii=strat->
sl; ii>-1; ii--)
7161 if (!(
pLmCmp(p1,p2) == 1))
7182 const unsigned long not_sev = ~L->sev;
7183 const unsigned long* sev = strat->
sevS;
7196 if (
j > end_pos)
return NULL;
7197 #if defined(PDEBUG) || defined(PDIV_DEBUG)
7199 (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]))
7204 if (!(sev[
j] & not_sev) &&
7205 (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]) &&
7219 if (
j > end_pos)
return NULL;
7220 #if defined(PDEBUG) || defined(PDIV_DEBUG)
7227 if (!(sev[
j] & not_sev) &&
7228 (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]) &&
7239 if (strat->
tl < 0 || strat->
S_2_R[
j] == -1)
7260 if (
j > end_pos)
return NULL;
7262 #if defined(PDEBUG) || defined(PDIV_DEBUG)
7266 (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]))
7272 if (! (sev[
j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]))
7275 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[
j]);
7291 if (
j > end_pos)
return NULL;
7293 #if defined(PDEBUG) || defined(PDIV_DEBUG)
7303 if (! (sev[
j] & not_sev) && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]))
7306 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[
j]);
7357 if (With ==
NULL)
break;
7367 return redtail(L, end_pos, strat);
7373 if (hn ==
NULL)
goto all_done;
7394 return redtail(&L, end_pos, strat);
7399 #define REDTAIL_CANONICALIZE 100
7403 p =
h = L->GetLmTailRing();
7405 return L->GetLmCurrRing();
7440 Ln.SetShortExpVector();
7446 With = &(strat->
T[
j]);
7447 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
7452 if (With ==
NULL)
break;
7453 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
7480 pNext(
h) = Ln.LmExtractAndIter();
7483 }
while (!Ln.IsNull());
7486 if (Ln.IsNull())
goto all_done;
7487 if (! withT) With_s.Init(
currRing);
7489 pNext(
h) = Ln.LmExtractAndIter();
7508 return L->GetLmCurrRing();
7516 p =
h = L->GetLmTailRing();
7518 return L->GetLmCurrRing();
7525 Ln.pLength = L->GetpLength() - 1;
7549 Ln.SetShortExpVector();
7555 With = &(strat->
T[
j]);
7560 if (With ==
NULL)
break;
7587 pNext(
h) = Ln.LmExtractAndIter();
7590 }
while (!Ln.IsNull());
7602 if (! withT) With_s.Init(
currRing);
7604 pNext(
h) = Ln.LmExtractAndIter();
7623 return L->GetLmCurrRing();
7633 p =
h = L->GetLmTailRing();
7635 return L->GetLmCurrRing();
7642 Ln.pLength = L->GetpLength() - 1;
7655 Ln.SetShortExpVector();
7657 if (With ==
NULL)
break;
7667 poly p_Ln=Ln.GetLmCurrRing();
7668 poly p_With=With->GetLmCurrRing();
7680 if (Ln.bucket!=
NULL)
7711 pNext(
h) = Ln.LmExtractAndIter();
7714 }
while (!Ln.IsNull());
7717 if (Ln.IsNull())
goto all_done;
7720 pNext(
h) = Ln.LmExtractAndIter();
7738 return L->GetLmCurrRing();
7754 if (strat->
Ll != *reduc)
7756 if (strat->
Ll != *reduc-1)
7768 if (red_result == 0)
7770 else if (red_result < 0)
7772 if ((red_result > 0) || ((strat->
Ll % 100)==99))
7774 if (strat->
Ll != *reduc && strat->
Ll > 0)
7791 Print(
"product criterion:%d chain criterion:%d\n",strat->
cp,strat->
c3);
7792 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7794 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7805 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7807 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7822 for (
i=0;
i<=strat->
sl;
i++)
7832 for (
i=0;
i<=strat->
tl;
i++)
7836 if (strat->
T[
i].length==0) strat->
T[
i].length=
pLength(strat->
T[
i].p);
7837 Print(
" o:%ld e:%d l:%d",
7838 strat->
T[
i].pFDeg(),strat->
T[
i].ecart,strat->
T[
i].length);
7843 for (
i=strat->
Ll;
i>=0;
i--)
7852 Print(
" o:%ld e:%d l:%d",
7853 strat->
L[
i].pFDeg(),strat->
L[
i].ecart,strat->
L[
i].length);
7875 strat->
S=strat->
Shdl->m;
7880 memset(strat->
fromQ,0,
i*
sizeof(
int));
7909 strat->
enterS(
h,pos,strat,-1);
7910 strat->
fromQ[pos]=1;
7943 strat->
enterS(
h,pos,strat,-1);
7969 strat->
S=strat->
Shdl->m;
7974 memset(strat->
fromQ,0,
i*
sizeof(
int));
8003 strat->
enterS(
h,pos,strat,-1);
8004 strat->
fromQ[pos]=1;
8036 pos = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
8066 strat->
S = strat->
Shdl->m;
8079 memset(strat->
fromQ,0,
i*
sizeof(
int));
8108 strat->
enterS(
h,pos,strat,-1);
8109 strat->
fromQ[pos]=1;
8219 for(
i=1;
i<=strat->
sl;
i++)
8231 strat->
syz = (poly *)
omAlloc(ps*
sizeof(poly));
8235 #if defined(DEBUGF5) || defined(DEBUGF51)
8236 PrintS(
"------------- GENERATING SYZ RULES NEW ---------------\n");
8243 while (i <= strat->sl)
8273 for (
k = 0;
k<
i;
k++)
8317 for (
k = 0;
k<strat->
sl+1;
k++)
8338 PrintS(
"Principal syzygies:\n");
8341 Print(
"ps %d\n",ps);
8342 PrintS(
"--------------------------------\n");
8352 PrintS(
"--------------------------------\n");
8372 strat->
S=strat->
Shdl->m;
8378 memset(strat->
fromQ,0,
i*
sizeof(
int));
8407 strat->
enterS(
h,pos,strat, strat->
tl+1);
8409 strat->
fromQ[pos]=1;
8437 strat->
enterS(
h,pos,strat, strat->
tl+1);
8479 h.is_normalized = 0;
8486 strat->
enterS(
h,pos,strat, strat->
tl+1);
8516 strat->
S=strat->
Shdl->m;
8522 memset(strat->
fromQ,0,
i*
sizeof(
int));
8551 strat->
enterS(
h,pos,strat, strat->
tl+1);
8553 strat->
fromQ[pos]=1;
8581 strat->
enterS(
h,pos,strat, strat->
tl+1);
8623 h.is_normalized = 0;
8630 strat->
enterS(
h,pos,strat, strat->
tl+1);
8654 while (
j <= maxIndex)
8671 if (!
pIsVector((*p).p) && ((*p).ecart != 0))
8680 h1 = r =
pCopy((*p).p);
8733 while ((j <= strat->sl) && (
pGetComp(strat->
S[
j])!=0))
j++;
8735 while (j<=strat->sl)
8759 while (
j <= maxIndex)
8813 while (
j <= maxIndex);
8843 while (i<=strat->sl)
8854 if (
pCmp(redSi,strat->
S[
i])!=0)
8911 if (any_change)
reorderS(&suc,strat);
8916 for (
i=0;
i<=strat->
sl;
i++)
8950 while (i<=strat->sl)
8962 else if (
pCmp((strat->
S)[
i],redSi)!=0)
9003 if (any_change)
reorderS(&suc,strat);
9004 else { suc=-1;
break; }
9015 for (
i=0;
i<=strat->
sl;
i++)
9039 if (suc!= -1)
updateS(toT,strat);
9059 *
sizeof(
unsigned long));
9086 strat->
Shdl->m=strat->
S;
9088 if (atS <= strat->sl)
9090 #ifdef ENTER_USE_MEMMOVE
9091 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9092 (strat->
sl - atS + 1)*
sizeof(poly));
9093 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9094 (strat->
sl - atS + 1)*
sizeof(
int));
9095 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9096 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9097 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9098 (strat->
sl - atS + 1)*
sizeof(
int));
9100 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9101 (strat->
sl - atS + 1)*
sizeof(
int));
9103 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9106 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9108 strat->
S[
i] = strat->
S[
i-1];
9114 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9117 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9123 #ifdef ENTER_USE_MEMMOVE
9124 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9125 (strat->
sl - atS + 1)*
sizeof(
int));
9127 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9132 strat->
fromQ[atS]=0;
9143 strat->
sevS[atS] =
p.sev;
9145 strat->
S_2_R[atS] = atR;
9162 *
sizeof(
unsigned long));
9166 *
sizeof(
unsigned long));
9194 strat->
Shdl->m=strat->
S;
9201 if (atS <= strat->sl)
9203 #ifdef ENTER_USE_MEMMOVE
9204 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9205 (strat->
sl - atS + 1)*
sizeof(poly));
9206 memmove(&(strat->
sig[atS+1]), &(strat->
sig[atS]),
9207 (strat->
sl - atS + 1)*
sizeof(poly));
9208 memmove(&(strat->
sevSig[atS+1]), &(strat->
sevSig[atS]),
9209 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9210 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9211 (strat->
sl - atS + 1)*
sizeof(
int));
9212 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9213 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9214 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9215 (strat->
sl - atS + 1)*
sizeof(
int));
9217 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9218 (strat->
sl - atS + 1)*
sizeof(
int));
9220 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9223 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9225 strat->
S[
i] = strat->
S[
i-1];
9233 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9236 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9242 #ifdef ENTER_USE_MEMMOVE
9243 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9244 (strat->
sl - atS + 1)*
sizeof(
int));
9246 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9251 strat->
fromQ[atS]=0;
9255 strat->
S[atS] =
p.p;
9256 strat->
sig[atS] =
p.sig;
9262 strat->
sevS[atS] =
p.sev;
9272 strat->
sevSig[atS] =
p.sevSig;
9275 strat->
S_2_R[atS] = atR;
9279 Print(
"--- LIST S: %d ---\n",strat->
sl);
9280 for(
k=0;
k<=strat->
sl;
k++)
9284 PrintS(
"--- LIST S END ---\n");
9305 for(
i=strat->
tl;
i>=0;
i--)
9307 if (
p.p==strat->
T[
i].p)
9309 printf(
"already in T at pos %d of %d, atT=%d\n",
i,strat->
tl,atT);
9315 #ifdef HAVE_TAIL_RING
9318 p.t_p=
p.GetLmTailRing();
9324 if (strat->
tl == strat->
tmax-1)
9326 if (atT <= strat->tl)
9328 #ifdef ENTER_USE_MEMMOVE
9329 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9331 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9332 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9334 for (
i=strat->
tl+1;
i>=atT+1;
i--)
9336 #ifndef ENTER_USE_MEMMOVE
9337 strat->
T[
i] = strat->
T[
i-1];
9340 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9358 strat->
T[atT].max_exp =
NULL;
9361 strat->
R[strat->
tl] = &(strat->
T[atT]);
9362 strat->
T[atT].i_r = strat->
tl;
9387 for(
i=strat->
tl;
i>=0;
i--)
9389 if (
p.p==strat->
T[
i].p)
9391 printf(
"already in T at pos %d of %d, atT=%d\n",
i,strat->
tl,atT);
9397 #ifdef HAVE_TAIL_RING
9400 p.t_p=
p.GetLmTailRing();
9406 if (strat->
tl == strat->
tmax-1)
9408 if (atT <= strat->tl)
9410 #ifdef ENTER_USE_MEMMOVE
9411 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9413 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9414 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9416 for (
i=strat->
tl+1;
i>=atT+1;
i--)
9418 #ifndef ENTER_USE_MEMMOVE
9419 strat->
T[
i] = strat->
T[
i-1];
9422 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9440 strat->
T[atT].max_exp =
NULL;
9443 strat->
R[strat->
tl] = &(strat->
T[atT]);
9444 strat->
T[atT].i_r = strat->
tl;
9451 for(
i=strat->
tl;
i>=0;
i--)
9482 (strat->
syzmax)*
sizeof(
unsigned long),
9484 *
sizeof(
unsigned long));
9487 if (atT < strat->syzl)
9489 #ifdef ENTER_USE_MEMMOVE
9490 memmove(&(strat->
syz[atT+1]), &(strat->
syz[atT]),
9491 (strat->
syzl-atT+1)*
sizeof(poly));
9492 memmove(&(strat->
sevSyz[atT+1]), &(strat->
sevSyz[atT]),
9493 (strat->
syzl-atT+1)*
sizeof(
unsigned long));
9495 for (
i=strat->
syzl;
i>=atT+1;
i--)
9497 #ifndef ENTER_USE_MEMMOVE
9510 strat->
syz[atT] =
p.sig;
9511 strat->
sevSyz[atT] =
p.sevSig;
9514 Print(
"element in strat->syz: %d--%d ",atT+1,strat->
syzmax);
9524 strat->
L[cc].sig, ~strat->
L[cc].sevSig,
currRing)
9538 PrintS(
"--- Syzygies ---\n");
9541 PrintS(
"--------------------------------\n");
9547 PrintS(
"--------------------------------\n");
9583 #ifdef HAVE_RATGRING
9628 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9629 else PrintS(
"ideal/module is not homogeneous\n");
9660 #ifdef HAVE_RATGRING
9699 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9700 else PrintS(
"ideal/module is not homogeneous\n");
10221 if ((r->m[
l]!=
NULL)
10228 if ((
Q->m[q]!=
NULL)
10252 if ((r->m[
l]!=
NULL)
10259 if ((
Q->m[q]!=
NULL)
10303 reduction_found=
TRUE;
10334 reduction_found=
TRUE;
10348 if ( reduction_found)
10438 for (
i=strat->
sl;
i>=low;
i--)
10440 int end_pos=strat->
sl;
10442 if (strat->
ak==0) end_pos=
i-1;
10444 if ((T_j !=
NULL)&&(T_j->p==strat->
S[
i]))
10462 Print(
"to (tailR) S[%d]:",
i);
10474 T_j->max_exp =
NULL;
10477 T_j->pCleardenom();
10517 Print(
"to (-tailR) S[%d]:",
i);
10565 if (j < strat->
HCord)
10606 assume(L->i_r1 >= -1 && L->i_r1 <= strat->
tl);
10607 assume(L->i_r2 >= -1 && L->i_r2 <= strat->
tl);
10613 if ((L->i_r1 == -1) || (L->i_r2 == -1) )
10618 if (L->i_r1>=0) p1_max = (strat->
R[L->i_r1])->max_exp;
10620 if (L->i_r2>=0) p2_max = (strat->
R[L->i_r2])->max_exp;
10646 poly p1_max = (strat->
R[atR])->max_exp;
10647 poly p2_max = (strat->
R[strat->
S_2_R[atS]])->max_exp;
10668 ideal F =
idCopy(Forig);
10672 ideal monred =
idInit(1,1);
10679 if((posconst != -1) && (!
nIsZero(F->m[posconst]->coef)))
10689 for(
int i=0;
i<idelemQ;
i++)
10697 if((posconst != -1) && (!
nIsZero(monred->m[posconst]->coef)))
10699 pmon =
pCopy(monred->m[posconst]);
10714 II->m[
j++] =
prMapR(F->m[
i], nMap, origR, QQ_ring);
10716 II->m[
j++] =
prMapR(
Q->m[
i], nMap, origR, QQ_ring);
10723 if(II->m[
i] !=
NULL)
10724 II->m[
i+1] = II->m[
i];
10727 poly integer =
NULL;
10735 integer =
pHead(syz->m[
i]);
10742 pmon =
prMapR(integer, nMap2, QQ_ring, origR);
10756 poly mindegmon =
NULL;
10761 if(mindegmon ==
NULL)
10762 mindegmon =
pCopy(one->m[
i]);
10765 if(
p_Deg(one->m[
i], QQ_ring) <
p_Deg(mindegmon, QQ_ring))
10766 mindegmon =
pCopy(one->m[
i]);
10770 if(mindegmon !=
NULL)
10773 if(II->m[
i] !=
NULL)
10774 II->m[
i+1] = II->m[
i];
10775 II->m[0] =
pCopy(mindegmon);
10804 pmon =
prMapR(mindegmon, nMap2, QQ_ring, origR);
10835 poly pH =
h->GetP();
10839 for(
int i = 0;
i<=strat->
sl;
i++)
10894 h->SetLmCurrRing();
10895 if((deleted)&&(
h->p!=
NULL))
10903 poly hSig =
h->sig;
10904 poly pH =
h->GetP();
10908 for(
int i = 0;
i<=strat->
sl;
i++)
10919 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
10946 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
10977 h->SetLmCurrRing();
11078 if (expbound == 0) expbound = strat->
tailRing->bitmask << 1;
11095 new_tailRing->pFDeg =
currRing->pFDeg;
11096 new_tailRing->pLDeg =
currRing->pLDeg;
11100 Print(
"[%lu:%d", (
unsigned long) new_tailRing->bitmask, new_tailRing->ExpL_Size);
11109 for (
i=0;
i<=strat->
tl;
i++)
11111 strat->
T[
i].ShallowCopyDelete(new_tailRing, new_tailBin,
11112 p_shallow_copy_delete);
11114 for (
i=0;
i<=strat->
Ll;
i++)
11118 strat->
L[
i].ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11120 if ((strat->
P.t_p !=
NULL) ||
11122 strat->
P.ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11124 if ((L !=
NULL) && (L->tailRing != new_tailRing))
11127 L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11133 L->tailRing = new_tailRing;
11136 L->max_exp = t_l->max_exp;
11140 if ((
T !=
NULL) && (
T->tailRing != new_tailRing &&
T->i_r < 0))
11141 T->ShallowCopyDelete(new_tailRing, new_tailBin, p_shallow_copy_delete);
11148 strat->
tailBin = new_tailBin;
11174 unsigned long l = 0;
11180 for (
i=0;
i<= strat->
Ll;
i++)
11184 for (
i=0;
i<=strat->
tl;
i++)
11211 res->block0 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11212 res->block1 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11213 int **wvhdl = (
int **)
omAlloc0((n+1)*
sizeof(
int*));
11214 res->wvhdl = wvhdl;
11215 for (
int i=1;
i<n;
i++)
11217 res->order[
i] = r->order[
i-1];
11218 res->block0[
i] = r->block0[
i-1];
11219 res->block1[
i] = r->block1[
i-1];
11220 res->wvhdl[
i] = r->wvhdl[
i-1];
11239 #ifndef SING_NDEBUG
11240 WarnS(
"error in nc_rComplete");
11259 res->block0 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11260 res->block1 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11261 int **wvhdl = (
int **)
omAlloc0((n+2)*
sizeof(
int*));
11262 res->wvhdl = wvhdl;
11263 for (
int i=2;
i<n+2;
i++)
11265 res->order[
i] = r->order[
i-2];
11266 res->block0[
i] = r->block0[
i-2];
11267 res->block1[
i] = r->block1[
i-2];
11268 res->wvhdl[
i] = r->wvhdl[
i-2];
11273 res->block0[0] = 1;
11275 for (
int i=0;
i<
res->N; ++
i)
11276 res->wvhdl[0][
i] = 1;
11295 #ifndef SING_NDEBUG
11296 WarnS(
"error in nc_rComplete");
11433 #ifdef HAVE_TAIL_BIN
11460 Timings
for the different possibilities of posInT:
11461 T15 EDL DL EL L 1-2-3
11462 Gonnet 43.26 42.30 38.34 41.98 38.40 100.04
11463 Hairer_2_1 1.11 1.15 1.04 1.22 1.08 4.7
11464 Twomat3 1.62 1.69 1.70 1.65 1.54 11.32
11465 ahml 4.48 4.03 4.03 4.38 4.96 26.50
11466 c7 15.02 13.98 15.16 13.24 17.31 47.89
11467 c8 505.09 407.46 852.76 413.21 499.19 n/a
11468 f855 12.65 9.27 14.97 8.78 14.23 33.12
11469 gametwo6 11.47 11.35 14.57 11.20 12.02 35.07
11470 gerhard_3 2.73 2.83 2.93 2.64 3.12 6.24
11471 ilias13 22.89 22.46 24.62 20.60 23.34 53.86
11472 noon8 40.68 37.02 37.99 36.82 35.59 877.16
11473 rcyclic_19 48.22 42.29 43.99 45.35 51.51 204.29
11474 rkat9 82.37 79.46 77.20 77.63 82.54 267.92
11475 schwarz_11 16.46 16.81 16.76 16.81 16.72 35.56
11476 test016 16.39 14.17 14.40 13.50 14.26 34.07
11477 test017 34.70 36.01 33.16 35.48 32.75 71.45
11478 test042 10.76 10.99 10.27 11.57 10.45 23.04
11479 test058 6.78 6.75 6.51 6.95 6.22 9.47
11480 test066 10.71 10.94 10.76 10.61 10.56 19.06
11481 test073 10.75 11.11 10.17 10.79 8.63 58.10
11482 test086 12.23 11.81 12.88 12.24 13.37 66.68
11483 test103 5.05 4.80 5.47 4.64 4.89 11.90
11484 test154 12.96 11.64 13.51 12.46 14.61 36.35
11485 test162 65.27 64.01 67.35 59.79 67.54 196.46
11486 test164 7.50 6.50 7.68 6.70 7.96 17.13
11487 virasoro 3.39 3.50 3.35 3.47 3.70 7.66
11497 if (
length==-1)
return 0;
11500 int op=
p.GetpFDeg();
11501 int ol =
p.GetpLength();
11503 if (set[
length].ecart < o)
11505 if (set[
length].ecart == o)
11507 int oo=set[
length].GetpFDeg();
11508 if ((oo < op) || ((oo==op) && (set[
length].
length < ol)))
11519 if (set[an].ecart > o)
11521 if (set[an].ecart == o)
11523 int oo=set[an].GetpFDeg();
11525 || ((oo==op) && (set[an].
pLength > ol)))
11531 if (set[
i].ecart > o)
11533 else if (set[
i].ecart == o)
11535 int oo=set[
i].GetpFDeg();
11537 || ((oo == op) && (set[
i].
pLength > ol)))
11551 if (
length==-1)
return 0;
11553 int op=
p.GetpFDeg();
11554 int ol =
p.GetpLength();
11556 int oo=set[
length].GetpFDeg();
11557 if ((oo < op) || ((oo==op) && (set[
length].
length < ol)))
11567 int oo=set[an].GetpFDeg();
11569 || ((oo==op) && (set[an].
pLength > ol)))
11574 int oo=set[
i].GetpFDeg();
11576 || ((oo == op) && (set[
i].
pLength > ol)))
11587 int ol =
p.GetpLength();
11601 if (set[an].
pLength>ol)
return an;
11626 else Print(
"%p\n",(
void*)strat->
red);
11645 #ifdef HAVE_MORE_POS_IN_T
11683 PrintS(
"initEcartPair: ");
11687 Print(
"homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
11689 Print(
"honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
11695 Print(
"posInLDependsOnLength=%d\n",
11727 PrintS(
"currRing->pFDeg: ");
11742 PrintS(
"ecartWeights: ");
11749 #ifndef SING_NDEBUG
11754 #ifdef HAVE_SHIFTBBA
11768 #ifdef HAVE_SHIFTBBA
11785 #ifdef HAVE_SHIFTBBA
11877 #ifdef HAVE_SHIFTBBA
11887 for (
i=0;
i<=strat->
sl;
i++)
11889 memset(&
h,0,
sizeof(
h));
11906 #ifdef HAVE_SHIFTBBA
11982 #ifdef HAVE_SHIFTBBA
11996 poly qq = strat->
S[
i];
12022 qfromQ = strat->
fromQ[
i];
12034 enterOnePairShift(qq,
p, ecart, isFromQ, strat, -1, ecartq, qfromQ, 0,
i, uptodeg, lV);
12036 for (
j=1;
j<= toInsert;
j++)
12052 enterOnePairShift(q,
p, ecart, isFromQ, strat, -1, ecartq, qfromQ,
j,
i, uptodeg, lV);
12057 #ifdef HAVE_SHIFTBBA
12099 for (;
j<= toInsert;
j++)
12116 enterOnePairShift(q,
p, ecart, isFromQ, strat, -1, ecartq, qfromQ,
j, -1, uptodeg, lV);
12121 #ifdef HAVE_SHIFTBBA
12125 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)
12149 int qfromQ = qisFromQ;
12158 Lp.ecart=0; Lp.length=0;
12164 if (!
isInV(Lp.lcm, lV))
12169 PrintS(
"V crit applied to q = ");
12184 if((!((ecartq>0)&&(ecart>0)))
12206 Lp.ecart =
si_max(ecart,ecartq);
12207 if (strat->
fromT && (ecartq>ecart))
12229 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12272 if (strat->
fromT && (ecartq>ecart))
12284 for(
j = strat->
Bl;
j>=0;
j--)
12290 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12314 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (qfromQ!=0))
12386 if ( (atR >= 0) && (shiftcount==0) && (ifromS >=0) )
12403 && (Lp.p->coef!=
NULL))
12407 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
12413 #ifdef HAVE_SHIFTBBA
12434 for (
j=0;
j<=
k;
j++)
12449 for (
j=0;
j<=
k;
j++)
12462 for (
j=0;
j<=
k;
j++)
12487 #ifdef HAVE_SHIFTBBA
12500 if ( (!strat->
fromT)
12518 #ifdef HAVE_SHIFTBBA
12538 atT = strat->
posInT(strat->
T, strat->
tl,
p);
12545 for (
i=1;
i<=toInsert;
i++)
12560 atT = strat->
posInT(strat->
T, strat->
tl, qq);
12569 #ifdef HAVE_SHIFTBBA
12576 p =
h = L->GetLmTailRing();
12578 return L->GetLmCurrRing();
12585 Ln.pLength = L->GetpLength() - 1;
12593 while(!Ln.IsNull())
12597 Ln.SetShortExpVector();
12603 With = &(strat->
T[
j]);
12608 if (With ==
NULL)
break;
12624 pNext(
h) = Ln.LmExtractAndIter();
12627 }
while (!Ln.IsNull());
12630 if (Ln.IsNull())
goto all_done;
12631 if (! withT) With_s.Init(
currRing);
12633 pNext(
h) = Ln.LmExtractAndIter();
12648 return L->GetLmCurrRing();
static int si_max(const int a, const int b)
static int si_min(const int a, const int b)
const CanonicalForm CFMap CFMap & N
static CanonicalForm bound(const CFMatrix &M)
KINLINE poly kNoetherTail()
void(* chainCrit)(poly p, int ecart, kStrategy strat)
pFDegProc pOrigFDeg_TailRing
BOOLEAN(* rewCrit1)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
BOOLEAN(* rewCrit3)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
KINLINE TObject * s_2_t(int i)
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
BOOLEAN(* syzCrit)(poly sig, unsigned long not_sevSig, kStrategy strat)
pShallowCopyDeleteProc p_shallow_copy_delete
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
char completeReduce_retry
void(* initEcart)(TObject *L)
KINLINE TObject * S_2_T(int i)
void(* enterOnePair)(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
int(* posInT)(const TSet T, const int tl, LObject &h)
int(* red)(LObject *L, kStrategy strat)
char posInLDependsOnLength
int(* posInLSba)(const LSet set, const int length, LObject *L, const kStrategy strat)
pLDegProc pOrigLDeg_TailRing
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 FORCE_INLINE BOOLEAN nCoeff_is_Z(const coeffs r)
@ n_Q
rational (GMP) numbers
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,...
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.
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
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
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,...
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...
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,...
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:...
static FORCE_INLINE int n_DivComp(number a, number b, const coeffs r)
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
void nKillChar(coeffs r)
undo all initialisations
const CanonicalForm int s
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
static int min(int a, int b)
static int max(int a, int b)
void scComputeHC(ideal S, ideal Q, int ak, poly &hEdge, ring tailRing)
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
#define idDelete(H)
delete an ideal
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
static BOOLEAN length(leftv result, leftv arg)
KINLINE unsigned long * initsevT()
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring tailRing)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
KINLINE int ksReducePolyTail(LObject *PR, TObject *PW, LObject *Red)
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether)
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
KINLINE TObject ** initR()
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
void kBucketDestroy(kBucket_pt *bucket_pt)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
void kBucket_Add_q(kBucket_pt bucket, poly q, int *l)
Add to Bucket a poly ,i.e. Bpoly == q+Bpoly.
int ksCheckCoeff(number *a, number *b)
BOOLEAN pCompareChainPart(poly p, poly p1, poly p2, poly lcm, const ring R)
BOOLEAN pCompareChain(poly p, poly p1, poly p2, poly lcm, const ring R)
Returns TRUE if.
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
long kHomModDeg(poly p, ring r)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
int redFirstShift(LObject *h, kStrategy strat)
int redHoney(LObject *h, kStrategy strat)
int redHomog(LObject *h, kStrategy strat)
int redRing(LObject *h, kStrategy strat)
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
void initSbaPos(kStrategy strat)
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
poly redtail(LObject *L, int end_pos, kStrategy strat)
int posInL17Ring(const LSet set, const int length, LObject *p, const kStrategy)
void updateSShift(kStrategy strat, int uptodeg, int lV)
void initenterpairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
int posInL17_cRing(const LSet set, const int length, LObject *p, const kStrategy)
int getIndexRng(long coeff)
int posInL110(const LSet set, const int length, LObject *p, const kStrategy)
int posInT17(const TSet set, const int length, LObject &p)
denominator_list DENOMINATOR_LIST
void initBuchMora(ideal F, ideal Q, kStrategy strat)
poly pMove2CurrTail(poly p, kStrategy strat)
int posInTrg0(const TSet set, const int length, LObject &p)
int redFirst(LObject *h, kStrategy strat)
void kMergeBintoL(kStrategy strat)
static void enlargeT(TSet &T, TObject **&R, unsigned long *&sevT, int &length, const int incr)
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int)
void enterSyz(LObject &p, kStrategy strat, int atT)
int posInL11Ring(const LSet set, const int length, LObject *p, const kStrategy)
int redEcart(LObject *h, kStrategy strat)
int posInT11(const TSet set, const int length, LObject &p)
void enterT(LObject &p, kStrategy strat, int atT)
int posInT1(const TSet set, const int length, LObject &p)
int posInT110Ring(const TSet set, const int length, LObject &p)
BOOLEAN arriRewCriterion(poly, unsigned long, poly, kStrategy strat, int start=0)
void enterSSba(LObject &p, int atS, kStrategy strat, int atR)
BOOLEAN kTest(kStrategy strat)
void initenterpairsSigRing(poly h, poly hSig, int hFrom, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void enterSMoraNF(LObject &p, int atS, kStrategy strat, int atR=-1)
poly redtailBbaBound(LObject *L, int end_pos, kStrategy strat, int bound, BOOLEAN withT, BOOLEAN normalize)
int posInT_EcartpLength(const TSet set, const int length, LObject &p)
int posInT0(const TSet, const int length, LObject &)
poly pMoveCurrTail2poly(poly p, kStrategy strat)
BOOLEAN kTest_TS(kStrategy strat)
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
int kFindInT(poly p, TSet T, int tlength)
returns index of p in TSet, or -1 if not found
BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat)
void enterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly, kStrategy strat, int start=0)
long ind_fact_2(long arg)
void clearSbatch(poly h, int k, int pos, kStrategy strat)
int posInT2(const TSet set, const int length, LObject &p)
BOOLEAN kTest_L(LObject *L, ring strat_tailRing, BOOLEAN testp, int lpos, TSet T, int tlength)
int posInL13(const LSet set, const int length, LObject *p, const kStrategy)
int posInL110Ring(const LSet set, const int length, LObject *p, const kStrategy)
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)
int posInT_pLength(const TSet set, const int length, LObject &p)
static intset initec(const int maxnr)
BOOLEAN kPosInLDependsOnLength(int(*pos_in_l)(const LSet set, const int length, LObject *L, const kStrategy strat))
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
int posInT13(const TSet set, const int length, LObject &p)
BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat)
void initHilbCrit(ideal, ideal, intvec **hilb, kStrategy strat)
void chainCritSig(poly p, int, kStrategy strat)
int posInSMonFirst(const kStrategy strat, const int length, const poly p)
void initEcartPairMora(LObject *Lp, poly, poly, int ecartF, int ecartG)
void initenterstrongPairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void superenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
static poly redMora(poly h, int maxIndex, kStrategy strat)
int posInL0Ring(const LSet set, const int length, LObject *p, const kStrategy)
static int pDivCompRing(poly p, poly q)
BOOLEAN isInPairsetB(poly q, int *k, kStrategy strat)
void initBuchMoraPos(kStrategy strat)
void initS(ideal F, ideal Q, kStrategy strat)
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject *T, unsigned long expbound)
poly redtailBba(LObject *L, int end_pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
poly redtailBba_Z(LObject *L, int end_pos, kStrategy strat)
ring sbaRing(kStrategy strat, const ring r, BOOLEAN, int)
void initPairtest(kStrategy strat)
static BOOLEAN p_HasNotCF_Lift(poly p1, poly p2, const ring r)
p_HasNotCF for the IDLIFT case: ignore component
int posInL0(const LSet set, const int length, LObject *p, const kStrategy)
void initSSpecial(ideal F, ideal Q, ideal P, kStrategy strat)
void chainCritOpt_1(poly, int, kStrategy strat)
int posInT11Ring(const TSet set, const int length, LObject &p)
static void enterOnePairRing(int i, poly p, int, int isFromQ, kStrategy strat, int atR)
static poly redBba(poly h, int maxIndex, kStrategy strat)
void cancelunit1(LObject *p, int *suc, int index, kStrategy strat)
poly pCopyL2p(LObject H, kStrategy strat)
static void initenterstrongPairsSig(poly h, poly hSig, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
poly kCreateZeroPoly(long exp[], long cabsind, poly *t_p, ring leadRing, ring tailRing)
void initenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
int posInL15(const LSet set, const int length, LObject *p, const kStrategy)
static void enlargeL(LSet *L, int *length, const int incr)
int posInT17_c(const TSet set, const int length, LObject &p)
poly redtailBbaShift(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
int posInT15(const TSet set, const int length, LObject &p)
void enterT_strong(LObject &p, kStrategy strat, int atT)
void postReduceByMon(LObject *h, kStrategy strat)
used for GB over ZZ: intermediate reduction by monomial elements background: any known constant eleme...
BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat)
void HEckeTest(poly pp, kStrategy strat)
int posInLSpecial(const LSet set, const int length, LObject *p, const kStrategy)
int nextZeroSimplexExponent(long exp[], long ind[], long cexp[], long cind[], long *cabsind, long step[], long bound, long N)
void enterExtendedSpolySig(poly h, poly hSig, kStrategy strat)
static void enterOnePairSig(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void exitBuchMora(kStrategy strat)
void messageStatSBA(int hilbcount, kStrategy strat)
void initEcartNormal(TObject *h)
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
void updateS(BOOLEAN toT, kStrategy strat)
static BOOLEAN sloppy_max
void initSLSba(ideal F, ideal Q, kStrategy strat)
int posInL11Ringls(const LSet set, const int length, LObject *p, const kStrategy)
static void enterOnePairManyShifts(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
void enterOnePairSpecial(int i, poly p, int ecart, kStrategy strat, int atR=-1)
void enterOneZeroPairRing(poly f, poly t_p, poly p, int ecart, kStrategy strat, int atR=-1)
int posInL17(const LSet set, const int length, LObject *p, const kStrategy)
void initBuchMoraShift(ideal F, ideal Q, kStrategy strat)
void initSyzRules(kStrategy strat)
int posInLSig(const LSet set, const int length, LObject *p, const kStrategy)
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
void cleanT(kStrategy strat)
static void enterOnePairLift(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
int posInT110(const TSet set, const int length, LObject &p)
BOOLEAN kTest_S(kStrategy strat)
int posInSyz(const kStrategy strat, poly sig)
static const char * kTest_LmEqual(poly p, poly t_p, ring tailRing)
void reorderS(int *suc, kStrategy strat)
void enterExtendedSpoly(poly h, kStrategy strat)
int posInL15Ring(const LSet set, const int length, LObject *p, const kStrategy)
void enterOnePairSelfShifts(poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int, int uptodeg, int lV)
void kMergeBintoLSba(kStrategy strat)
void deleteHC(LObject *L, kStrategy strat, BOOLEAN fromNext)
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR, int uptodeg, int lV)
void updateResult(ideal r, ideal Q, kStrategy strat)
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
static BOOLEAN sugarDivisibleBy(int ecart1, int ecart2)
int posInT19(const TSet set, const int length, LObject &p)
void exitSba(kStrategy strat)
TObject * kFindDivisibleByInS_T(kStrategy strat, int end_pos, LObject *L, TObject *T, long ecart)
int posInT15Ring(const TSet set, const int length, LObject &p)
int posInT17Ring(const TSet set, const int length, LObject &p)
static BOOLEAN enterOneStrongPoly(int i, poly p, int, int, kStrategy strat, int atR, bool enterTstrong)
void kDebugPrint(kStrategy strat)
Output some debug info about a given strategy.
int posInLrg0(const LSet set, const int length, LObject *p, const kStrategy)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
void kStratInitChangeTailRing(kStrategy strat)
void chainCritPart(poly p, int ecart, kStrategy strat)
void enterSMora(LObject &p, int atS, kStrategy strat, int atR=-1)
void initBuchMoraCrit(kStrategy strat)
void cleanTSbaRing(kStrategy strat)
int posInT17_cRing(const TSet set, const int length, LObject &p)
void initenterpairsShift(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
void deleteInSSba(int i, kStrategy strat)
static int pDivComp(poly p, poly q)
void completeReduce(kStrategy strat, BOOLEAN withT)
int posInL17_c(const LSet set, const int length, LObject *p, const kStrategy)
void initBuchMoraPosRing(kStrategy strat)
void postReduceByMonSig(LObject *h, kStrategy strat)
BOOLEAN kTest_T(TObject *T, ring strat_tailRing, int i, char TN)
void messageSets(kStrategy strat)
void deleteInS(int i, kStrategy strat)
static poly redBba1(poly h, int maxIndex, kStrategy strat)
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
int posInLSigRing(const LSet set, const int length, LObject *p, const kStrategy)
void initenterzeropairsRing(poly p, int ecart, kStrategy strat, int atR)
BOOLEAN isInPairsetL(int length, poly p1, poly p2, int *k, kStrategy strat)
BOOLEAN sbaCheckGcdPair(LObject *h, kStrategy strat)
int posInLF5CRing(const LSet set, int start, const int length, LObject *p, const kStrategy)
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 enterpairsSpecial(poly h, int k, int ecart, int pos, kStrategy strat, int atR=-1)
void chainCritNormal(poly p, int ecart, kStrategy strat)
void initEcartBBA(TObject *h)
int posInLRing(const LSet set, const int length, LObject *p, const kStrategy)
static void enterOnePairSigRing(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
int posInL11(const LSet set, const int length, LObject *p, const kStrategy)
void enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV)
int posInLF5C(const LSet, const int, LObject *, const kStrategy strat)
static unsigned long * initsevS(const int maxnr)
void initEcartPairBba(LObject *Lp, poly, poly, int, int)
void messageStat(int hilbcount, kStrategy strat)
#define REDTAIL_CANONICALIZE
static BOOLEAN enterOneStrongPolySig(int i, poly p, poly sig, int, int, kStrategy strat, int atR)
void chainCritRing(poly p, int, kStrategy strat)
void initSSpecialSba(ideal F, ideal Q, ideal P, kStrategy strat)
void initSL(ideal F, ideal Q, kStrategy strat)
int posInIdealMonFirst(const ideal F, const poly p, int start, int end)
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
void initSbaCrit(kStrategy strat)
BOOLEAN newHEdge(kStrategy strat)
static int * initS_2_R(const int maxnr)
void cancelunit(LObject *L, BOOLEAN inNF)
denominator_list_s * denominator_list
static LSet initL(int nr=setmaxL)
static void kDeleteLcm(LObject *P)
#define ALLOW_PROD_CRIT(A)
static bool rIsSCA(const ring r)
poly nc_CreateShortSpoly(poly p1, poly p2, const ring r)
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
static nc_type & ncRingType(nc_struct *p)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
int dReportError(const char *fmt,...)
#define pFalseReturn(cond)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
#define __p_GetComp(p, r)
#define rRing_has_Comp(r)
gmp_float exp(const gmp_float &a)
#define omFreeSize(addr, size)
#define omCheckBinAddrSize(addr, size)
#define omReallocSize(addr, o_size, size)
#define omRealloc0Size(addr, o_size, size)
#define omSizeWOfBin(bin_ptr)
void omMergeStickyBinIntoBin(omBin sticky_bin, omBin into_bin)
omBin omGetStickyBinOfBin(omBin bin)
#define TEST_OPT_INTSTRATEGY
#define TEST_OPT_INFREDTAIL
#define TEST_OPT_SUGARCRIT
#define TEST_OPT_DEGBOUND
#define TEST_OPT_NOT_SUGAR
#define TEST_OPT_CANCELUNIT
#define TEST_OPT_CONTENTSB
pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring, ring)
static int index(p_Length length, p_Ord ord)
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,...
void p_Cleardenom_n(poly ph, const ring r, number &c)
long pLDegb(poly p, int *l, const ring r)
long pLDeg1_Totaldegree(poly p, int *l, const ring r)
long p_WFirstTotalDegree(poly p, const ring r)
long pLDeg1_WFirstTotalDegree(poly p, int *l, const ring r)
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
long pLDeg1c_WFirstTotalDegree(poly p, int *l, const ring r)
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r1, const ring r2)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
long pLDeg1c_Deg(poly p, int *l, const ring r)
long pLDeg1(poly p, int *l, const ring r)
unsigned long p_GetShortExpVector(const poly p, const ring r)
long pLDeg1_Deg(poly p, int *l, const ring r)
long p_WTotaldegree(poly p, const ring r)
BOOLEAN p_OneComp(poly p, const ring r)
return TRUE if all monoms have the same component
poly p_Cleardenom(poly p, const ring r)
long pLDeg1c(poly p, int *l, const ring r)
long pLDeg1c_Totaldegree(poly p, int *l, const ring r)
long pLDeg0c(poly p, int *l, const ring r)
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
long pLDeg0(poly p, int *l, const ring r)
poly p_Sub(poly p1, poly p2, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
void pEnlargeSet(poly **p, int l, int increment)
long p_Deg(poly a, const ring r)
void p_Lcm(const poly a, const poly b, poly m, const ring r)
static poly p_Neg(poly p, const ring r)
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
static void p_LmDelete(poly p, const ring r)
static poly p_Mult_q(poly p, poly q, const ring r)
static void p_ExpVectorAdd(poly p1, poly p2, const ring r)
BOOLEAN p_CheckIsFromRing(poly p, ring r)
static BOOLEAN _p_LmDivisibleByPart(poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
static long p_FDeg(const poly p, const ring r)
static unsigned long p_GetMaxExp(const unsigned long l, const ring r)
static void p_ExpVectorCopy(poly d_p, poly s_p, const ring r)
static int p_Cmp(poly p1, poly p2, ring r)
#define __pp_Mult_nn(p, n, r)
static poly pp_Mult_mm(poly p, poly m, const ring r)
static int p_LtCmpNoAbs(poly p, poly q, const ring r)
static void p_SetCompP(poly p, int i, ring r)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
#define pp_Test(p, lmRing, tailRing)
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
static void p_Setm(poly p, const ring r)
static number p_SetCoeff(poly p, number n, ring r)
static int p_LmCmp(poly p, poly q, const ring r)
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
BOOLEAN p_LmCheckIsFromRing(poly p, ring r)
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
static poly p_ShallowCopyDelete(poly p, const ring r, omBin bin)
static void p_Delete(poly *p, const ring r)
static unsigned pLength(poly a)
BOOLEAN p_CheckPolyRing(poly p, ring r)
static poly p_LmFreeAndNext(poly p, ring)
static poly p_Mult_mm(poly p, poly m, const ring r)
static void p_LmFree(poly p, ring)
static poly p_Copy(poly p, const ring r)
returns a copy of p
static long p_Totaldegree(poly p, const ring r)
static BOOLEAN p_LmExpVectorAddIsOk(const poly p1, const poly p2, const ring r)
void p_wrp(poly p, ring lmRing, ring tailRing)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
void rChangeCurrRing(ring r)
Compatiblity layer for legacy polynomial operations (over currRing)
#define pLtCmpOrdSgnDiffM(p, q)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
#define pIsConstant(p)
like above, except that Comp might be != 0
#define pHasNotCF(p1, p2)
#define pLtCmpOrdSgnDiffP(p, q)
#define pGetComp(p)
Component.
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
#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 pCmp(p1, p2)
pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2)))
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl....
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
#define pGetExp(p, i)
Exponent.
#define pSetmComp(p)
TODO:
void pNorm(poly p, const ring R=currRing)
#define pInit()
allocates a new monomial and initializes everything to 0
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
#define pLtCmpOrdSgnEqP(p, q)
#define pCopy(p)
return a copy of the poly
poly prMoveR(poly &p, ring src_r, ring dest_r)
poly prMapR(poly src, nMapFunc nMap, ring src_r, ring dest_r)
void pLcmRat(poly a, poly b, poly m, int rat_shift)
void PrintS(const char *s)
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...
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
void rKillModifiedRing(ring r)
ring rAssure_c_dp(const ring r)
ring rModifyRing(ring r, BOOLEAN omit_degree, BOOLEAN try_omit_comp, unsigned long exp_limit)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
void rDebugPrint(const ring r)
void rDelete(ring r)
unconditionally deletes fields in r
static BOOLEAN rField_is_Ring(const ring r)
static int rBlocks(ring r)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
static int rGetCurrSyzLimit(const ring r)
static BOOLEAN rField_is_Domain(const ring r)
static BOOLEAN rIsRatGRing(const ring r)
BOOLEAN rHasMixedOrdering(const ring r)
static BOOLEAN rIsSyzIndexRing(const ring r)
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...
static short rVar(const ring r)
#define rVar(r) (r->N)
BOOLEAN rHasGlobalOrdering(const ring r)
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
int isInV(poly p, int lV)
poly p_LPshiftT(poly p, int sh, int uptodeg, int lV, kStrategy strat, const ring r)
poly p_LPshift(poly p, int sh, int uptodeg, int lV, const ring r)
int itoInsert(poly p, int uptodeg, int lV, const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
int idElem(const ideal F)
count non-zero elements
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
long totaldegreeWecart(poly p, ring r)
long maxdegreeWecart(poly p, int *l, ring r)