47#define ENTER_USE_MEMMOVE
82#ifdef ENTER_USE_MYMEMMOVE
83inline void _my_memmove_d_gt_s(
unsigned long* d,
unsigned long*
s,
long l)
85 REGISTER unsigned long* _dl = (
unsigned long*) d;
86 REGISTER unsigned long* _sl = (
unsigned long*)
s;
97inline void _my_memmove_d_lt_s(
unsigned long* d,
unsigned long*
s,
long l)
100 REGISTER unsigned long* _dl = (
unsigned long*) d;
101 REGISTER unsigned long* _sl = (
unsigned long*)
s;
112inline void _my_memmove(
void* d,
void*
s,
long l)
114 unsigned long _d = (
unsigned long) d;
115 unsigned long _s = (
unsigned long)
s;
116 unsigned long _l = ((
l) + SIZEOF_LONG - 1) >> LOG_SIZEOF_LONG;
118 if (_d > _s) _my_memmove_d_gt_s(_d, _s, _l);
119 else _my_memmove_d_lt_s(_d, _s, _l);
123#define memmove(d,s,l) _my_memmove(d, s, l)
129#define pDivComp_EQUAL 2
130#define pDivComp_LESS 1
131#define pDivComp_GREATER -1
132#define pDivComp_INCOMP 0
145 unsigned long la, lb;
146 unsigned long divmask =
currRing->divmask;
156 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
163 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
193 unsigned long la, lb;
194 unsigned long divmask =
currRing->divmask;
204 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
211 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
218 if (
b) {
return -1; }
246 && (L->bucket !=
NULL))
248 for (
int i=1;
i<= (int) L->bucket->buckets_used;
i++)
250 poly
p=L->bucket->buckets[
i];
255 L->bucket->buckets[
i]=
NULL;
256 L->bucket->buckets_length[
i]=0;
265 L->bucket->buckets_length[
i]=
pLength(L->bucket->buckets[
i]);
273 int i=L->bucket->buckets_used;
274 while ((
i>0)&&(L->bucket->buckets[
i]==
NULL))
277 L->bucket->buckets_used=
i;
292 poly
p = L->GetLmTailRing();
303 if (L->bucket !=
NULL)
335 L->ecart = L->pLDeg() - L->GetpFDeg();
342 if ((!fromNext) && cut)
345 L->ecart = L->pLDeg(strat->
LDegLast) - L->GetpFDeg();
370 ring r = L->tailRing;
371 poly
p = L->GetLmTailRing();
445 number eins=
nInit(1);
527inline static unsigned long*
initsevS (
const int maxnr)
529 return (
unsigned long*)
omAlloc0(maxnr*
sizeof(
unsigned long));
533 return (
int*)
omAlloc0(maxnr*
sizeof(
int));
537 int &
length,
const int incr)
549 (
length+incr)*
sizeof(
long*));
567 for (
j=0;
j<=strat->
tl;
j++)
571 if (strat->
T[
j].max_exp !=
NULL)
581 if (strat->
T[
j].t_p !=
NULL)
589 if (
currRing->isLPring && strat->
T[
j].shift > 0)
598 if (
p == strat->
S[
i])
600 if (strat->
T[
j].t_p !=
NULL)
602 if (p_shallow_copy_delete!=
NULL)
626 for (
j=0;
j<=strat->
tl;
j++)
630 if (strat->
T[
j].max_exp !=
NULL)
640 if (strat->
T[
j].t_p !=
NULL)
652 if (
p == strat->
S[
i])
654 if (strat->
T[
j].t_p !=
NULL)
701 if ((*
k) < 0)
return FALSE;
702 if (((p1 == (*p).p1) && (p2 == (*p).p2))
703 || ((p1 == (*p).p2) && (p2 == (*p).p1)))
714 for (
i=0;
i<=tlength;
i++)
716 if (
T[
i].
p ==
p)
return i;
727 if (
i >= 0)
return i;
730 while (strat !=
NULL);
739 for (
i=0;
i<=tlength;
i++)
755 if (
i >= 0)
return i;
758 while (strat !=
NULL);
772#define kFalseReturn(x) do { if (!x) return FALSE;} while (0)
779 for (
i=1;
i<=tailRing->N;
i++)
782 return "Lm[i] different";
785 return "Lm[0] different";
787 return "Lm.next different";
789 return "Lm.coeff different";
798 ring tailRing =
T->tailRing;
799 ring strat_tailRing = strat->
tailRing;
800 if (strat_tailRing ==
NULL) strat_tailRing = tailRing;
801 r_assume(strat_tailRing == tailRing);
823 if (
T->t_p ==
NULL &&
i > 0)
840 if (
T->t_p !=
NULL &&
i >= 0 && TN ==
'T')
844 if (
T->max_exp !=
NULL)
845 return dReportError(
"%c[%d].max_exp is not NULL as it should be", TN,
i);
849 if (
T->max_exp ==
NULL)
861 p_Setm(test_max, tailRing);
873 if (
T->p ==
NULL &&
i > 0)
889 if ((
i >= 0) && (
T->pLength != 0)
894 return dReportError(
"%c[%d] pLength error: has %d, specified to have %d",
899 if (
i >= 0 && (TN ==
'T' || TN ==
'L'))
902 if (strat->
homog && (
T->FDeg !=
T->pFDeg()))
906 return dReportError(
"%c[%d] FDeg error: has %d, specified to have %d",
907 TN,
i ,
T->pFDeg(), d);
912 if (
i >= 0 && TN ==
'T')
926 ring strat_tailRing=strat->
tailRing;
951 if (L->bucket !=
NULL)
954 r_assume(L->bucket->bucket_ring == L->tailRing);
972 return dReportError(
"L[%d] wrong sev: has %lo, specified to have %lo",
982 else if (tlength > 0 &&
T !=
NULL && (lpos >=0))
1017 -1, strat->
T, strat->
tl));
1020 if (strat->
T !=
NULL)
1022 for (
i=0;
i<=strat->
tl;
i++)
1031 if (strat->
L !=
NULL)
1033 for (
i=0;
i<=strat->
Ll;
i++)
1036 strat->
L[
i].Next() != strat->
tail,
i,
1037 strat->
T, strat->
tl));
1048 if (strat->
S !=
NULL)
1060 for (
i=0;
i<=strat->
sl;
i++)
1062 if (strat->
S[
i] !=
NULL &&
1065 return dReportError(
"S[%d] wrong sev: has %o, specified to have %o",
1081 for (
i=0;
i<=strat->
tl;
i++)
1083 if (strat->
T[
i].i_r < 0 || strat->
T[
i].i_r > strat->
tl)
1084 return dReportError(
"strat->T[%d].i_r == %d out of bounds",
i,
1086 if (strat->
R[strat->
T[
i].i_r] != &(strat->
T[
i]))
1090 if ((strat->
S !=
NULL)&&(strat->
tl>=0))
1092 for (
i=0;
i<=strat->
sl;
i++)
1097 if (strat->
S_2_R[
i] != strat->
T[
j].i_r)
1103 #ifdef HAVE_SHIFTBBA
1108 for (
i=0;
i<=strat->
Ll;
i++)
1110 if (strat->
L[
i].p1 !=
NULL && strat->
L[
i].p2)
1112 if (strat->
L[
i].i_r1 < 0 ||
1113 strat->
L[
i].i_r1 > strat->
tl ||
1114 strat->
L[
i].T_1(strat)->p != strat->
L[
i].p1)
1116 if (strat->
L[
i].i_r2 < 0 ||
1117 strat->
L[
i].i_r2 > strat->
tl ||
1118 strat->
L[
i].T_2(strat)->p != strat->
L[
i].p2)
1123 if (strat->
L[
i].i_r1 != -1)
1125 if (strat->
L[
i].i_r2 != -1)
1128 if (strat->
L[
i].i_r != -1)
1141#ifdef ENTER_USE_MEMMOVE
1142 memmove(&(strat->
S[
i]), &(strat->
S[
i+1]), (strat->
sl -
i)*
sizeof(poly));
1144 memmove(&(strat->
sevS[
i]),&(strat->
sevS[
i+1]),(strat->
sl -
i)*
sizeof(
unsigned long));
1145 memmove(&(strat->
S_2_R[
i]),&(strat->
S_2_R[
i+1]),(strat->
sl -
i)*
sizeof(
int));
1148 for (
j=
i;
j<strat->
sl;
j++)
1150 strat->
S[
j] = strat->
S[
j+1];
1158#ifdef ENTER_USE_MEMMOVE
1159 memmove(&(strat->
lenS[
i]),&(strat->
lenS[
i+1]),(strat->
sl -
i)*
sizeof(
int));
1166#ifdef ENTER_USE_MEMMOVE
1174#ifdef ENTER_USE_MEMMOVE
1175 memmove(&(strat->
fromQ[
i]),&(strat->
fromQ[
i+1]),(strat->
sl -
i)*
sizeof(
int));
1177 for (
j=
i;
j<strat->
sl;
j++)
1191 && (strat->
P.p1!=
NULL))
1197 for (
int i=lv;
i>0;
i--)
1221 if (set[
j].sig!=
NULL)
1249 #ifdef HAVE_SHIFTBBA
1259#ifdef ENTER_USE_MEMMOVE
1263 for (
i=
j;
i < (*length);
i++)
1285#ifdef ENTER_USE_MEMMOVE
1286 memmove(&((*set)[at+1]), &((*set)[at]), ((*
length)-at+1)*
sizeof(
LObject));
1288 for (
i=(*
length)+1;
i>=at+1;
i--) (*set)[
i] = (*set)[
i-1];
1302 h->FDeg =
h->pFDeg();
1303 h->ecart =
h->pLDeg() -
h->FDeg;
1310 h->FDeg =
h->pFDeg();
1317 Lp->FDeg = Lp->pFDeg();
1324 Lp->FDeg = Lp->pFDeg();
1325 (*Lp).ecart =
si_max(ecartF,ecartG);
1326 (*Lp).ecart = (*Lp).ecart- (Lp->FDeg -
p_FDeg((*Lp).lcm,
currRing));
1335 return (ecart1 <= ecart2);
1366 int j,compare,compareCoeff;
1370 h.ecart=0;
h.length=0;
1394 for(
j = strat->
Bl;
j>=0;
j--)
1515 h.i_r1 = -1;
h.i_r2 = -1;
1531 posx = strat->
posInL(strat->
B,strat->
Bl,&
h,strat);
1536 else strat->
P.sev=0L;
1550 poly m1, m2,
gcd,si;
1579 for (
int j = 0;
j < strat->
sl;
j++)
1585 && !(strat->
sevS[
j] & ~sev)
1628 PrintS(
"\n--- create strong gcd poly: ");
1631 Print(
"\n strat->S[%d]: ",
i);
1654 h.i_r1 = -1;
h.i_r2 = -1;
1660 h.p1 =
p;
h.p2 = strat->
S[
i];
1675 posx = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
1680 if(
h.IsNull())
return FALSE;
1697 if(strat->
sl < 0)
return FALSE;
1699 for(
i=0;
i<strat->
sl;
i++)
1735 h->i_r1 = -1;
h->i_r2 = -1;
1757 poly m1, m2,
gcd,si;
1805 PrintS(
"\n--- create strong gcd poly: ");
1808 Print(
"\n strat->S[%d]: ",
i);
1832 if(
pLmCmp(pSigMult,sSigMult) == 0)
1841 if(
pLtCmp(pSigMult,sSigMult)==1)
1860 h.i_r1 = -1;
h.i_r2 = -1;
1868 int red_result =
redRing(&
h,strat);
1878 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1895 int red_result =
redRing(&
h,strat);
1905 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1918 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1922 h.p1 =
p;
h.p2 = strat->
S[
i];
1955 Lp.ecart=0; Lp.length=0;
1960#ifndef HAVE_RATGRING
1962#elif defined(HAVE_RATGRING)
1979 if((!((strat->
ecartS[
i]>0)&&(ecart>0)))
2072 for(
j = strat->
Bl;
j>=0;
j--)
2171 Lp.p1 = strat->
S[
i];
2185 Lp.i_r1 = strat->
S_2_R[
i];
2199 && (Lp.p->coef!=
NULL))
2203 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2243 Lp.ecart=0; Lp.length=0;
2250 if((!((strat->
ecartS[
i]>0)&&(ecart>0)))
2346 for(
j = strat->
Bl;
j>=0;
j--)
2402 Lp.p1 = strat->
S[
i];
2409 Lp.i_r1 = strat->
S_2_R[
i];
2423 && (Lp.p->coef!=
NULL))
2427 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2451 unsigned long pSigMultNegSev,sSigMultNegSev;
2455 Lp.ecart=0; Lp.length=0;
2460#ifndef HAVE_RATGRING
2462#elif defined(HAVE_RATGRING)
2492 PrintS(
"----------------\n");
2495 PrintS(
"----------------\n");
2501 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2522 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2523 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2524 || strat->
rewCrit1(sSigMult,sSigMultNegSev,Lp.lcm,strat,
i+1)
2601 Lp.sevSig = ~pSigMultNegSev;
2608 Lp.sevSig = ~sSigMultNegSev;
2619 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
2633 Lp.checked = strat->
sl+1;
2640 Lp.prod_crit =
TRUE;
2652 PrintS(
"SIGNATURE OF PAIR: ");
2656 Lp.p1 = strat->
S[
i];
2670 Lp.i_r1 = strat->
S_2_R[
i];
2684 && (Lp.p->coef!=
NULL))
2726 unsigned long pSigMultNegSev,sSigMultNegSev;
2730 Lp.ecart=0; Lp.length=0;
2735#ifndef HAVE_RATGRING
2737#elif defined(HAVE_RATGRING)
2773 if(pSigMult !=
NULL)
2776 if(sSigMult !=
NULL)
2780 Print(
"----------------\n");
2783 Print(
"----------------\n");
2787 if(pSigMult !=
NULL && sSigMult !=
NULL)
2796 if(pSigMult ==
NULL)
2798 if(sSigMult ==
NULL)
2808 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2830 int red_result =
redRing(&Lp,strat);
2840 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
2842 strat->
enterS(Lp,0,strat,strat->
tl);
2856 Lp.sig =
pCopy(pSigMult);
2885 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2886 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2968 Lp.sig =
pNeg(Lp.sig);
2979 Lp.sevSig = ~pSigMultNegSev;
2986 Lp.sevSig = ~sSigMultNegSev;
2998 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
3012 Lp.checked = strat->
sl+1;
3019 Lp.prod_crit =
TRUE;
3031 PrintS(
"SIGNATURE OF PAIR: ");
3035 Lp.p1 = strat->
S[
i];
3050 Lp.i_r1 = strat->
S_2_R[
i];
3064 && (Lp.p->coef!=
NULL))
3072 int red_result =
redRing(&Lp,strat);
3082 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
3085 strat->
enterS(Lp,0,strat, strat->
tl+1);
3137 Lp.p1 = strat->
S[
i];
3141 Lp.i_r1 = strat->
S_2_R[
i];
3156 && (Lp.p->coef!=
NULL))
3159 l = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
3170 int j=strat->
Ll+strat->
Bl+1;
3178 for (
i=strat->
Bl;
i>=0;
i--)
3180 j = strat->
posInL(strat->
L,
j,&(strat->
B[
i]),strat);
3191 int j=strat->
Ll+strat->
Bl+1;
3199 for (
i=strat->
Bl;
i>=0;
i--)
3226 for (
j=0;
j<=strat->
sl;
j++)
3230 for (
i=strat->
Bl;
i>=0;
i--)
3245 for (
j=0;
j<=strat->
sl;
j++)
3249 for (
i=strat->
Bl;
i>=0;
i--)
3272 for (
j=strat->
Ll;
j>=0;
j--)
3278 if (strat->
L[
j].p == strat->
tail)
3324 for (
j=strat->
Ll;
j>=0;
j--)
3344 for(
i=
j-1;
i>=0;
i--)
3363 for (
j=strat->
Ll;
j>=0;
j--)
3365 #ifdef HAVE_SHIFTBBA
3366 if ((strat->
L[
j].p1!=
NULL) &&
3399 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3402 if (strat->
L[
j].p2 ==
p)
3408 if ((strat->
L[
i].p2 ==
p) &&
pLmEqual(strat->
L[
j].lcm,strat->
L[
i].lcm))
3422 strat->
L[
i].p2 = strat->
tail;
3439 else if (strat->
L[
j].p2 == strat->
tail)
3478 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3481 if (strat->
L[
j].p2 ==
p)
3487 if ((strat->
L[
i].p2 ==
p) &&
pLmEqual(strat->
L[
j].lcm,strat->
L[
i].lcm))
3501 strat->
L[
i].p2 = strat->
tail;
3518 else if (strat->
L[
j].p2 == strat->
tail)
3539 for (
j=0;
j<=strat->
sl;
j++)
3543 for (
i=strat->
Bl;
i>=0;
i--)
3551 Print(
"chain-crit-part: S[%d]=",
j);
3553 Print(
" divide B[%d].lcm=",
i);
3575 for (
j=strat->
Ll;
j>=0;
j--)
3581 if (strat->
L[
j].p == strat->
tail)
3585 PrintS(
"chain-crit-part: pCompareChainPart p=");
3587 Print(
" delete L[%d]",
j);
3616 Print(
"chain-crit-part: sugar B[%d].lcm=",
j);
3618 Print(
" delete B[%d]",
i);
3629 Print(
"chain-crit-part: sugar B[%d].lcm=",
i);
3631 Print(
" delete B[%d]",
j);
3651 for (
j=strat->
Ll;
j>=0;
j--)
3659 PrintS(
"chain-crit-part: sugar:pCompareChainPart p=");
3661 Print(
" delete L[%d]",
j);
3679 for(
i=
j-1;
i>=0;
i--)
3685 Print(
"chain-crit-part: equal lcm B[%d].lcm=",
j);
3687 Print(
" delete B[%d]\n",
i);
3704 for (
j=strat->
Ll;
j>=0;
j--)
3712 PrintS(
"chain-crit-part: pCompareChainPart p=");
3714 Print(
" delete L[%d]",
j);
3743 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3746 if (strat->
L[
j].p2 ==
p)
3752 if ((strat->
L[
i].p2 ==
p) &&
pLmEqual(strat->
L[
j].lcm,strat->
L[
i].lcm))
3769 strat->
L[
i].p2 = strat->
tail;
3776 PrintS(
"chain-crit-part: divisible_by p=");
3778 Print(
" delete L[%d]",
l);
3789 PrintS(
"chain-crit-part: divisible_by(2) p=");
3791 Print(
" delete L[%d]",
i);
3802 else if (strat->
L[
j].p2 == strat->
tail)
3830 for (
j=0;
j<=
k;
j++)
3843 for (
j=0;
j<=
k;
j++)
3852 for (
j=0;
j<=
k;
j++)
3865 #ifdef HAVE_RATGRING
3895 for (
j=0;
j<=
k;
j++)
3908 for (
j=0;
j<=
k;
j++)
3917 for (
j=0;
j<=
k;
j++)
4015 for (
j=0;
j<=strat->
sl;
j++)
4019 for (
i=strat->
Bl;
i>=0;
i--)
4026 PrintS(
"--- chain criterion func chainCritRing type 1\n");
4029 PrintS(
" strat->B[i].lcm:");
4034 wrp(strat->
B[
i].lcm);
4049 for (
j=strat->
Ll;
j>=0;
j--)
4062 PrintS(
"--- chain criterion func chainCritRing type 2\n");
4063 PrintS(
"strat->L[j].p:");
4094 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
4097 if (strat->
L[
j].p2 ==
p)
4112 PrintS(
"--- chain criterion func chainCritRing type 3\n");
4113 PrintS(
"strat->L[j].lcm:");
4114 wrp(strat->
L[
j].lcm);
4115 PrintS(
" strat->L[i].lcm:");
4116 wrp(strat->
L[
i].lcm);
4130 strat->
L[
i].p2 = strat->
tail;
4147 else if (strat->
L[
j].p2 == strat->
tail)
4171 for (
j=0;
j<=
k;
j++)
4183 for (
j=0;
j<=
k;
j++)
4191 for (
j=0;
j<=
k;
j++)
4203 #ifdef HAVE_RATGRING
4228 && ((iCompH<=strat->syzComp)||(strat->
syzComp==0)))
4273 PrintS(
"--- create zero spoly: ");
4302 posx = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
4357 PrintS(
"--- create zero spoly: ");
4385 int red_result =
redRing(&Lp,strat);
4394 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
4396 strat->
enterS(Lp,0,strat,strat->
tl);
4443 if ( (!strat->
fromT)
4500 if ( (!strat->
fromT)
4525 if ( (!strat->
fromT)
4550 for (
j=0;
j<=
k;
j++)
4553 if ((iCompH==iCompSj)
4564 for (
j=0;
j<=
k;
j++)
4567 if ((iCompH==iCompSj)
4619 int i,
j,at,ecart, s2r;
4623 int new_suc=strat->
sl+1;
4627 for (;
i<=strat->
sl;
i++)
4632 if (new_suc > at) new_suc = at;
4635 sev = strat->
sevS[
i];
4638 for (
j=
i;
j>=at+1;
j--)
4640 strat->
S[
j] = strat->
S[
j-1];
4646 strat->
ecartS[at] = ecart;
4647 strat->
sevS[at] = sev;
4648 strat->
S_2_R[at] = s2r;
4651 for (
j=
i;
j>=at+1;
j--)
4655 strat->
fromQ[at]=fq;
4659 if (new_suc <= strat->sl) *suc=new_suc;
4722 if (cmp == cmp_int)
return an;
4723 if (cmp == -cmp_int)
return en;
4729 if (cmp == cmp_int) en =
i;
4730 else if (cmp == -cmp_int) an =
i;
4746 if (
pLmCmp(set[an],
p) == cmp_int)
return an;
4747 if (
pLmCmp(set[an],
p) == -cmp_int)
return en;
4749 && ((strat->
ecartS[an])>ecart_p))
4755 else if (
pLmCmp(set[
i],
p) == -cmp_int) an=
i;
4759 &&((strat->
ecartS[
i])<ecart_p))
4787 || ((op == o) && (
pLtCmp(set[mon],
p) == -1)))
4798 || ((op == o) && (
pLtCmp(set[an],
p) == -1)))
4805 || ((op == o) && (
pLtCmp(set[
i],
p) == -1)))
4831 || ((op == o) && (
pLtCmp(set[an],
p) == -1)))
4838 || ((op == o) && (
pLtCmp(set[
i],
p) == -1)))
4850 if(end < 0 || end >=
IDELEMS(F))
4852 if (end<0)
return 0;
4859 for(
i=start;
i<end;
i++)
4873 || ((op == o) && (
pLtCmp(set[an],
p) == -1)))
4880 || ((op == o) && (
pLtCmp(set[
i],
p) == -1)))
4905 if (
length==-1)
return 0;
4918 if (
pLmCmp(set[an].
p,
p.p) == cmp_int)
return an;
4934 if (
length==-1)
return 0;
4946 if (set[an].
length>
p.length)
return an;
4962 if (
length==-1)
return 0;
4964 int o =
p.GetpFDeg();
4965 int op = set[
length].GetpFDeg();
4980 op= set[an].GetpFDeg();
4982 || (( op == o) && (
pLmCmp(set[an].
p,
p.p) == cmp_int)))
4987 op = set[
i].GetpFDeg();
4989 || (( op == o) && (
pLmCmp(set[
i].
p,
p.p) == cmp_int)))
4998 if (
length==-1)
return 0;
5000 int o =
p.GetpFDeg();
5001 int op = set[
length].GetpFDeg();
5015 op= set[an].GetpFDeg();
5022 op = set[
i].GetpFDeg();
5038 if (
length==-1)
return 0;
5041 int o =
p.GetpFDeg();
5042 int op = set[
length].GetpFDeg();
5047 || (( op == o) && (set[
length].length ==
p.length)
5058 op = set[an].GetpFDeg();
5060 || (( op == o) && (set[an].
length >
p.length))
5061 || (( op == o) && (set[an].length ==
p.length)
5062 && (
pLmCmp(set[an].
p,
p.p) == cmp_int)))
5067 op = set[
i].GetpFDeg();
5069 || (( op == o) && (set[
i].
length >
p.length))
5070 || (( op == o) && (set[
i].length ==
p.length)
5080 if (
length==-1)
return 0;
5083 int o =
p.GetpFDeg();
5084 int op = set[
length].GetpFDeg();
5088 || (( op == o) && (set[
length].length ==
p.length)
5099 op = set[an].GetpFDeg();
5101 || (( op == o) && (set[an].
length >
p.length))
5102 || (( op == o) && (set[an].length ==
p.length)
5108 op = set[
i].GetpFDeg();
5110 || (( op == o) && (set[
i].
length >
p.length))
5111 || (( op == o) && (set[
i].length ==
p.length)
5126 if (
length==-1)
return 0;
5128 int o =
p.GetpFDeg();
5130 if (set[
length].GetpFDeg() <= o)
5140 if (set[an].GetpFDeg() > o)
5145 if (set[
i].GetpFDeg() > o)
5155 if (
length==-1)
return 0;
5156 int ol =
p.GetpLength();
5158 int oo=set[
length].ecart;
5160 if ((oo < op) || ((oo==op) && (set[
length].
length <= ol)))
5170 int oo=set[an].ecart;
5172 || ((oo==op) && (set[an].
pLength > ol)))
5177 int oo=set[
i].ecart;
5179 || ((oo == op) && (set[
i].
pLength > ol)))
5211 if (
length==-1)
return 0;
5213 int o =
p.GetpFDeg() +
p.ecart;
5229 op = set[an].GetpFDeg()+set[an].ecart;
5231 || (( op == o) && (
pLmCmp(set[an].
p,
p.p) == cmp_int)))
5236 op = set[
i].GetpFDeg()+set[
i].ecart;
5238 || (( op == o) && (
pLmCmp(set[
i].
p,
p.p) == cmp_int)))
5247 if (
length==-1)
return 0;
5249 int o =
p.GetpFDeg() +
p.ecart;
5264 op = set[an].GetpFDeg()+set[an].ecart;
5271 op = set[
i].GetpFDeg()+set[
i].ecart;
5307 if (
length==-1)
return 0;
5309 int o =
p.GetpFDeg() +
p.ecart;
5314 || (( op == o) && (set[
length].ecart >
p.ecart))
5315 || (( op == o) && (set[
length].ecart==
p.ecart)
5326 op = set[an].GetpFDeg()+set[an].ecart;
5328 || (( op == o) && (set[an].ecart <
p.ecart))
5329 || (( op == o) && (set[an].ecart==
p.ecart)
5330 && (
pLmCmp(set[an].
p,
p.p) == cmp_int)))
5335 op = set[
i].GetpFDeg()+set[
i].ecart;
5337 || (( op == o) && (set[
i].ecart <
p.ecart))
5338 || (( op == o) && (set[
i].ecart ==
p.ecart)
5348 if (
length==-1)
return 0;
5350 int o =
p.GetpFDeg() +
p.ecart;
5354 || (( op == o) && (set[
length].ecart >
p.ecart))
5355 || (( op == o) && (set[
length].ecart==
p.ecart)
5366 op = set[an].GetpFDeg()+set[an].ecart;
5368 || (( op == o) && (set[an].ecart <
p.ecart))
5369 || (( op == o) && (set[an].ecart==
p.ecart)
5375 op = set[
i].GetpFDeg()+set[
i].ecart;
5377 || (( op == o) && (set[
i].ecart <
p.ecart))
5378 || (( op == o) && (set[
i].ecart ==
p.ecart)
5393 if (
length==-1)
return 0;
5397 int o =
p.GetpFDeg() +
p.ecart;
5407 || ((op == o) && (set[
length].ecart >
p.ecart))
5408 || ((op == o) && (set[
length].ecart==
p.ecart)
5424 int op = set[an].GetpFDeg()+set[an].ecart;
5426 || ((op == o) && (set[an].ecart <
p.ecart))
5427 || ((op == o) && (set[an].ecart==
p.ecart)
5428 && (
pLmCmp(set[an].
p,
p.p) == cmp_int)))
5438 int op = set[
i].GetpFDeg()+set[
i].ecart;
5440 || ((op == o) && (set[
i].ecart <
p.ecart))
5441 || ((op == o) && (set[
i].ecart ==
p.ecart)
5454 if (
length==-1)
return 0;
5458 int o =
p.GetpFDeg() +
p.ecart;
5467 || ((op == o) && (set[
length].ecart >
p.ecart))
5468 || ((op == o) && (set[
length].ecart==
p.ecart)
5484 int op = set[an].GetpFDeg()+set[an].ecart;
5486 || ((op == o) && (set[an].ecart <
p.ecart))
5487 || ((op == o) && (set[an].ecart==
p.ecart)
5498 int op = set[
i].GetpFDeg()+set[
i].ecart;
5500 || ((op == o) && (set[
i].ecart <
p.ecart))
5501 || ((op == o) && (set[
i].ecart ==
p.ecart)
5520 if (
length==-1)
return 0;
5523 int op=
p.GetpFDeg();
5525 if (set[
length].ecart < o)
5527 if (set[
length].ecart == o)
5529 int oo=set[
length].GetpFDeg();
5530 if ((oo < op) || ((oo==op) && (set[
length].
length <
p.length)))
5541 if (set[an].ecart > o)
5543 if (set[an].ecart == o)
5545 int oo=set[an].GetpFDeg();
5547 || ((oo==op) && (set[an].
length >
p.length)))
5553 if (set[
i].ecart > o)
5555 else if (set[
i].ecart == o)
5557 int oo=set[
i].GetpFDeg();
5559 || ((oo == op) && (set[
i].
length >
p.length)))
5579 int d=
p->GetpFDeg();
5580 int op=set[
length].GetpFDeg();
5595 op=set[an].GetpFDeg();
5597 || ((op == d) && (
p->p1!=
NULL) && (set[an].p1==
NULL))
5598 || (
pLmCmp(set[an].
p,
p->p)== cmp_int))
5603 op=set[
i].GetpFDeg();
5605 || ((op==d) && (
p->p1!=
NULL) && (set[
i].p1==
NULL))
5635 if (
pLmCmp(set[an].
p,
p->p) == cmp_int)
return en;
5691 if (
pLtCmp(set[an].sig,
p->sig) == cmp_int)
return en;
5695 if (
pLtCmp(set[
i].sig,
p->sig) == cmp_int) an=
i;
5719 cmp =
pLtCmp(set[an].sig,
p->sig);
5726 if (set[an].FDeg >
p->FDeg)
5728 if (set[an].FDeg < p->FDeg)
5730 if (set[an].FDeg ==
p->FDeg)
5748 if (set[
i].FDeg >
p->FDeg)
5750 if (set[
i].FDeg < p->FDeg)
5752 if (set[
i].FDeg ==
p->FDeg)
5767 if (strat->
syzl==0)
return 0;
5773 int en= strat->
syzl-1;
5778 if (
pLtCmp(strat->
syz[an],sig) != cmp_int)
return en;
5811 int o =
p->GetpFDeg();
5812 int op = set[
length].GetpFDeg();
5825 op = set[an].GetpFDeg();
5827 || ((op == o) && (
pLmCmp(set[an].
p,
p->p) != cmp_int)))
5832 op = set[
i].GetpFDeg();
5834 || ((op == o) && (
pLmCmp(set[
i].
p,
p->p) != cmp_int)))
5853 int o =
p->GetpFDeg();
5854 int op = set[
length].GetpFDeg();
5866 op = set[an].GetpFDeg();
5873 op = set[
i].GetpFDeg();
5887 int o =
p->GetpFDeg();
5888 int op = set[
length].GetpFDeg();
5900 op = set[an].GetpFDeg();
5907 op = set[
i].GetpFDeg();
5919 if (
length < 0)
return 0;
5929 if (set[an].FDeg >
p->FDeg)
5931 if (set[an].FDeg < p->FDeg)
5933 if (set[an].FDeg ==
p->FDeg)
5941 if (set[an].t_p!=
NULL)
5963 if (set[
i].FDeg >
p->FDeg)
5965 if (set[
i].FDeg < p->FDeg)
5967 if (set[
i].FDeg ==
p->FDeg)
5975 if (set[
i].t_p!=
NULL)
6006 if (coeff == 0)
return -1;
6009 while (tmp % 2 == 0)
6067 int o =
p->GetpFDeg();
6068 int op = set[
length].GetpFDeg();
6073 || ((op == o) && (set[
length].length <=
p->length)
6083 op = set[an].GetpFDeg();
6085 || ((op == o) && (set[an].
length >
p->length))
6086 || ((op == o) && (set[an].length <=
p->length)
6087 && (
pLmCmp(set[an].
p,
p->p) != cmp_int)))
6092 op = set[
i].GetpFDeg();
6094 || ((op == o) && (set[
i].
length >
p->length))
6095 || ((op == o) && (set[
i].length <=
p->length)
6108 int o =
p->GetpFDeg();
6109 int op = set[
length].GetpFDeg();
6113 || ((op == o) && (set[
length].length <=
p->length)
6123 op = set[an].GetpFDeg();
6125 || ((op == o) && (set[an].
length >
p->length))
6126 || ((op == o) && (set[an].length <=
p->length)
6132 op = set[
i].GetpFDeg();
6134 || ((op == o) && (set[
i].
length >
p->length))
6135 || ((op == o) && (set[
i].length <=
p->length)
6154 int o =
p->GetpFDeg();
6156 if (set[
length].GetpFDeg() > o)
6166 if (set[an].GetpFDeg() >= o)
6171 if (set[
i].GetpFDeg() >= o)
6189 int o =
p->GetpFDeg() +
p->ecart;
6203 op = set[an].GetpFDeg() + set[an].ecart;
6205 || ((op == o) && (
pLmCmp(set[an].
p,
p->p) != cmp_int)))
6210 op = set[
i].GetpFDeg() + set[
i].ecart;
6212 || ((op == o) && (
pLmCmp(set[
i].
p,
p->p) != cmp_int)))
6224 int o =
p->GetpFDeg() +
p->ecart;
6237 op = set[an].GetpFDeg() + set[an].ecart;
6244 op = set[
i].GetpFDeg() + set[
i].ecart;
6264 int o =
p->GetpFDeg() +
p->ecart;
6269 && (set[
length].ecart >
p->ecart))
6271 && (set[
length].ecart ==
p->ecart)
6281 if ((set[an].GetpFDeg() + set[an].ecart > o)
6282 || ((set[an].GetpFDeg() + set[an].ecart == o)
6283 && (set[an].ecart >
p->ecart))
6284 || ((set[an].GetpFDeg() + set[an].ecart == o)
6285 && (set[an].ecart ==
p->ecart)
6286 && (
pLmCmp(set[an].
p,
p->p) != cmp_int)))
6291 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6292 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6293 && (set[
i].ecart >
p->ecart))
6294 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6295 && (set[
i].ecart ==
p->ecart)
6308 int o =
p->GetpFDeg() +
p->ecart;
6312 && (set[
length].ecart >
p->ecart))
6314 && (set[
length].ecart ==
p->ecart)
6324 if ((set[an].GetpFDeg() + set[an].ecart > o)
6325 || ((set[an].GetpFDeg() + set[an].ecart == o)
6326 && (set[an].ecart >
p->ecart))
6327 || ((set[an].GetpFDeg() + set[an].ecart == o)
6328 && (set[an].ecart ==
p->ecart)
6334 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6335 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6336 && (set[
i].ecart >
p->ecart))
6337 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6338 && (set[
i].ecart ==
p->ecart)
6360 int o =
p->GetpFDeg() +
p->ecart;
6369 && (set[
length].ecart >
p->ecart))
6371 && (set[
length].ecart ==
p->ecart)
6386 if ((set[an].GetpFDeg() + set[an].ecart > o)
6387 || ((set[an].GetpFDeg() + set[an].ecart == o)
6388 && (set[an].ecart >
p->ecart))
6389 || ((set[an].GetpFDeg() + set[an].ecart == o)
6390 && (set[an].ecart ==
p->ecart)
6391 && (
pLmCmp(set[an].
p,
p->p) != cmp_int)))
6401 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6402 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6403 && (set[
i].ecart >
p->ecart))
6404 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6405 && (set[
i].ecart ==
p->ecart)
6424 int o =
p->GetpFDeg() +
p->ecart;
6432 && (set[
length].ecart >
p->ecart))
6434 && (set[
length].ecart ==
p->ecart)
6449 if ((set[an].GetpFDeg() + set[an].ecart > o)
6450 || ((set[an].GetpFDeg() + set[an].ecart == o)
6451 && (set[an].ecart >
p->ecart))
6452 || ((set[an].GetpFDeg() + set[an].ecart == o)
6453 && (set[an].ecart ==
p->ecart)
6464 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6465 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6466 && (set[
i].ecart >
p->ecart))
6467 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6468 && (set[
i].ecart ==
p->ecart)
6486 PrintS(
"syzygy criterion checks: ");
6489 for (
int k=0;
k<strat->
syzl;
k++)
6494 Print(
"checking with: %d / %d -- \n",
k,strat->
syzl);
6523 PrintS(
"--- syzygy criterion checks: ");
6548 Print(
"checking with: %d -- ",
k);
6573 PrintS(
"rewritten criterion checks: ");
6576 for(
int k = strat->
sl;
k>=start;
k--)
6580 PrintS(
"checking with: ");
6596 PrintS(
"ALL ELEMENTS OF S\n----------------------------------------\n");
6597 for(
int kk = 0; kk<strat->
sl+1; kk++)
6601 PrintS(
"------------------------------\n");
6631 for (
int ii=strat->
sl; ii>start; ii--)
6637 if (!(
pLmCmp(p1,p2) == 1))
6656 for (
int i=strat->
Bl;
i>-1;
i--)
6677 for (
int ii=strat->
sl; ii>-1; ii--)
6683 if (!(
pLmCmp(p1,p2) == 1))
6704 const unsigned long not_sev = ~L->sev;
6705 const unsigned long* sev = strat->
sevS;
6718 if (
j > end_pos)
return NULL;
6719 #if defined(PDEBUG) || defined(PDIV_DEBUG)
6721 (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]))
6723 if (!(sev[
j] & not_sev) &&
6724 (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]) &&
6737 if (
j > end_pos)
return NULL;
6738 #if defined(PDEBUG) || defined(PDIV_DEBUG)
6741 && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j])
6744 if (!(sev[
j] & not_sev)
6745 && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j])
6756 if (strat->
tl < 0 || strat->
S_2_R[
j] == -1)
6777 if (
j > end_pos)
return NULL;
6779 #if defined(PDEBUG) || defined(PDIV_DEBUG)
6783 && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]))
6789 if (! (sev[
j] & not_sev)
6790 && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]))
6793 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[
j]);
6808 if (
j > end_pos)
return NULL;
6810 #if defined(PDEBUG) || defined(PDIV_DEBUG)
6814 && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j])
6821 if (! (sev[
j] & not_sev)
6822 && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]))
6825 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[
j]);
6876 if (With ==
NULL)
break;
6886 return redtail(L, end_pos, strat);
6892 if (hn ==
NULL)
goto all_done;
6913 return redtail(&L, end_pos, strat);
6921 p =
h = L->GetLmTailRing();
6923 return L->GetLmCurrRing();
6958 Ln.SetShortExpVector();
6964 With = &(strat->
T[
j]);
6965 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
6970 if (With ==
NULL)
break;
6971 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
6998 pNext(
h) = Ln.LmExtractAndIter();
7001 }
while (!Ln.IsNull());
7004 if (Ln.IsNull())
goto all_done;
7005 if (! withT) With_s.Init(
currRing);
7007 pNext(
h) = Ln.LmExtractAndIter();
7026 return L->GetLmCurrRing();
7034 p =
h = L->GetLmTailRing();
7036 return L->GetLmCurrRing();
7043 Ln.pLength = L->GetpLength() - 1;
7067 Ln.SetShortExpVector();
7073 With = &(strat->
T[
j]);
7078 if (With ==
NULL)
break;
7105 pNext(
h) = Ln.LmExtractAndIter();
7108 }
while (!Ln.IsNull());
7120 if (! withT) With_s.Init(
currRing);
7122 pNext(
h) = Ln.LmExtractAndIter();
7141 return L->GetLmCurrRing();
7150 p =
h = L->GetLmTailRing();
7185 Ln.SetShortExpVector();
7198 With = &(strat->
T[
j]);
7199 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
7216 pNext(
h) = Ln.LmExtractAndIter();
7219 }
while (!Ln.IsNull());
7227 With = &(strat->
T[
j]);
7228 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
7245 pNext(
h) = Ln.LmExtractAndIter();
7248 }
while (!Ln.IsNull());
7252 if (Ln.IsNull())
goto all_done;
7254 pNext(
h) = Ln.LmExtractAndIter();
7279 p =
h = L->GetLmTailRing();
7281 return L->GetLmCurrRing();
7288 Ln.pLength = L->GetpLength() - 1;
7301 Ln.SetShortExpVector();
7303 if (With ==
NULL)
break;
7314 With->GetLmCurrRing();
7324 pNext(
h) = Ln.LmExtractAndIter();
7327 }
while (!Ln.IsNull());
7330 if (Ln.IsNull())
goto all_done;
7333 pNext(
h) = Ln.LmExtractAndIter();
7351 return L->GetLmCurrRing();
7385 p =
h = L->GetLmTailRing();
7387 return L->GetLmCurrRing();
7394 Ln.pLength = L->GetpLength() - 1;
7407 Ln.SetShortExpVector();
7410 if (With ==
NULL)
break;
7419 poly p_Ln=Ln.GetLmCurrRing();
7420 poly p_With=With->GetLmCurrRing();
7433 pNext(
h) = Ln.LmExtractAndIter();
7436 }
while (!Ln.IsNull());
7441 if (Ln.IsNull())
goto all_done;
7443 pNext(
h) = Ln.LmExtractAndIter();
7461 return L->GetLmCurrRing();
7476 if (strat->
Ll != *reduc)
7478 if (strat->
Ll != *reduc-1)
7490 if (red_result == 0)
7492 else if (red_result < 0)
7494 if ((red_result > 0) || ((strat->
Ll % 100)==99))
7496 if (strat->
Ll != *reduc && strat->
Ll > 0)
7513 Print(
"product criterion:%d chain criterion:%d\n",strat->
cp,strat->
c3);
7514 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7515 #ifdef HAVE_SHIFTBBA
7517 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7528 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7529 #ifdef HAVE_SHIFTBBA
7531 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7546 for (
i=0;
i<=strat->
sl;
i++)
7558 for (
i=0;
i<=strat->
tl;
i++)
7562 if (strat->
T[
i].length==0) strat->
T[
i].length=
pLength(strat->
T[
i].p);
7563 Print(
" o:%ld e:%d l:%d",
7564 strat->
T[
i].pFDeg(),strat->
T[
i].ecart,strat->
T[
i].length);
7569 for (
i=strat->
Ll;
i>=0;
i--)
7578 Print(
" o:%ld e:%d l:%d",
7579 strat->
L[
i].pFDeg(),strat->
L[
i].ecart,strat->
L[
i].length);
7602 strat->
S=strat->
Shdl->m;
7607 memset(strat->
fromQ,0,
i*
sizeof(
int));
7636 strat->
enterS(
h,pos,strat,-1);
7637 strat->
fromQ[pos]=1;
7670 strat->
enterS(
h,pos,strat,-1);
7698 strat->
S=strat->
Shdl->m;
7703 memset(strat->
fromQ,0,
i*
sizeof(
int));
7733 strat->
enterS(
h,pos,strat,-1);
7734 strat->
fromQ[pos]=1;
7766 pos = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
7798 strat->
S = strat->
Shdl->m;
7811 memset(strat->
fromQ,0,
i*
sizeof(
int));
7840 strat->
enterS(
h,pos,strat,-1);
7841 strat->
fromQ[pos]=1;
7949 for(
i=1;
i<=strat->
sl;
i++)
7961 strat->
syz = (poly *)
omAlloc(ps*
sizeof(poly));
7965#if defined(DEBUGF5) || defined(DEBUGF51)
7966 PrintS(
"------------- GENERATING SYZ RULES NEW ---------------\n");
8003 for (
k = 0;
k<
i;
k++)
8047 for (
k = 0;
k<strat->
sl+1;
k++)
8068 PrintS(
"Principal syzygies:\n");
8071 Print(
"ps %d\n",ps);
8072 PrintS(
"--------------------------------\n");
8082 PrintS(
"--------------------------------\n");
8106 strat->
S=strat->
Shdl->m;
8112 memset(strat->
fromQ,0,
i*
sizeof(
int));
8141 strat->
enterS(
h,pos,strat, strat->
tl+1);
8143 strat->
fromQ[pos]=1;
8171 strat->
enterS(
h,pos,strat, strat->
tl+1);
8213 h.is_normalized = 0;
8220 strat->
enterS(
h,pos,strat, strat->
tl+1);
8254 strat->
S=strat->
Shdl->m;
8260 memset(strat->
fromQ,0,
i*
sizeof(
int));
8289 strat->
enterS(
h,pos,strat, strat->
tl+1);
8291 strat->
fromQ[pos]=1;
8319 strat->
enterS(
h,pos,strat, strat->
tl+1);
8361 h.is_normalized = 0;
8368 strat->
enterS(
h,pos,strat, strat->
tl+1);
8390 unsigned long not_sev = ~ pGetShortExpVector(
h);
8392 while (
j <= maxIndex)
8409 if (!
pIsVector((*p).p) && ((*p).ecart != 0))
8416 h1 = r =
pCopy((*p).p);
8468 unsigned long not_sev = ~ pGetShortExpVector(
h);
8478 not_sev = ~ pGetShortExpVector(
h);
8493 unsigned long not_sev = ~ pGetShortExpVector(
h);
8495 while (
j <= maxIndex)
8502 not_sev = ~ pGetShortExpVector(
h);
8518 unsigned long not_sev = ~ pGetShortExpVector(
h);
8545 not_sev = ~ pGetShortExpVector(
h);
8549 while (
j <= maxIndex);
8590 if (
pCmp(redSi,strat->
S[
i])!=0)
8647 if (any_change)
reorderS(&suc,strat);
8652 for (
i=0;
i<=strat->
sl;
i++)
8702 else if (
pCmp((strat->
S)[
i],redSi)!=0)
8743 if (any_change)
reorderS(&suc,strat);
8744 else { suc=-1;
break; }
8755 for (
i=0;
i<=strat->
sl;
i++)
8783 if (suc!= -1)
updateS(toT,strat);
8803 *
sizeof(
unsigned long));
8830 strat->
Shdl->m=strat->
S;
8832 if (atS <= strat->sl)
8834#ifdef ENTER_USE_MEMMOVE
8835 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
8836 (strat->
sl - atS + 1)*
sizeof(poly));
8837 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
8838 (strat->
sl - atS + 1)*
sizeof(
int));
8839 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
8840 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
8841 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
8842 (strat->
sl - atS + 1)*
sizeof(
int));
8844 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
8845 (strat->
sl - atS + 1)*
sizeof(
int));
8847 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
8850 for (
i=strat->
sl+1;
i>=atS+1;
i--)
8852 strat->
S[
i] = strat->
S[
i-1];
8858 for (
i=strat->
sl+1;
i>=atS+1;
i--)
8861 for (
i=strat->
sl+1;
i>=atS+1;
i--)
8867#ifdef ENTER_USE_MEMMOVE
8868 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
8869 (strat->
sl - atS + 1)*
sizeof(
int));
8871 for (
i=strat->
sl+1;
i>=atS+1;
i--)
8876 strat->
fromQ[atS]=0;
8887 strat->
sevS[atS] =
p.sev;
8889 strat->
S_2_R[atS] = atR;
8899 for (
int i = maxPossibleShift;
i > 0;
i--)
8907 int atS =
posInS(strat, strat->
sl, qq.p, qq.ecart);
8926 *
sizeof(
unsigned long));
8930 *
sizeof(
unsigned long));
8958 strat->
Shdl->m=strat->
S;
8965 if (atS <= strat->sl)
8967#ifdef ENTER_USE_MEMMOVE
8968 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
8969 (strat->
sl - atS + 1)*
sizeof(poly));
8970 memmove(&(strat->
sig[atS+1]), &(strat->
sig[atS]),
8971 (strat->
sl - atS + 1)*
sizeof(poly));
8972 memmove(&(strat->
sevSig[atS+1]), &(strat->
sevSig[atS]),
8973 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
8974 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
8975 (strat->
sl - atS + 1)*
sizeof(
int));
8976 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
8977 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
8978 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
8979 (strat->
sl - atS + 1)*
sizeof(
int));
8981 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
8982 (strat->
sl - atS + 1)*
sizeof(
int));
8984 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
8987 for (
i=strat->
sl+1;
i>=atS+1;
i--)
8989 strat->
S[
i] = strat->
S[
i-1];
8997 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9000 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9006#ifdef ENTER_USE_MEMMOVE
9007 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9008 (strat->
sl - atS + 1)*
sizeof(
int));
9010 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9015 strat->
fromQ[atS]=0;
9019 strat->
S[atS] =
p.p;
9020 strat->
sig[atS] =
p.sig;
9026 strat->
sevS[atS] =
p.sev;
9036 strat->
sevSig[atS] =
p.sevSig;
9039 strat->
S_2_R[atS] = atR;
9043 Print(
"--- LIST S: %d ---\n",strat->
sl);
9044 for(
k=0;
k<=strat->
sl;
k++)
9048 PrintS(
"--- LIST S END ---\n");
9074 else strat->
P.sev=0;
9082 poly tp = strat->
T[tj].p;
9087 for (
j = 0;
j <= strat->
sl; ++
j)
9101 pos =
posInS(strat, strat->
sl,
p.p,
p.ecart);
9107 for (
i = 0;
i <= strat->
Ll; ++
i)
9131 strat->
enterS(
p, pos, strat, strat->
tl);
9170 for(
i=strat->
tl;
i>=0;
i--)
9172 if (
p.p==strat->
T[
i].p)
9174 printf(
"already in T at pos %d of %d, atT=%d\n",
i,strat->
tl,atT);
9180#ifdef HAVE_TAIL_RING
9183 p.t_p=
p.GetLmTailRing();
9189 if (strat->
tl == strat->
tmax-1)
9191 if (atT <= strat->tl)
9193#ifdef ENTER_USE_MEMMOVE
9194 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9196 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9197 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9199 for (
i=strat->
tl+1;
i>=atT+1;
i--)
9201#ifndef ENTER_USE_MEMMOVE
9202 strat->
T[
i] = strat->
T[
i-1];
9205 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9213 if (!(
currRing->isLPring &&
p.shift > 0))
9229 strat->
T[atT].max_exp =
NULL;
9232 strat->
R[strat->
tl] = &(strat->
T[atT]);
9233 strat->
T[atT].i_r = strat->
tl;
9257 for(
i=strat->
tl;
i>=0;
i--)
9259 if (
p.p==strat->
T[
i].p)
9261 printf(
"already in T at pos %d of %d, atT=%d\n",
i,strat->
tl,atT);
9267#ifdef HAVE_TAIL_RING
9270 p.t_p=
p.GetLmTailRing();
9276 if (strat->
tl == strat->
tmax-1)
9278 if (atT <= strat->tl)
9280#ifdef ENTER_USE_MEMMOVE
9281 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9283 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9284 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9286 for (
i=strat->
tl+1;
i>=atT+1;
i--)
9288#ifndef ENTER_USE_MEMMOVE
9289 strat->
T[
i] = strat->
T[
i-1];
9292 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9310 strat->
T[atT].max_exp =
NULL;
9313 strat->
R[strat->
tl] = &(strat->
T[atT]);
9314 strat->
T[atT].i_r = strat->
tl;
9321 for(
i=strat->
tl;
i>=0;
i--)
9351 (strat->
syzmax)*
sizeof(
unsigned long),
9353 *
sizeof(
unsigned long));
9356 if (atT < strat->syzl)
9358#ifdef ENTER_USE_MEMMOVE
9359 memmove(&(strat->
syz[atT+1]), &(strat->
syz[atT]),
9360 (strat->
syzl-atT+1)*
sizeof(poly));
9361 memmove(&(strat->
sevSyz[atT+1]), &(strat->
sevSyz[atT]),
9362 (strat->
syzl-atT+1)*
sizeof(
unsigned long));
9364 for (
i=strat->
syzl;
i>=atT+1;
i--)
9366#ifndef ENTER_USE_MEMMOVE
9377 strat->
syz[atT] =
p.sig;
9378 strat->
sevSyz[atT] =
p.sevSig;
9381 Print(
"element in strat->syz: %d--%d ",atT+1,strat->
syzmax);
9391 strat->
L[cc].sig, ~strat->
L[cc].sevSig,
currRing)
9403 PrintS(
"--- Syzygies ---\n");
9406 PrintS(
"--------------------------------\n");
9412 PrintS(
"--------------------------------\n");
9492 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9493 else PrintS(
"ideal/module is not homogeneous\n");
9561 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9562 else PrintS(
"ideal/module is not homogeneous\n");
10099 if ((r->m[
l]!=
NULL)
10106 if ((
Q->m[q]!=
NULL)
10129 if ((r->m[
l]!=
NULL)
10136 if ((
Q->m[q]!=
NULL)
10179 reduction_found=
TRUE;
10209 reduction_found=
TRUE;
10222 if ( reduction_found)
10310 for (
i=strat->
sl;
i>=low;
i--)
10312 int end_pos=strat->
sl;
10314 if (strat->
ak==0) end_pos=
i-1;
10316 if ((T_j !=
NULL)&&(T_j->p==strat->
S[
i]))
10334 Print(
"to (tailR) S[%d]:",
i);
10346 T_j->max_exp =
NULL;
10349 T_j->pCleardenom();
10389 Print(
"to (-tailR) S[%d]:",
i);
10486 assume(L->i_r1 >= -1 && L->i_r1 <= strat->
tl);
10487 assume(L->i_r2 >= -1 && L->i_r2 <= strat->
tl);
10492 if ((L->i_r1 == -1) || (L->i_r2 == -1) )
10497 if ((L->i_r1>=0)&&(strat->
R[L->i_r1]!=
NULL)) p1_max = (strat->
R[L->i_r1])->max_exp;
10499 if ((L->i_r2>=0)&&(strat->
R[L->i_r2]!=
NULL)) p2_max = (strat->
R[L->i_r2])->max_exp;
10524 poly p1_max = (strat->
R[atR])->max_exp;
10525 poly p2_max = (strat->
R[strat->
S_2_R[atS]])->max_exp;
10543 ideal F =
idCopy(Forig);
10547 ideal monred =
idInit(1,1);
10554 if((posconst != -1) && (!
nIsZero(F->m[posconst]->coef)))
10564 for(
int i=0;
i<idelemQ;
i++)
10572 if((posconst != -1) && (!
nIsZero(monred->m[posconst]->coef)))
10574 pmon =
pCopy(monred->m[posconst]);
10589 II->m[
j++] =
prMapR(F->m[
i], nMap, origR, QQ_ring);
10591 II->m[
j++] =
prMapR(
Q->m[
i], nMap, origR, QQ_ring);
10598 if(II->m[
i] !=
NULL)
10599 II->m[
i+1] = II->m[
i];
10602 poly integer =
NULL;
10610 integer =
pHead(syz->m[
i]);
10617 pmon =
prMapR(integer, nMap2, QQ_ring, origR);
10631 poly mindegmon =
NULL;
10636 if(mindegmon ==
NULL)
10637 mindegmon =
pCopy(one->m[
i]);
10640 if(
p_Deg(one->m[
i], QQ_ring) <
p_Deg(mindegmon, QQ_ring))
10641 mindegmon =
pCopy(one->m[
i]);
10645 if(mindegmon !=
NULL)
10648 if(II->m[
i] !=
NULL)
10649 II->m[
i+1] = II->m[
i];
10650 II->m[0] =
pCopy(mindegmon);
10679 pmon =
prMapR(mindegmon, nMap2, QQ_ring, origR);
10708 poly pH =
h->GetP();
10712 for(
int i = 0;
i<=strat->
sl;
i++)
10722#ifdef HAVE_SHIFTBBA
10747#ifdef HAVE_SHIFTBBA
10775 h->SetLmCurrRing();
10776 if((deleted)&&(
h->p!=
NULL))
10784 poly hSig =
h->sig;
10785 poly pH =
h->GetP();
10789 for(
int i = 0;
i<=strat->
sl;
i++)
10800 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
10827 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
10858 h->SetLmCurrRing();
10967 if (expbound == 0) expbound = strat->
tailRing->bitmask << 1;
10984 new_tailRing->pFDeg =
currRing->pFDeg;
10985 new_tailRing->pLDeg =
currRing->pLDeg;
10989 Print(
"[%lu:%d", (
unsigned long) new_tailRing->bitmask, new_tailRing->ExpL_Size);
11000 for (
i=0;
i<=strat->
tl;
i++)
11002 strat->
T[
i].ShallowCopyDelete(new_tailRing, new_tailBin,
11003 p_shallow_copy_delete);
11005 for (
i=0;
i<=strat->
Ll;
i++)
11009 strat->
L[
i].ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11011 if ((strat->
P.t_p !=
NULL) ||
11013 strat->
P.ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11015 if ((L !=
NULL) && (L->tailRing != new_tailRing))
11018 L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11024 L->tailRing = new_tailRing;
11027 L->max_exp = t_l->max_exp;
11031 if ((
T !=
NULL) && (
T->tailRing != new_tailRing &&
T->i_r < 0))
11032 T->ShallowCopyDelete(new_tailRing, new_tailBin, p_shallow_copy_delete);
11039 strat->
tailBin = new_tailBin;
11060 unsigned long l = 0;
11066 for (
i=0;
i<= strat->
Ll;
i++)
11070 for (
i=0;
i<=strat->
tl;
i++)
11098 res->block0 = (
int *)
omAlloc0((n+1)*
sizeof(
int));
11099 res->block1 = (
int *)
omAlloc0((n+1)*
sizeof(
int));
11100 int **wvhdl = (
int **)
omAlloc0((n+1)*
sizeof(
int*));
11101 res->wvhdl = wvhdl;
11102 for (
int i=1;
i<n;
i++)
11104 res->order[
i] = r->order[
i-1];
11105 res->block0[
i] = r->block0[
i-1];
11106 res->block1[
i] = r->block1[
i-1];
11107 res->wvhdl[
i] = r->wvhdl[
i-1];
11127 WarnS(
"error in nc_rComplete");
11146 res->block0 = (
int *)
omAlloc0((n+2)*
sizeof(
int));
11147 res->block1 = (
int *)
omAlloc0((n+2)*
sizeof(
int));
11148 int **wvhdl = (
int **)
omAlloc0((n+2)*
sizeof(
int*));
11149 res->wvhdl = wvhdl;
11150 for (
int i=2;
i<n+2;
i++)
11152 res->order[
i] = r->order[
i-2];
11153 res->block0[
i] = r->block0[
i-2];
11154 res->block1[
i] = r->block1[
i-2];
11155 res->wvhdl[
i] = r->wvhdl[
i-2];
11160 res->block0[0] = 1;
11162 for (
int i=0;
i<
res->N; ++
i)
11163 res->wvhdl[0][
i] = 1;
11183 WarnS(
"error in nc_rComplete");
11320#ifdef HAVE_TAIL_BIN
11346Timings
for the different possibilities of posInT:
11347 T15 EDL DL EL L 1-2-3
11348Gonnet 43.26 42.30 38.34 41.98 38.40 100.04
11349Hairer_2_1 1.11 1.15 1.04 1.22 1.08 4.7
11350Twomat3 1.62 1.69 1.70 1.65 1.54 11.32
11351ahml 4.48 4.03 4.03 4.38 4.96 26.50
11352c7 15.02 13.98 15.16 13.24 17.31 47.89
11353c8 505.09 407.46 852.76 413.21 499.19 n/a
11354f855 12.65 9.27 14.97 8.78 14.23 33.12
11355gametwo6 11.47 11.35 14.57 11.20 12.02 35.07
11356gerhard_3 2.73 2.83 2.93 2.64 3.12 6.24
11357ilias13 22.89 22.46 24.62 20.60 23.34 53.86
11358noon8 40.68 37.02 37.99 36.82 35.59 877.16
11359rcyclic_19 48.22 42.29 43.99 45.35 51.51 204.29
11360rkat9 82.37 79.46 77.20 77.63 82.54 267.92
11361schwarz_11 16.46 16.81 16.76 16.81 16.72 35.56
11362test016 16.39 14.17 14.40 13.50 14.26 34.07
11363test017 34.70 36.01 33.16 35.48 32.75 71.45
11364test042 10.76 10.99 10.27 11.57 10.45 23.04
11365test058 6.78 6.75 6.51 6.95 6.22 9.47
11366test066 10.71 10.94 10.76 10.61 10.56 19.06
11367test073 10.75 11.11 10.17 10.79 8.63 58.10
11368test086 12.23 11.81 12.88 12.24 13.37 66.68
11369test103 5.05 4.80 5.47 4.64 4.89 11.90
11370test154 12.96 11.64 13.51 12.46 14.61 36.35
11371test162 65.27 64.01 67.35 59.79 67.54 196.46
11372test164 7.50 6.50 7.68 6.70 7.96 17.13
11373virasoro 3.39 3.50 3.35 3.47 3.70 7.66
11383 if (
length==-1)
return 0;
11386 int op=
p.GetpFDeg();
11387 int ol =
p.GetpLength();
11389 if (set[
length].ecart < o)
11391 if (set[
length].ecart == o)
11393 int oo=set[
length].GetpFDeg();
11394 if ((oo < op) || ((oo==op) && (set[
length].
length < ol)))
11405 if (set[an].ecart > o)
11407 if (set[an].ecart == o)
11409 int oo=set[an].GetpFDeg();
11411 || ((oo==op) && (set[an].
pLength > ol)))
11417 if (set[
i].ecart > o)
11419 else if (set[
i].ecart == o)
11421 int oo=set[
i].GetpFDeg();
11423 || ((oo == op) && (set[
i].
pLength > ol)))
11437 if (
length==-1)
return 0;
11439 int op=
p.GetpFDeg();
11440 int ol =
p.GetpLength();
11442 int oo=set[
length].GetpFDeg();
11443 if ((oo < op) || ((oo==op) && (set[
length].
length < ol)))
11453 int oo=set[an].GetpFDeg();
11455 || ((oo==op) && (set[an].
pLength > ol)))
11460 int oo=set[
i].GetpFDeg();
11462 || ((oo == op) && (set[
i].
pLength > ol)))
11473 int ol =
p.GetpLength();
11487 if (set[an].
pLength>ol)
return an;
11509 else if (strat->
red==
redHoney) printf(
"redHoney\n");
11510 else if (strat->
red==
redEcart) printf(
"redEcart\n");
11511 else if (strat->
red==
redHomog) printf(
"redHomog\n");
11512 else if (strat->
red==
redLazy) printf(
"redLazy\n");
11514 else printf(
"%p\n",(
void*)strat->
red);
11515 printf(
"posInT: ");
11531#ifdef HAVE_MORE_POS_IN_T
11537 else printf(
"%p\n",(
void*)strat->
posInT);
11538 printf(
"posInL: ");
11555 else printf(
"%p\n",(
void*)strat->
posInL);
11556 printf(
"enterS: ");
11560 else printf(
"%p\n",(
void*)strat->
enterS);
11561 printf(
"initEcart: ");
11564 else printf(
"%p\n",(
void*)strat->
initEcart);
11565 printf(
"initEcartPair: ");
11569 printf(
"homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
11571 printf(
"honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
11573 printf(
"chainCrit: ");
11576 else printf(
"%p\n",(
void*)strat->
chainCrit);
11577 printf(
"posInLDependsOnLength=%d\n",
11593 else printf(
"? (%lx)", (
long)
currRing->pLDeg);
11607 else printf(
"? (%lx)", (
long)strat->
tailRing->pLDeg);
11609 printf(
"currRing->pFDeg: ");
11616 else printf(
"? (%lx)", (
long)
currRing->pFDeg);
11624 printf(
"ecartWeights: ");
11646#ifdef HAVE_SHIFTBBA
11651 assume(ifromS <= strat->sl);
11750 PrintS(
"\n--- create strong gcd poly: ");
11753 Print(
"\n q (strat->S[%d]): ", ifromS);
11759 pNext(
gcd) =
p_Add_q(
pp_Mult_mm(
pp_mm_Mult(
pNext(
p), m1, strat->
tailRing), m12, strat->
tailRing),
pp_Mult_mm(
pp_mm_Mult(
pNext(q), m2, strat->
tailRing), m22, strat->
tailRing), strat->
tailRing);
11781 h.i_r1 = -1;
h.i_r2 = -1;
11788 if (atR >= 0 && shiftcount == 0 && ifromS >= 0)
11801 posx = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
11815#ifdef HAVE_SHIFTBBA
11842 int j,compare,compareCoeff;
11846 h.ecart=0;
h.length=0;
11878 for(
j = strat->
Bl;
j>=0;
j--)
11887 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qisFromQ==0))
11902 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qisFromQ==0))
11915 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qisFromQ==0))
12019 h.i_r1 = -1;
h.i_r2 = -1;
12028 if (atR >= 0 && shiftcount == 0 && ifromS >= 0)
12043 posx = strat->
posInL(strat->
B,strat->
Bl,&
h,strat);
12058#ifdef HAVE_SHIFTBBA
12068#ifdef HAVE_SHIFTBBA
12073 assume(q_inS < 0 || strat->S[q_inS] == q);
12083 if (strat->
fromQ !=
NULL && q_inS >= 0)
12084 q_isFromQ = strat->
fromQ[q_inS];
12086 BOOLEAN (*enterPair)(poly, poly, int, int,
kStrategy, int, int, int, int, int);
12093 int neededShift = p_lastVblock - ((
pGetComp(
p) > 0 ||
pGetComp(q) > 0) ? 0 : 1);
12094 int maxPossibleShift =
degbound - q_lastVblock;
12095 int maxShift =
si_min(neededShift, maxPossibleShift);
12096 int firstShift = (q ==
p ? 1 : 0);
12098 for (
int j = firstShift;
j <= maxShift;
j++)
12101 if (enterPair(qq,
p, ecartp, p_isFromQ, strat, -1, ecartq, q_isFromQ,
j, q_inS))
12113 for (
int j = p_lastVblock;
j <= maxPossibleShift;
j++)
12119 enterPair(qq,
p, ecartp, p_isFromQ, strat, -1, ecartq, q_isFromQ, p_lastVblock, q_inS);
12124 return delete_pair;
12128#ifdef HAVE_SHIFTBBA
12134 assume(p_inS < 0 || strat->S[p_inS] ==
p);
12143 if (strat->
fromQ !=
NULL && p_inS >= 0)
12144 p_isFromQ = strat->
fromQ[p_inS];
12148 assume(q_shift <= p_lastVblock);
12154 return enterOnePairShift(q,
p, ecartp, p_isFromQ, strat, -1, ecartq, q_isFromQ, q_shift, -1);
12168#ifdef HAVE_SHIFTBBA
12171#ifdef CRITERION_DEBUG
12176 poly lmq =
pHead(q);
12197 int qfromQ = qisFromQ;
12206 Lp.ecart=0; Lp.length=0;
12216#ifdef CRITERION_DEBUG
12224 if((!((ecartq>0)&&(ecart>0)))
12243#ifdef CRITERION_DEBUG
12249 Lp.ecart =
si_max(ecart,ecartq);
12250 if (strat->
fromT && (ecartq>ecart))
12253#ifdef CRITERION_DEBUG
12275 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12278#ifdef CRITERION_DEBUG
12281 Print(
"--- chain crit using B[%d].lcm=%s\n",
j,
pString(strat->
B[
j].lcm));
12292#ifdef CRITERION_DEBUG
12295 Print(
"--- chain crit using pair to remove B[%d].lcm=%s\n",
j,
pString(strat->
B[
j].lcm));
12328#ifdef CRITERION_DEBUG
12333 if (strat->
fromT && (ecartq>ecart))
12336#ifdef CRITERION_DEBUG
12348 for(
j = strat->
Bl;
j>=0;
j--)
12354 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12357#ifdef CRITERION_DEBUG
12360 Print(
"--- chain crit using B[%d].lcm=%s\n",
j,
pString(strat->
B[
j].lcm));
12370#ifdef CRITERION_DEBUG
12373 Print(
"--- chain crit using pair to remove B[%d].lcm=%s\n",
j,
pString(strat->
B[
j].lcm));
12390#ifdef CRITERION_DEBUG
12395 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (qfromQ!=0))
12398#ifdef CRITERION_DEBUG
12457#ifdef CRITERION_DEBUG
12474 if ( (atR >= 0) && (shiftcount==0) && (ifromS >=0) )
12491 && (Lp.p->coef!=
NULL))
12495 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
12497#ifdef CRITERION_DEBUG
12510#ifdef HAVE_SHIFTBBA
12516 if (h_lastVblock == 0)
return;
12527 int maxShift =
degbound - h_lastVblock;
12536 for (
i=0;
i<=maxShift;
i++)
12540 for (
j=0;
j<=
k;
j++)
12545 poly
s = strat->
S[
j];
12556 for (
j=0;
j<=
k;
j++)
12558 poly
s = strat->
S[
j];
12573 else if ((isFromQ)&&(strat->
fromQ!=
NULL))
12576 for (
j=0;
j<=
k;
j++)
12581 poly
s = strat->
S[
j];
12588 for (
i=1;
i<=maxShift;
i++)
12592 for (
j=0;
j<=
k;
j++)
12596 poly
s = strat->
S[
j];
12598 if (
i < s_lastVblock || (
pGetComp(
s) > 0 &&
i == s_lastVblock))
12624 for (
j=0;
j<=
k;
j++)
12626 poly
s = strat->
S[
j];
12630 for (
i=1;
i<=maxShift;
i++)
12634 for (
j=0;
j<=
k;
j++)
12636 poly
s = strat->
S[
j];
12638 if (
i < s_lastVblock || (
pGetComp(
s) > 0 &&
i == s_lastVblock))
12653 if (
i < h_lastVblock)
12677 for (
j=0;
j<=
k;
j++)
12682 poly
s = strat->
S[
j];
12699 for (
j=0;
j<=
k;
j++)
12704 poly
s = strat->
S[
j];
12709 for (
i=1;
i<=maxShift;
i++)
12712 for (
j=0;
j<=
k;
j++)
12717 poly
s = strat->
S[
j];
12719 if (
i <= s_lastVblock)
12734 if (
i <= h_lastVblock)
12768#ifdef HAVE_SHIFTBBA
12774 if (h_lastVblock == 0)
return;
12785 int maxShift =
degbound - h_lastVblock;
12794 for (
i=0;
i<=maxShift;
i++)
12797 for (
j=0;
j<=
k;
j++)
12802 poly
s = strat->
S[
j];
12811 for (
j=0;
j<=
k;
j++)
12813 poly
s = strat->
S[
j];
12828 else if ((isFromQ)&&(strat->
fromQ!=
NULL))
12831 for (
j=0;
j<=
k;
j++)
12836 poly
s = strat->
S[
j];
12843 for (
i=1;
i<=maxShift;
i++)
12846 for (
j=0;
j<=
k;
j++)
12850 poly
s = strat->
S[
j];
12861 for (
j=0;
j<=
k;
j++)
12863 poly
s = strat->
S[
j];
12868 for (
i=1;
i<=maxShift;
i++)
12872 for (
j=0;
j<=
k;
j++)
12874 poly
s = strat->
S[
j];
12889 for (
j=0;
j<=
k;
j++)
12895 poly
s = strat->
S[
j];
12912 for (
j=0;
j<=
k;
j++)
12917 poly
s = strat->
S[
j];
12922 for (
i=1;
i<=maxShift;
i++)
12925 for (
j=0;
j<=
k;
j++)
12930 poly
s = strat->
S[
j];
12952#ifdef HAVE_SHIFTBBA
12961 if ( (!strat->
fromT)
12982#ifdef HAVE_SHIFTBBA
12993 for (
int i = 1;
i <= maxPossibleShift;
i++)
13005#ifdef HAVE_SHIFTBBA
13012 p =
h = L->GetLmTailRing();
13014 return L->GetLmCurrRing();
13021 Ln.pLength = L->GetpLength() - 1;
13029 while(!Ln.IsNull())
13033 Ln.SetShortExpVector();
13039 With = &(strat->
T[
j]);
13044 if (With ==
NULL)
break;
13060 pNext(
h) = Ln.LmExtractAndIter();
13063 }
while (!Ln.IsNull());
13066 if (Ln.IsNull())
goto all_done;
13067 if (! withT) With_s.Init(
currRing);
13069 pNext(
h) = Ln.LmExtractAndIter();
13084 return L->GetLmCurrRing();
static int si_max(const int a, const int b)
static int si_min(const int a, const int b)
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 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 void n_Delete(number *p, const coeffs r)
delete 'p'
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_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
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)
if(!FE_OPT_NO_SHELL_FLAG)
void scComputeHC(ideal S, ideal Q, int ak, poly &hEdge)
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 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 int ksReducePolyTailLC_Z(LObject *PR, TObject *PW, LObject *Red)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
KINLINE TObject ** initR()
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 BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
KINLINE int ksReducePolyTail_Z(LObject *PR, TObject *PW, LObject *Red)
KINLINE unsigned long * initsevT()
int redLiftstd(LObject *h, kStrategy strat)
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
void kBucketDestroy(kBucket_pt *bucket_pt)
int ksCheckCoeff(number *a, number *b, const coeffs r)
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)
long kHomModDeg(poly p, const ring r)
int redFirst(LObject *h, kStrategy strat)
int redEcart(LObject *h, kStrategy strat)
void enterSMoraNF(LObject &p, int atS, kStrategy strat, int atR=-1)
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
ideal kStd2(ideal F, ideal Q, tHomog h, intvec **w, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
generic interface to GB/SB computations, large hilbert vectors
void enterSMora(LObject &p, int atS, kStrategy strat, int atR=-1)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
int kFindDivisibleByInT_Z(const kStrategy strat, const LObject *L, const int start)
int redHoney(LObject *h, kStrategy strat)
int redHomog(LObject *h, kStrategy strat)
int redLazy(LObject *h, kStrategy strat)
poly redNF(poly h, int &max_ind, int nonorm, 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)
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)
void initBuchMora(ideal F, ideal Q, kStrategy strat)
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)
void enterTShift(LObject p, kStrategy strat, int atT)
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)
TObject * kFindDivisibleByInS_T(kStrategy strat, int end_pos, LObject *L, TObject *T, long ecart)
int posInT0(const TSet, const int length, LObject &)
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 initenterstrongPairsShift(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR)
void enterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
static void enterOnePairRingShift(poly q, poly p, int, int isFromQ, kStrategy strat, int atR, int, int qisFromQ, int shiftcount, int ifromS)
static const char * kTest_LmEqual(poly p, poly t_p, ring tailRing)
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)
static BOOLEAN enterOneStrongPolyAndEnterOnePairRingShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS)
void clearSbatch(poly h, int k, int pos, kStrategy strat)
static int pLPDivComp(poly p, poly q)
int posInT2(const TSet set, const int length, LObject &p)
int posInL13(const LSet set, const int length, LObject *p, const kStrategy)
int posInL110Ring(const LSet set, const int length, LObject *p, const kStrategy)
static BOOLEAN enterOnePairWithShifts(int q_inS, poly q, poly p, int ecartp, int p_isFromQ, kStrategy strat, int, int p_lastVblock, int q_lastVblock)
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)
void redtailBbaAlsoLC_Z(LObject *L, int end_pos, kStrategy strat)
BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat)
static void deleteHCBucket(LObject *L, kStrategy strat)
static BOOLEAN enterOnePairWithoutShifts(int p_inS, poly q, poly p, int ecartq, int q_isFromQ, kStrategy strat, int, int p_lastVblock, int q_shift)
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)
void initBuchMoraPos(kStrategy strat)
void initenterpairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR)
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 and syzComp==1: 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)
void initenterpairsShift(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR)
static void initenterstrongPairsSig(poly h, poly hSig, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
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)
STATIC_VAR BOOLEAN sloppy_max
void enterExtendedSpolySig(poly h, poly hSig, kStrategy strat)
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
static void enterOnePairSig(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
BOOLEAN kTest_L(LObject *L, kStrategy strat, BOOLEAN testp, int lpos, TSet T, int tlength)
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 is_shifted_p1(const poly p, const kStrategy strat)
void initSLSba(ideal F, ideal Q, kStrategy strat)
int posInL11Ringls(const LSet set, const int length, LObject *p, const kStrategy)
void enterOnePairSpecial(int i, poly p, int ecart, kStrategy strat, int atR=-1)
static int * initS_2_R(const int maxnr)
int posInL17(const LSet set, const int length, LObject *p, const kStrategy)
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)
void replaceInLAndSAndT(LObject &p, int tj, kStrategy strat)
void reorderS(int *suc, kStrategy strat)
void enterExtendedSpoly(poly h, kStrategy strat)
int posInL15Ring(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN kTest_T(TObject *T, kStrategy strat, int i, char TN)
void kMergeBintoLSba(kStrategy strat)
void deleteHC(LObject *L, kStrategy strat, BOOLEAN fromNext)
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)
poly redtailBba_NF(poly p, kStrategy strat)
void exitSba(kStrategy strat)
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)
BOOLEAN enterOnePairShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS)
void kDebugPrint(kStrategy strat)
Output some debug info about a given strategy.
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)
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)
int kFindInTShift(poly p, TSet T, int tlength)
void postReduceByMonSig(LObject *h, kStrategy strat)
static BOOLEAN enterOneStrongPolyShift(poly q, poly p, int, int, kStrategy strat, int atR, int, int, int shiftcount, int ifromS)
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)
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...
static unsigned long * initsevS(const int maxnr)
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)
VAR denominator_list DENOMINATOR_LIST
static void enterOnePairSigRing(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void enterSBbaShift(LObject &p, int atS, kStrategy strat, int atR)
int posInL11(const LSet set, const int length, LObject *p, const kStrategy)
poly redtailBba_Ring(LObject *L, int end_pos, kStrategy strat)
int posInLF5C(const LSet, const int, LObject *, const kStrategy strat)
void initEcartPairBba(LObject *Lp, poly, poly, int, int)
void messageStat(int hilbcount, kStrategy strat)
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)
void cancelunit(LObject *L, BOOLEAN inNF)
void initHilbCrit(ideal, ideal, bigintmat **hilb, kStrategy strat)
denominator_list_s * denominator_list
static int kFindInL1(const poly p, const kStrategy strat)
static LSet initL(int nr=setmaxL)
static void kDeleteLcm(LObject *P)
#define ALLOW_PROD_CRIT(A)
#define REDTAIL_CANONICALIZE
static bool rIsSCA(const ring r)
poly nc_CreateShortSpoly(poly p1, poly p2, const ring r)
static nc_type & ncRingType(nc_struct *p)
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
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)
STATIC_VAR gmp_float * diff
#define omFreeSize(addr, size)
#define omCheckBinAddrSize(addr, size)
#define omReallocSize(addr, o_size, size)
#define omRealloc0Size(addr, o_size, size)
#define omSizeWOfBin(bin_ptr)
#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)
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)
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 int pLength(poly a)
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 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 void p_LmDelete0(poly p, const ring r)
static int p_Cmp(poly p1, poly p2, ring r)
#define __pp_Mult_nn(p, n, r)
static poly pp_mm_Mult(poly p, poly m, const ring 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)
#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)
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)
void rChangeCurrRing(ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility 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 pLmIsConstantComp(p)
like above, except that p must be != NULL
#define pIsConstant(p)
like above, except that Comp must 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:
#define pHasNotCFRing(p1, p2)
#define pInit()
allocates a new monomial and initializes everything to 0
#define pEqualPolys(p1, p2)
#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 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 rHasLocalOrMixedOrdering(const ring r)
static BOOLEAN rHasGlobalOrdering(const ring r)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
static int rBlocks(const ring r)
static int rGetCurrSyzLimit(const ring r)
static BOOLEAN rField_is_Domain(const ring r)
static BOOLEAN rIsRatGRing(const ring r)
static BOOLEAN rIsLPRing(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)
static BOOLEAN rHasMixedOrdering(const ring r)
#define rField_is_Ring(R)
int p_mLPmaxPossibleShift(poly p, const ring r)
#define pLPCopyAndShiftLM(p, sh)
BOOLEAN _p_LPLmDivisibleByNoComp(poly a, poly b, const ring r)
int p_mFirstVblock(poly p, const ring ri)
void k_SplitFrame(poly &m1, poly &m2, int at, const ring r)
void p_mLPshift(poly m, int sh, const ring ri)
#define pLPDivisibleBy(a, b)
#define pLPLmDivisibleBy(a, b)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
ideal id_MaxIdeal(const ring r)
initialise the maximal ideal (at 0)
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static int idElem(const ideal F)
number of non-zero polys in F
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)
EXTERN_VAR short * ecartWeights
#define omGetStickyBinOfBin(B)
#define omMergeStickyBinIntoBin(A, B)