47#define ENTER_USE_MEMMOVE
87#ifdef ENTER_USE_MYMEMMOVE
88inline void _my_memmove_d_gt_s(
unsigned long* d,
unsigned long*
s,
long l)
90 REGISTER unsigned long* _dl = (
unsigned long*) d;
91 REGISTER unsigned long* _sl = (
unsigned long*)
s;
102inline void _my_memmove_d_lt_s(
unsigned long* d,
unsigned long*
s,
long l)
105 REGISTER unsigned long* _dl = (
unsigned long*) d;
106 REGISTER unsigned long* _sl = (
unsigned long*)
s;
117inline void _my_memmove(
void* d,
void*
s,
long l)
119 unsigned long _d = (
unsigned long) d;
120 unsigned long _s = (
unsigned long)
s;
121 unsigned long _l = ((
l) + SIZEOF_LONG - 1) >> LOG_SIZEOF_LONG;
123 if (_d > _s) _my_memmove_d_gt_s(_d, _s, _l);
124 else _my_memmove_d_lt_s(_d, _s, _l);
128#define memmove(d,s,l) _my_memmove(d, s, l)
135#define pDivComp_EQUAL 2
136#define pDivComp_LESS 1
137#define pDivComp_GREATER -1
138#define pDivComp_INCOMP 0
151 unsigned long la, lb;
152 unsigned long divmask =
currRing->divmask;
162 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
169 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
200 unsigned long la, lb;
201 unsigned long divmask =
currRing->divmask;
211 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
218 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
225 if (
b) {
return -1; }
253 && (L->bucket !=
NULL))
256 for (
int i=1;
i<= (int) L->bucket->buckets_used;
i++)
258 poly
p=L->bucket->buckets[
i];
263 L->bucket->buckets[
i]=
NULL;
264 L->bucket->buckets_length[
i]=0;
273 L->bucket->buckets_length[
i]=
pLength(L->bucket->buckets[
i]);
281 int i=L->bucket->buckets_used;
282 while ((
i>0)&&(L->bucket->buckets[
i]==
NULL))
285 L->bucket->buckets_used=
i;
300 poly
p = L->GetLmTailRing();
311 if (L->bucket !=
NULL)
343 L->ecart = L->pLDeg() - L->GetpFDeg();
350 if ((!fromNext) && cut)
353 L->ecart = L->pLDeg(strat->
LDegLast) - L->GetpFDeg();
378 ring r = L->tailRing;
379 poly
p = L->GetLmTailRing();
453 number eins=
nInit(1);
535inline static unsigned long*
initsevS (
const int maxnr)
537 return (
unsigned long*)
omAlloc0(maxnr*
sizeof(
unsigned long));
541 return (
int*)
omAlloc0(maxnr*
sizeof(
int));
545 int &
length,
const int incr)
557 (
length+incr)*
sizeof(
long*));
575 for (
j=0;
j<=strat->
tl;
j++)
579 if (strat->
T[
j].max_exp !=
NULL)
589 if (strat->
T[
j].t_p !=
NULL)
597 if (
currRing->isLPring && strat->
T[
j].shift > 0)
606 if (
p == strat->
S[
i])
608 if (strat->
T[
j].t_p !=
NULL)
610 if (p_shallow_copy_delete!=
NULL)
634 for (
j=0;
j<=strat->
tl;
j++)
638 if (strat->
T[
j].max_exp !=
NULL)
648 if (strat->
T[
j].t_p !=
NULL)
660 if (
p == strat->
S[
i])
662 if (strat->
T[
j].t_p !=
NULL)
709 if ((*
k) < 0)
return FALSE;
710 if (((p1 == (*p).p1) && (p2 == (*p).p2))
711 || ((p1 == (*p).p2) && (p2 == (*p).p1)))
722 for (
i=0;
i<=tlength;
i++)
724 if (
T[
i].
p ==
p)
return i;
735 if (
i >= 0)
return i;
738 while (strat !=
NULL);
747 for (
i=0;
i<=tlength;
i++)
763 if (
i >= 0)
return i;
766 while (strat !=
NULL);
780#define kFalseReturn(x) do { if (!x) return FALSE;} while (0)
786 for (
i=1;
i<=tailRing->N;
i++)
789 return "Lm[i] different";
792 return "Lm[0] different";
794 return "Lm.next different";
796 return "Lm.coeff different";
803 ring tailRing =
T->tailRing;
804 ring strat_tailRing = strat->
tailRing;
805 if (strat_tailRing ==
NULL) strat_tailRing = tailRing;
806 r_assume(strat_tailRing == tailRing);
828 if (
T->t_p ==
NULL &&
i > 0)
845 if (
T->t_p !=
NULL &&
i >= 0 && TN ==
'T')
849 if (
T->max_exp !=
NULL)
850 return dReportError(
"%c[%d].max_exp is not NULL as it should be", TN,
i);
854 if (
T->max_exp ==
NULL)
866 p_Setm(test_max, tailRing);
878 if (
T->p ==
NULL &&
i > 0)
894 if ((
i >= 0) && (
T->pLength != 0)
899 return dReportError(
"%c[%d] pLength error: has %d, specified to have %d",
904 if (
i >= 0 && (TN ==
'T' || TN ==
'L'))
907 if (strat->
homog && (
T->FDeg !=
T->pFDeg()))
911 return dReportError(
"%c[%d] FDeg error: has %d, specified to have %d",
912 TN,
i ,
T->pFDeg(), d);
917 if (
i >= 0 && TN ==
'T')
929 ring strat_tailRing=strat->
tailRing;
954 if (L->bucket !=
NULL)
957 r_assume(L->bucket->bucket_ring == L->tailRing);
975 return dReportError(
"L[%d] wrong sev: has %lo, specified to have %lo",
985 else if (tlength > 0 &&
T !=
NULL && (lpos >=0))
1018 -1, strat->
T, strat->
tl));
1021 if (strat->
T !=
NULL)
1023 for (
i=0;
i<=strat->
tl;
i++)
1032 if (strat->
L !=
NULL)
1034 for (
i=0;
i<=strat->
Ll;
i++)
1037 strat->
L[
i].Next() != strat->
tail,
i,
1038 strat->
T, strat->
tl));
1049 if (strat->
S !=
NULL)
1059 for (
i=0;
i<=strat->
sl;
i++)
1061 if (strat->
S[
i] !=
NULL &&
1064 return dReportError(
"S[%d] wrong sev: has %o, specified to have %o",
1080 for (
i=0;
i<=strat->
tl;
i++)
1082 if (strat->
T[
i].i_r < 0 || strat->
T[
i].i_r > strat->
tl)
1083 return dReportError(
"strat->T[%d].i_r == %d out of bounds",
i,
1085 if (strat->
R[strat->
T[
i].i_r] != &(strat->
T[
i]))
1089 if ((strat->
S !=
NULL)&&(strat->
tl>=0))
1091 for (
i=0;
i<=strat->
sl;
i++)
1096 if (strat->
S_2_R[
i] != strat->
T[
j].i_r)
1102 #ifdef HAVE_SHIFTBBA
1107 for (
i=0;
i<=strat->
Ll;
i++)
1109 if (strat->
L[
i].p1 !=
NULL && strat->
L[
i].p2)
1111 if (strat->
L[
i].i_r1 < 0 ||
1112 strat->
L[
i].i_r1 > strat->
tl ||
1113 strat->
L[
i].T_1(strat)->p != strat->
L[
i].p1)
1115 if (strat->
L[
i].i_r2 < 0 ||
1116 strat->
L[
i].i_r2 > strat->
tl ||
1117 strat->
L[
i].T_2(strat)->p != strat->
L[
i].p2)
1122 if (strat->
L[
i].i_r1 != -1)
1124 if (strat->
L[
i].i_r2 != -1)
1127 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)
1253 #ifdef HAVE_SHIFTBBA
1263#ifdef ENTER_USE_MEMMOVE
1267 for (
i=
j;
i < (*length);
i++)
1289#ifdef ENTER_USE_MEMMOVE
1290 memmove(&((*set)[at+1]), &((*set)[at]), ((*
length)-at+1)*
sizeof(
LObject));
1292 for (
i=(*
length)+1;
i>=at+1;
i--) (*set)[
i] = (*set)[
i-1];
1306 h->FDeg =
h->pFDeg();
1307 h->ecart =
h->pLDeg() -
h->FDeg;
1314 h->FDeg =
h->pFDeg();
1321 Lp->FDeg = Lp->pFDeg();
1328 Lp->FDeg = Lp->pFDeg();
1329 (*Lp).ecart =
si_max(ecartF,ecartG);
1330 (*Lp).ecart = (*Lp).ecart- (Lp->FDeg -
p_FDeg((*Lp).lcm,
currRing));
1339 return (ecart1 <= ecart2);
1371 int j,compare,compareCoeff;
1375 h.ecart=0;
h.length=0;
1399 for(
j = strat->
Bl;
j>=0;
j--)
1520 h.i_r1 = -1;
h.i_r2 = -1;
1536 posx = strat->
posInL(strat->
B,strat->
Bl,&
h,strat);
1541 else strat->
P.sev=0L;
1555 poly m1, m2,
gcd,si;
1584 for (
int j = 0;
j < strat->
sl;
j++)
1590 && !(strat->
sevS[
j] & ~sev)
1633 PrintS(
"\n--- create strong gcd poly: ");
1636 Print(
"\n strat->S[%d]: ",
i);
1659 h.i_r1 = -1;
h.i_r2 = -1;
1665 h.p1 =
p;
h.p2 = strat->
S[
i];
1680 posx = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
1685 if(
h.IsNull())
return FALSE;
1702 if(strat->
sl < 0)
return FALSE;
1704 for(
i=0;
i<strat->
sl;
i++)
1740 h->i_r1 = -1;
h->i_r2 = -1;
1762 poly m1, m2,
gcd,si;
1810 PrintS(
"\n--- create strong gcd poly: ");
1813 Print(
"\n strat->S[%d]: ",
i);
1837 if(
pLmCmp(pSigMult,sSigMult) == 0)
1846 if(
pLtCmp(pSigMult,sSigMult)==1)
1865 h.i_r1 = -1;
h.i_r2 = -1;
1873 int red_result =
redRing(&
h,strat);
1883 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1900 int red_result =
redRing(&
h,strat);
1910 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1923 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1927 h.p1 =
p;
h.p2 = strat->
S[
i];
1961 Lp.ecart=0; Lp.length=0;
1966#ifndef HAVE_RATGRING
1968#elif defined(HAVE_RATGRING)
1985 if((!((strat->
ecartS[
i]>0)&&(ecart>0)))
2078 for(
j = strat->
Bl;
j>=0;
j--)
2177 Lp.p1 = strat->
S[
i];
2191 Lp.i_r1 = strat->
S_2_R[
i];
2205 && (Lp.p->coef!=
NULL))
2209 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2249 Lp.ecart=0; Lp.length=0;
2256 if((!((strat->
ecartS[
i]>0)&&(ecart>0)))
2352 for(
j = strat->
Bl;
j>=0;
j--)
2408 Lp.p1 = strat->
S[
i];
2415 Lp.i_r1 = strat->
S_2_R[
i];
2429 && (Lp.p->coef!=
NULL))
2433 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
2457 unsigned long pSigMultNegSev,sSigMultNegSev;
2461 Lp.ecart=0; Lp.length=0;
2466#ifndef HAVE_RATGRING
2468#elif defined(HAVE_RATGRING)
2492 pSigMultNegSev = ~p_GetShortExpVector(pSigMult,
currRing);
2494 sSigMultNegSev = ~p_GetShortExpVector(sSigMult,
currRing);
2498 PrintS(
"----------------\n");
2501 PrintS(
"----------------\n");
2507 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2528 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2529 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2530 || strat->
rewCrit1(sSigMult,sSigMultNegSev,Lp.lcm,strat,
i+1)
2607 Lp.sevSig = ~pSigMultNegSev;
2614 Lp.sevSig = ~sSigMultNegSev;
2625 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
2639 Lp.checked = strat->
sl+1;
2646 Lp.prod_crit =
TRUE;
2658 PrintS(
"SIGNATURE OF PAIR: ");
2662 Lp.p1 = strat->
S[
i];
2676 Lp.i_r1 = strat->
S_2_R[
i];
2690 && (Lp.p->coef!=
NULL))
2732 unsigned long pSigMultNegSev,sSigMultNegSev;
2736 Lp.ecart=0; Lp.length=0;
2741#ifndef HAVE_RATGRING
2743#elif defined(HAVE_RATGRING)
2779 if(pSigMult !=
NULL)
2780 pSigMultNegSev = ~p_GetShortExpVector(pSigMult,
currRing);
2782 if(sSigMult !=
NULL)
2783 sSigMultNegSev = ~p_GetShortExpVector(sSigMult,
currRing);
2786 Print(
"----------------\n");
2789 Print(
"----------------\n");
2793 if(pSigMult !=
NULL && sSigMult !=
NULL)
2802 if(pSigMult ==
NULL)
2804 if(sSigMult ==
NULL)
2814 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",sigCmp);
2836 int red_result =
redRing(&Lp,strat);
2846 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
2848 strat->
enterS(Lp,0,strat,strat->
tl);
2862 Lp.sig =
pCopy(pSigMult);
2891 if ( strat->
syzCrit(pSigMult,pSigMultNegSev,strat) ||
2892 strat->
syzCrit(sSigMult,sSigMultNegSev,strat)
2974 Lp.sig =
pNeg(Lp.sig);
2985 Lp.sevSig = ~pSigMultNegSev;
2992 Lp.sevSig = ~sSigMultNegSev;
3004 if (strat->
rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->
sl+1))
3018 Lp.checked = strat->
sl+1;
3025 Lp.prod_crit =
TRUE;
3037 PrintS(
"SIGNATURE OF PAIR: ");
3041 Lp.p1 = strat->
S[
i];
3056 Lp.i_r1 = strat->
S_2_R[
i];
3070 && (Lp.p->coef!=
NULL))
3078 int red_result =
redRing(&Lp,strat);
3088 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
3091 strat->
enterS(Lp,0,strat, strat->
tl+1);
3143 Lp.p1 = strat->
S[
i];
3147 Lp.i_r1 = strat->
S_2_R[
i];
3162 && (Lp.p->coef!=
NULL))
3165 l = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
3176 int j=strat->
Ll+strat->
Bl+1;
3184 for (
i=strat->
Bl;
i>=0;
i--)
3186 j = strat->
posInL(strat->
L,
j,&(strat->
B[
i]),strat);
3197 int j=strat->
Ll+strat->
Bl+1;
3205 for (
i=strat->
Bl;
i>=0;
i--)
3232 for (
j=0;
j<=strat->
sl;
j++)
3236 for (
i=strat->
Bl;
i>=0;
i--)
3251 for (
j=0;
j<=strat->
sl;
j++)
3255 for (
i=strat->
Bl;
i>=0;
i--)
3278 for (
j=strat->
Ll;
j>=0;
j--)
3284 if (strat->
L[
j].p == strat->
tail)
3330 for (
j=strat->
Ll;
j>=0;
j--)
3350 for(
i=
j-1;
i>=0;
i--)
3369 for (
j=strat->
Ll;
j>=0;
j--)
3371 #ifdef HAVE_SHIFTBBA
3372 if ((strat->
L[
j].p1!=
NULL) &&
3405 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3408 if (strat->
L[
j].p2 ==
p)
3414 if ((strat->
L[
i].p2 ==
p) &&
pLmEqual(strat->
L[
j].lcm,strat->
L[
i].lcm))
3428 strat->
L[
i].p2 = strat->
tail;
3445 else if (strat->
L[
j].p2 == strat->
tail)
3484 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3487 if (strat->
L[
j].p2 ==
p)
3493 if ((strat->
L[
i].p2 ==
p) &&
pLmEqual(strat->
L[
j].lcm,strat->
L[
i].lcm))
3507 strat->
L[
i].p2 = strat->
tail;
3524 else if (strat->
L[
j].p2 == strat->
tail)
3545 for (
j=0;
j<=strat->
sl;
j++)
3549 for (
i=strat->
Bl;
i>=0;
i--)
3557 Print(
"chain-crit-part: S[%d]=",
j);
3559 Print(
" divide B[%d].lcm=",
i);
3581 for (
j=strat->
Ll;
j>=0;
j--)
3587 if (strat->
L[
j].p == strat->
tail)
3591 PrintS(
"chain-crit-part: pCompareChainPart p=");
3593 Print(
" delete L[%d]",
j);
3622 Print(
"chain-crit-part: sugar B[%d].lcm=",
j);
3624 Print(
" delete B[%d]",
i);
3635 Print(
"chain-crit-part: sugar B[%d].lcm=",
i);
3637 Print(
" delete B[%d]",
j);
3657 for (
j=strat->
Ll;
j>=0;
j--)
3665 PrintS(
"chain-crit-part: sugar:pCompareChainPart p=");
3667 Print(
" delete L[%d]",
j);
3685 for(
i=
j-1;
i>=0;
i--)
3691 Print(
"chain-crit-part: equal lcm B[%d].lcm=",
j);
3693 Print(
" delete B[%d]\n",
i);
3710 for (
j=strat->
Ll;
j>=0;
j--)
3718 PrintS(
"chain-crit-part: pCompareChainPart p=");
3720 Print(
" delete L[%d]",
j);
3749 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3752 if (strat->
L[
j].p2 ==
p)
3758 if ((strat->
L[
i].p2 ==
p) &&
pLmEqual(strat->
L[
j].lcm,strat->
L[
i].lcm))
3775 strat->
L[
i].p2 = strat->
tail;
3782 PrintS(
"chain-crit-part: divisible_by p=");
3784 Print(
" delete L[%d]",
l);
3795 PrintS(
"chain-crit-part: divisible_by(2) p=");
3797 Print(
" delete L[%d]",
i);
3808 else if (strat->
L[
j].p2 == strat->
tail)
3836 for (
j=0;
j<=
k;
j++)
3849 for (
j=0;
j<=
k;
j++)
3858 for (
j=0;
j<=
k;
j++)
3871 #ifdef HAVE_RATGRING
3901 for (
j=0;
j<=
k;
j++)
3914 for (
j=0;
j<=
k;
j++)
3923 for (
j=0;
j<=
k;
j++)
4021 for (
j=0;
j<=strat->
sl;
j++)
4025 for (
i=strat->
Bl;
i>=0;
i--)
4032 PrintS(
"--- chain criterion func chainCritRing type 1\n");
4035 PrintS(
" strat->B[i].lcm:");
4040 wrp(strat->
B[
i].lcm);
4055 for (
j=strat->
Ll;
j>=0;
j--)
4068 PrintS(
"--- chain criterion func chainCritRing type 2\n");
4069 PrintS(
"strat->L[j].p:");
4100 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
4103 if (strat->
L[
j].p2 ==
p)
4118 PrintS(
"--- chain criterion func chainCritRing type 3\n");
4119 PrintS(
"strat->L[j].lcm:");
4120 wrp(strat->
L[
j].lcm);
4121 PrintS(
" strat->L[i].lcm:");
4122 wrp(strat->
L[
i].lcm);
4136 strat->
L[
i].p2 = strat->
tail;
4153 else if (strat->
L[
j].p2 == strat->
tail)
4179 for (
j=0;
j<=
k;
j++)
4191 for (
j=0;
j<=
k;
j++)
4199 for (
j=0;
j<=
k;
j++)
4211 #ifdef HAVE_RATGRING
4236 && ((iCompH<=strat->syzComp)||(strat->
syzComp==0)))
4283 PrintS(
"--- create zero spoly: ");
4312 posx = strat->
posInL(strat->
L,strat->
Ll,&Lp,strat);
4367 PrintS(
"--- create zero spoly: ");
4395 int red_result =
redRing(&Lp,strat);
4404 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
4406 strat->
enterS(Lp,0,strat,strat->
tl);
4455 if ( (!strat->
fromT)
4515 if ( (!strat->
fromT)
4540 if ( (!strat->
fromT)
4565 for (
j=0;
j<=
k;
j++)
4568 if ((iCompH==iCompSj)
4579 for (
j=0;
j<=
k;
j++)
4582 if ((iCompH==iCompSj)
4634 int i,
j,at,ecart, s2r;
4638 int new_suc=strat->
sl+1;
4642 for (;
i<=strat->
sl;
i++)
4647 if (new_suc > at) new_suc = at;
4650 sev = strat->
sevS[
i];
4653 for (
j=
i;
j>=at+1;
j--)
4655 strat->
S[
j] = strat->
S[
j-1];
4661 strat->
ecartS[at] = ecart;
4662 strat->
sevS[at] = sev;
4663 strat->
S_2_R[at] = s2r;
4666 for (
j=
i;
j>=at+1;
j--)
4670 strat->
fromQ[at]=fq;
4674 if (new_suc <= strat->sl) *suc=new_suc;
4737 if (cmp == cmp_int)
return an;
4738 if (cmp == -cmp_int)
return en;
4744 if (cmp == cmp_int) en =
i;
4745 else if (cmp == -cmp_int) an =
i;
4761 if (
pLmCmp(set[an],
p) == cmp_int)
return an;
4762 if (
pLmCmp(set[an],
p) == -cmp_int)
return en;
4764 && ((strat->
ecartS[an])>ecart_p))
4770 else if (
pLmCmp(set[
i],
p) == -cmp_int) an=
i;
4774 &&((strat->
ecartS[
i])<ecart_p))
4802 || ((op == o) && (
pLtCmp(set[mon],
p) == -1)))
4813 || ((op == o) && (
pLtCmp(set[an],
p) == -1)))
4820 || ((op == o) && (
pLtCmp(set[
i],
p) == -1)))
4846 || ((op == o) && (
pLtCmp(set[an],
p) == -1)))
4853 || ((op == o) && (
pLtCmp(set[
i],
p) == -1)))
4865 if(end < 0 || end >=
IDELEMS(F))
4867 if (end<0)
return 0;
4874 for(
i=start;
i<end;
i++)
4888 || ((op == o) && (
pLtCmp(set[an],
p) == -1)))
4895 || ((op == o) && (
pLtCmp(set[
i],
p) == -1)))
4920 if (
length==-1)
return 0;
4933 if (
pLmCmp(set[an].
p,
p.p) == cmp_int)
return an;
4949 if (
length==-1)
return 0;
4961 if (set[an].
length>
p.length)
return an;
4977 if (
length==-1)
return 0;
4979 int o =
p.GetpFDeg();
4980 int op = set[
length].GetpFDeg();
4995 op= set[an].GetpFDeg();
4997 || (( op == o) && (
pLmCmp(set[an].
p,
p.p) == cmp_int)))
5002 op = set[
i].GetpFDeg();
5004 || (( op == o) && (
pLmCmp(set[
i].
p,
p.p) == cmp_int)))
5014 if (
length==-1)
return 0;
5016 int o =
p.GetpFDeg();
5017 int op = set[
length].GetpFDeg();
5031 op= set[an].GetpFDeg();
5038 op = set[
i].GetpFDeg();
5055 if (
length==-1)
return 0;
5058 int o =
p.GetpFDeg();
5059 int op = set[
length].GetpFDeg();
5064 || (( op == o) && (set[
length].length ==
p.length)
5075 op = set[an].GetpFDeg();
5077 || (( op == o) && (set[an].
length >
p.length))
5078 || (( op == o) && (set[an].length ==
p.length)
5079 && (
pLmCmp(set[an].
p,
p.p) == cmp_int)))
5084 op = set[
i].GetpFDeg();
5086 || (( op == o) && (set[
i].
length >
p.length))
5087 || (( op == o) && (set[
i].length ==
p.length)
5098 if (
length==-1)
return 0;
5101 int o =
p.GetpFDeg();
5102 int op = set[
length].GetpFDeg();
5106 || (( op == o) && (set[
length].length ==
p.length)
5117 op = set[an].GetpFDeg();
5119 || (( op == o) && (set[an].
length >
p.length))
5120 || (( op == o) && (set[an].length ==
p.length)
5126 op = set[
i].GetpFDeg();
5128 || (( op == o) && (set[
i].
length >
p.length))
5129 || (( op == o) && (set[
i].length ==
p.length)
5145 if (
length==-1)
return 0;
5147 int o =
p.GetpFDeg();
5149 if (set[
length].GetpFDeg() <= o)
5159 if (set[an].GetpFDeg() > o)
5164 if (set[
i].GetpFDeg() > o)
5174 if (
length==-1)
return 0;
5175 int ol =
p.GetpLength();
5177 int oo=set[
length].ecart;
5179 if ((oo < op) || ((oo==op) && (set[
length].
length <= ol)))
5189 int oo=set[an].ecart;
5191 || ((oo==op) && (set[an].
pLength > ol)))
5196 int oo=set[
i].ecart;
5198 || ((oo == op) && (set[
i].
pLength > ol)))
5230 if (
length==-1)
return 0;
5232 int o =
p.GetpFDeg() +
p.ecart;
5248 op = set[an].GetpFDeg()+set[an].ecart;
5250 || (( op == o) && (
pLmCmp(set[an].
p,
p.p) == cmp_int)))
5255 op = set[
i].GetpFDeg()+set[
i].ecart;
5257 || (( op == o) && (
pLmCmp(set[
i].
p,
p.p) == cmp_int)))
5267 if (
length==-1)
return 0;
5269 int o =
p.GetpFDeg() +
p.ecart;
5284 op = set[an].GetpFDeg()+set[an].ecart;
5291 op = set[
i].GetpFDeg()+set[
i].ecart;
5328 if (
length==-1)
return 0;
5330 int o =
p.GetpFDeg() +
p.ecart;
5335 || (( op == o) && (set[
length].ecart >
p.ecart))
5336 || (( op == o) && (set[
length].ecart==
p.ecart)
5347 op = set[an].GetpFDeg()+set[an].ecart;
5349 || (( op == o) && (set[an].ecart <
p.ecart))
5350 || (( op == o) && (set[an].ecart==
p.ecart)
5351 && (
pLmCmp(set[an].
p,
p.p) == cmp_int)))
5356 op = set[
i].GetpFDeg()+set[
i].ecart;
5358 || (( op == o) && (set[
i].ecart <
p.ecart))
5359 || (( op == o) && (set[
i].ecart ==
p.ecart)
5370 if (
length==-1)
return 0;
5372 int o =
p.GetpFDeg() +
p.ecart;
5376 || (( op == o) && (set[
length].ecart >
p.ecart))
5377 || (( op == o) && (set[
length].ecart==
p.ecart)
5388 op = set[an].GetpFDeg()+set[an].ecart;
5390 || (( op == o) && (set[an].ecart <
p.ecart))
5391 || (( op == o) && (set[an].ecart==
p.ecart)
5397 op = set[
i].GetpFDeg()+set[
i].ecart;
5399 || (( op == o) && (set[
i].ecart <
p.ecart))
5400 || (( op == o) && (set[
i].ecart ==
p.ecart)
5416 if (
length==-1)
return 0;
5420 int o =
p.GetpFDeg() +
p.ecart;
5430 || ((op == o) && (set[
length].ecart >
p.ecart))
5431 || ((op == o) && (set[
length].ecart==
p.ecart)
5447 int op = set[an].GetpFDeg()+set[an].ecart;
5449 || ((op == o) && (set[an].ecart <
p.ecart))
5450 || ((op == o) && (set[an].ecart==
p.ecart)
5451 && (
pLmCmp(set[an].
p,
p.p) == cmp_int)))
5461 int op = set[
i].GetpFDeg()+set[
i].ecart;
5463 || ((op == o) && (set[
i].ecart <
p.ecart))
5464 || ((op == o) && (set[
i].ecart ==
p.ecart)
5478 if (
length==-1)
return 0;
5482 int o =
p.GetpFDeg() +
p.ecart;
5491 || ((op == o) && (set[
length].ecart >
p.ecart))
5492 || ((op == o) && (set[
length].ecart==
p.ecart)
5508 int op = set[an].GetpFDeg()+set[an].ecart;
5510 || ((op == o) && (set[an].ecart <
p.ecart))
5511 || ((op == o) && (set[an].ecart==
p.ecart)
5522 int op = set[
i].GetpFDeg()+set[
i].ecart;
5524 || ((op == o) && (set[
i].ecart <
p.ecart))
5525 || ((op == o) && (set[
i].ecart ==
p.ecart)
5545 if (
length==-1)
return 0;
5548 int op=
p.GetpFDeg();
5550 if (set[
length].ecart < o)
5552 if (set[
length].ecart == o)
5554 int oo=set[
length].GetpFDeg();
5555 if ((oo < op) || ((oo==op) && (set[
length].
length <
p.length)))
5566 if (set[an].ecart > o)
5568 if (set[an].ecart == o)
5570 int oo=set[an].GetpFDeg();
5572 || ((oo==op) && (set[an].
length >
p.length)))
5578 if (set[
i].ecart > o)
5580 else if (set[
i].ecart == o)
5582 int oo=set[
i].GetpFDeg();
5584 || ((oo == op) && (set[
i].
length >
p.length)))
5604 int d=
p->GetpFDeg();
5605 int op=set[
length].GetpFDeg();
5620 op=set[an].GetpFDeg();
5622 || ((op == d) && (
p->p1!=
NULL) && (set[an].p1==
NULL))
5623 || (
pLmCmp(set[an].
p,
p->p)== cmp_int))
5628 op=set[
i].GetpFDeg();
5630 || ((op==d) && (
p->p1!=
NULL) && (set[
i].p1==
NULL))
5660 if (
pLmCmp(set[an].
p,
p->p) == cmp_int)
return en;
5718 if (
pLtCmp(set[an].sig,
p->sig) == cmp_int)
return en;
5722 if (
pLtCmp(set[
i].sig,
p->sig) == cmp_int) an=
i;
5746 cmp =
pLtCmp(set[an].sig,
p->sig);
5753 if (set[an].FDeg >
p->FDeg)
5755 if (set[an].FDeg < p->FDeg)
5757 if (set[an].FDeg ==
p->FDeg)
5775 if (set[
i].FDeg >
p->FDeg)
5777 if (set[
i].FDeg < p->FDeg)
5779 if (set[
i].FDeg ==
p->FDeg)
5794 if (strat->
syzl==0)
return 0;
5800 int en= strat->
syzl-1;
5805 if (
pLtCmp(strat->
syz[an],sig) != cmp_int)
return en;
5838 int o =
p->GetpFDeg();
5839 int op = set[
length].GetpFDeg();
5852 op = set[an].GetpFDeg();
5854 || ((op == o) && (
pLmCmp(set[an].
p,
p->p) != cmp_int)))
5859 op = set[
i].GetpFDeg();
5861 || ((op == o) && (
pLmCmp(set[
i].
p,
p->p) != cmp_int)))
5881 int o =
p->GetpFDeg();
5882 int op = set[
length].GetpFDeg();
5894 op = set[an].GetpFDeg();
5901 op = set[
i].GetpFDeg();
5915 int o =
p->GetpFDeg();
5916 int op = set[
length].GetpFDeg();
5928 op = set[an].GetpFDeg();
5935 op = set[
i].GetpFDeg();
5949 if (
length < 0)
return 0;
5959 if (set[an].FDeg >
p->FDeg)
5961 if (set[an].FDeg < p->FDeg)
5963 if (set[an].FDeg ==
p->FDeg)
5971 if (set[an].t_p!=
NULL)
5993 if (set[
i].FDeg >
p->FDeg)
5995 if (set[
i].FDeg < p->FDeg)
5997 if (set[
i].FDeg ==
p->FDeg)
6005 if (set[
i].t_p!=
NULL)
6037 if (coeff == 0)
return -1;
6040 while (tmp % 2 == 0)
6098 int o =
p->GetpFDeg();
6099 int op = set[
length].GetpFDeg();
6104 || ((op == o) && (set[
length].length <=
p->length)
6114 op = set[an].GetpFDeg();
6116 || ((op == o) && (set[an].
length >
p->length))
6117 || ((op == o) && (set[an].length <=
p->length)
6118 && (
pLmCmp(set[an].
p,
p->p) != cmp_int)))
6123 op = set[
i].GetpFDeg();
6125 || ((op == o) && (set[
i].
length >
p->length))
6126 || ((op == o) && (set[
i].length <=
p->length)
6140 int o =
p->GetpFDeg();
6141 int op = set[
length].GetpFDeg();
6145 || ((op == o) && (set[
length].length <=
p->length)
6155 op = set[an].GetpFDeg();
6157 || ((op == o) && (set[an].
length >
p->length))
6158 || ((op == o) && (set[an].length <=
p->length)
6164 op = set[
i].GetpFDeg();
6166 || ((op == o) && (set[
i].
length >
p->length))
6167 || ((op == o) && (set[
i].length <=
p->length)
6187 int o =
p->GetpFDeg();
6189 if (set[
length].GetpFDeg() > o)
6199 if (set[an].GetpFDeg() >= o)
6204 if (set[
i].GetpFDeg() >= o)
6222 int o =
p->GetpFDeg() +
p->ecart;
6236 op = set[an].GetpFDeg() + set[an].ecart;
6238 || ((op == o) && (
pLmCmp(set[an].
p,
p->p) != cmp_int)))
6243 op = set[
i].GetpFDeg() + set[
i].ecart;
6245 || ((op == o) && (
pLmCmp(set[
i].
p,
p->p) != cmp_int)))
6258 int o =
p->GetpFDeg() +
p->ecart;
6271 op = set[an].GetpFDeg() + set[an].ecart;
6278 op = set[
i].GetpFDeg() + set[
i].ecart;
6299 int o =
p->GetpFDeg() +
p->ecart;
6304 && (set[
length].ecart >
p->ecart))
6306 && (set[
length].ecart ==
p->ecart)
6316 if ((set[an].GetpFDeg() + set[an].ecart > o)
6317 || ((set[an].GetpFDeg() + set[an].ecart == o)
6318 && (set[an].ecart >
p->ecart))
6319 || ((set[an].GetpFDeg() + set[an].ecart == o)
6320 && (set[an].ecart ==
p->ecart)
6321 && (
pLmCmp(set[an].
p,
p->p) != cmp_int)))
6326 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6327 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6328 && (set[
i].ecart >
p->ecart))
6329 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6330 && (set[
i].ecart ==
p->ecart)
6344 int o =
p->GetpFDeg() +
p->ecart;
6348 && (set[
length].ecart >
p->ecart))
6350 && (set[
length].ecart ==
p->ecart)
6360 if ((set[an].GetpFDeg() + set[an].ecart > o)
6361 || ((set[an].GetpFDeg() + set[an].ecart == o)
6362 && (set[an].ecart >
p->ecart))
6363 || ((set[an].GetpFDeg() + set[an].ecart == o)
6364 && (set[an].ecart ==
p->ecart)
6370 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6371 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6372 && (set[
i].ecart >
p->ecart))
6373 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6374 && (set[
i].ecart ==
p->ecart)
6397 int o =
p->GetpFDeg() +
p->ecart;
6406 && (set[
length].ecart >
p->ecart))
6408 && (set[
length].ecart ==
p->ecart)
6423 if ((set[an].GetpFDeg() + set[an].ecart > o)
6424 || ((set[an].GetpFDeg() + set[an].ecart == o)
6425 && (set[an].ecart >
p->ecart))
6426 || ((set[an].GetpFDeg() + set[an].ecart == o)
6427 && (set[an].ecart ==
p->ecart)
6428 && (
pLmCmp(set[an].
p,
p->p) != cmp_int)))
6438 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6439 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6440 && (set[
i].ecart >
p->ecart))
6441 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6442 && (set[
i].ecart ==
p->ecart)
6462 int o =
p->GetpFDeg() +
p->ecart;
6470 && (set[
length].ecart >
p->ecart))
6472 && (set[
length].ecart ==
p->ecart)
6487 if ((set[an].GetpFDeg() + set[an].ecart > o)
6488 || ((set[an].GetpFDeg() + set[an].ecart == o)
6489 && (set[an].ecart >
p->ecart))
6490 || ((set[an].GetpFDeg() + set[an].ecart == o)
6491 && (set[an].ecart ==
p->ecart)
6502 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6503 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6504 && (set[
i].ecart >
p->ecart))
6505 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6506 && (set[
i].ecart ==
p->ecart)
6525 PrintS(
"syzygy criterion checks: ");
6528 for (
int k=0;
k<strat->
syzl;
k++)
6533 Print(
"checking with: %d / %d -- \n",
k,strat->
syzl);
6562 PrintS(
"--- syzygy criterion checks: ");
6587 Print(
"checking with: %d -- ",
k);
6612 PrintS(
"rewritten criterion checks: ");
6615 for(
int k = strat->
sl;
k>=start;
k--)
6619 PrintS(
"checking with: ");
6635 PrintS(
"ALL ELEMENTS OF S\n----------------------------------------\n");
6636 for(
int kk = 0; kk<strat->
sl+1; kk++)
6640 PrintS(
"------------------------------\n");
6670 for (
int ii=strat->
sl; ii>start; ii--)
6676 if (!(
pLmCmp(p1,p2) == 1))
6695 for (
int i=strat->
Bl;
i>-1;
i--)
6716 for (
int ii=strat->
sl; ii>-1; ii--)
6722 if (!(
pLmCmp(p1,p2) == 1))
6743 const unsigned long not_sev = ~L->sev;
6744 const unsigned long* sev = strat->
sevS;
6757 if (
j > end_pos)
return NULL;
6758 #if defined(PDEBUG) || defined(PDIV_DEBUG)
6760 (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]))
6762 if (!(sev[
j] & not_sev) &&
6763 (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]) &&
6777 if (
j > end_pos)
return NULL;
6778 #if defined(PDEBUG) || defined(PDIV_DEBUG)
6781 && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j])
6784 if (!(sev[
j] & not_sev)
6785 && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j])
6797 if (strat->
tl < 0 || strat->
S_2_R[
j] == -1)
6818 if (
j > end_pos)
return NULL;
6820 #if defined(PDEBUG) || defined(PDIV_DEBUG)
6824 && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]))
6830 if (! (sev[
j] & not_sev)
6831 && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]))
6834 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[
j]);
6850 if (
j > end_pos)
return NULL;
6852 #if defined(PDEBUG) || defined(PDIV_DEBUG)
6856 && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j])
6863 if (! (sev[
j] & not_sev)
6864 && (ecart== LONG_MAX || ecart>= strat->
ecartS[
j]))
6867 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[
j]);
6919 if (With ==
NULL)
break;
6929 return redtail(L, end_pos, strat);
6935 if (hn ==
NULL)
goto all_done;
6956 return redtail(&L, end_pos, strat);
6964 p =
h = L->GetLmTailRing();
6966 return L->GetLmCurrRing();
7001 Ln.SetShortExpVector();
7007 With = &(strat->
T[
j]);
7008 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
7013 if (With ==
NULL)
break;
7014 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
7041 pNext(
h) = Ln.LmExtractAndIter();
7044 }
while (!Ln.IsNull());
7047 if (Ln.IsNull())
goto all_done;
7048 if (! withT) With_s.Init(
currRing);
7050 pNext(
h) = Ln.LmExtractAndIter();
7069 return L->GetLmCurrRing();
7077 p =
h = L->GetLmTailRing();
7079 return L->GetLmCurrRing();
7086 Ln.pLength = L->GetpLength() - 1;
7110 Ln.SetShortExpVector();
7116 With = &(strat->
T[
j]);
7121 if (With ==
NULL)
break;
7148 pNext(
h) = Ln.LmExtractAndIter();
7151 }
while (!Ln.IsNull());
7163 if (! withT) With_s.Init(
currRing);
7165 pNext(
h) = Ln.LmExtractAndIter();
7184 return L->GetLmCurrRing();
7194 p =
h = L->GetLmTailRing();
7229 Ln.SetShortExpVector();
7242 With = &(strat->
T[
j]);
7243 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
7260 pNext(
h) = Ln.LmExtractAndIter();
7263 }
while (!Ln.IsNull());
7271 With = &(strat->
T[
j]);
7272 assume(With->GetpLength()==
pLength(With->p != __null ? With->p : With->t_p));
7289 pNext(
h) = Ln.LmExtractAndIter();
7292 }
while (!Ln.IsNull());
7296 if (Ln.IsNull())
goto all_done;
7298 pNext(
h) = Ln.LmExtractAndIter();
7323 p =
h = L->GetLmTailRing();
7325 return L->GetLmCurrRing();
7332 Ln.pLength = L->GetpLength() - 1;
7345 Ln.SetShortExpVector();
7347 if (With ==
NULL)
break;
7357 poly p_Ln=Ln.GetLmCurrRing();
7358 poly p_With=With->GetLmCurrRing();
7368 pNext(
h) = Ln.LmExtractAndIter();
7371 }
while (!Ln.IsNull());
7374 if (Ln.IsNull())
goto all_done;
7377 pNext(
h) = Ln.LmExtractAndIter();
7395 return L->GetLmCurrRing();
7429 p =
h = L->GetLmTailRing();
7431 return L->GetLmCurrRing();
7438 Ln.pLength = L->GetpLength() - 1;
7451 Ln.SetShortExpVector();
7454 if (With ==
NULL)
break;
7463 poly p_Ln=Ln.GetLmCurrRing();
7464 poly p_With=With->GetLmCurrRing();
7477 pNext(
h) = Ln.LmExtractAndIter();
7480 }
while (!Ln.IsNull());
7485 if (Ln.IsNull())
goto all_done;
7487 pNext(
h) = Ln.LmExtractAndIter();
7505 return L->GetLmCurrRing();
7521 if (strat->
Ll != *reduc)
7523 if (strat->
Ll != *reduc-1)
7535 if (red_result == 0)
7537 else if (red_result < 0)
7539 if ((red_result > 0) || ((strat->
Ll % 100)==99))
7541 if (strat->
Ll != *reduc && strat->
Ll > 0)
7558 Print(
"product criterion:%d chain criterion:%d\n",strat->
cp,strat->
c3);
7559 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7560 #ifdef HAVE_SHIFTBBA
7562 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7573 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7574 #ifdef HAVE_SHIFTBBA
7576 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7591 for (
i=0;
i<=strat->
sl;
i++)
7603 for (
i=0;
i<=strat->
tl;
i++)
7607 if (strat->
T[
i].length==0) strat->
T[
i].length=
pLength(strat->
T[
i].p);
7608 Print(
" o:%ld e:%d l:%d",
7609 strat->
T[
i].pFDeg(),strat->
T[
i].ecart,strat->
T[
i].length);
7614 for (
i=strat->
Ll;
i>=0;
i--)
7623 Print(
" o:%ld e:%d l:%d",
7624 strat->
L[
i].pFDeg(),strat->
L[
i].ecart,strat->
L[
i].length);
7646 strat->
S=strat->
Shdl->m;
7651 memset(strat->
fromQ,0,
i*
sizeof(
int));
7680 strat->
enterS(
h,pos,strat,-1);
7681 strat->
fromQ[pos]=1;
7714 strat->
enterS(
h,pos,strat,-1);
7740 strat->
S=strat->
Shdl->m;
7745 memset(strat->
fromQ,0,
i*
sizeof(
int));
7774 strat->
enterS(
h,pos,strat,-1);
7775 strat->
fromQ[pos]=1;
7807 pos = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
7837 strat->
S = strat->
Shdl->m;
7850 memset(strat->
fromQ,0,
i*
sizeof(
int));
7879 strat->
enterS(
h,pos,strat,-1);
7880 strat->
fromQ[pos]=1;
7990 for(
i=1;
i<=strat->
sl;
i++)
8002 strat->
syz = (poly *)
omAlloc(ps*
sizeof(poly));
8006#if defined(DEBUGF5) || defined(DEBUGF51)
8007 PrintS(
"------------- GENERATING SYZ RULES NEW ---------------\n");
8014 while (i <= strat->sl)
8044 for (
k = 0;
k<
i;
k++)
8088 for (
k = 0;
k<strat->
sl+1;
k++)
8109 PrintS(
"Principal syzygies:\n");
8112 Print(
"ps %d\n",ps);
8113 PrintS(
"--------------------------------\n");
8123 PrintS(
"--------------------------------\n");
8143 strat->
S=strat->
Shdl->m;
8149 memset(strat->
fromQ,0,
i*
sizeof(
int));
8178 strat->
enterS(
h,pos,strat, strat->
tl+1);
8180 strat->
fromQ[pos]=1;
8208 strat->
enterS(
h,pos,strat, strat->
tl+1);
8250 h.is_normalized = 0;
8257 strat->
enterS(
h,pos,strat, strat->
tl+1);
8287 strat->
S=strat->
Shdl->m;
8293 memset(strat->
fromQ,0,
i*
sizeof(
int));
8322 strat->
enterS(
h,pos,strat, strat->
tl+1);
8324 strat->
fromQ[pos]=1;
8352 strat->
enterS(
h,pos,strat, strat->
tl+1);
8394 h.is_normalized = 0;
8401 strat->
enterS(
h,pos,strat, strat->
tl+1);
8423 unsigned long not_sev = ~ pGetShortExpVector(
h);
8425 while (
j <= maxIndex)
8442 if (!
pIsVector((*p).p) && ((*p).ecart != 0))
8451 h1 = r =
pCopy((*p).p);
8503 unsigned long not_sev = ~ pGetShortExpVector(
h);
8504 while ((j <= strat->sl) && (
pGetComp(strat->
S[
j])!=0))
j++;
8506 while (j<=strat->sl)
8513 not_sev = ~ pGetShortExpVector(
h);
8528 unsigned long not_sev = ~ pGetShortExpVector(
h);
8530 while (
j <= maxIndex)
8537 not_sev = ~ pGetShortExpVector(
h);
8553 unsigned long not_sev = ~ pGetShortExpVector(
h);
8580 not_sev = ~ pGetShortExpVector(
h);
8584 while (
j <= maxIndex);
8614 while (i<=strat->sl)
8625 if (
pCmp(redSi,strat->
S[
i])!=0)
8682 if (any_change)
reorderS(&suc,strat);
8687 for (
i=0;
i<=strat->
sl;
i++)
8725 while (i<=strat->sl)
8737 else if (
pCmp((strat->
S)[
i],redSi)!=0)
8778 if (any_change)
reorderS(&suc,strat);
8779 else { suc=-1;
break; }
8790 for (
i=0;
i<=strat->
sl;
i++)
8818 if (suc!= -1)
updateS(toT,strat);
8838 *
sizeof(
unsigned long));
8865 strat->
Shdl->m=strat->
S;
8867 if (atS <= strat->sl)
8869#ifdef ENTER_USE_MEMMOVE
8870 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
8871 (strat->
sl - atS + 1)*
sizeof(poly));
8872 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
8873 (strat->
sl - atS + 1)*
sizeof(
int));
8874 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
8875 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
8876 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
8877 (strat->
sl - atS + 1)*
sizeof(
int));
8879 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
8880 (strat->
sl - atS + 1)*
sizeof(
int));
8882 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
8885 for (
i=strat->
sl+1;
i>=atS+1;
i--)
8887 strat->
S[
i] = strat->
S[
i-1];
8893 for (
i=strat->
sl+1;
i>=atS+1;
i--)
8896 for (
i=strat->
sl+1;
i>=atS+1;
i--)
8902#ifdef ENTER_USE_MEMMOVE
8903 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
8904 (strat->
sl - atS + 1)*
sizeof(
int));
8906 for (
i=strat->
sl+1;
i>=atS+1;
i--)
8911 strat->
fromQ[atS]=0;
8922 strat->
sevS[atS] =
p.sev;
8924 strat->
S_2_R[atS] = atR;
8934 for (
int i = maxPossibleShift;
i > 0;
i--)
8942 int atS =
posInS(strat, strat->
sl, qq.p, qq.ecart);
8961 *
sizeof(
unsigned long));
8965 *
sizeof(
unsigned long));
8993 strat->
Shdl->m=strat->
S;
9000 if (atS <= strat->sl)
9002#ifdef ENTER_USE_MEMMOVE
9003 memmove(&(strat->
S[atS+1]), &(strat->
S[atS]),
9004 (strat->
sl - atS + 1)*
sizeof(poly));
9005 memmove(&(strat->
sig[atS+1]), &(strat->
sig[atS]),
9006 (strat->
sl - atS + 1)*
sizeof(poly));
9007 memmove(&(strat->
sevSig[atS+1]), &(strat->
sevSig[atS]),
9008 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9009 memmove(&(strat->
ecartS[atS+1]), &(strat->
ecartS[atS]),
9010 (strat->
sl - atS + 1)*
sizeof(
int));
9011 memmove(&(strat->
sevS[atS+1]), &(strat->
sevS[atS]),
9012 (strat->
sl - atS + 1)*
sizeof(
unsigned long));
9013 memmove(&(strat->
S_2_R[atS+1]), &(strat->
S_2_R[atS]),
9014 (strat->
sl - atS + 1)*
sizeof(
int));
9016 memmove(&(strat->
lenS[atS+1]), &(strat->
lenS[atS]),
9017 (strat->
sl - atS + 1)*
sizeof(
int));
9019 memmove(&(strat->
lenSw[atS+1]), &(strat->
lenSw[atS]),
9022 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9024 strat->
S[
i] = strat->
S[
i-1];
9032 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9035 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9041#ifdef ENTER_USE_MEMMOVE
9042 memmove(&(strat->
fromQ[atS+1]), &(strat->
fromQ[atS]),
9043 (strat->
sl - atS + 1)*
sizeof(
int));
9045 for (
i=strat->
sl+1;
i>=atS+1;
i--)
9050 strat->
fromQ[atS]=0;
9054 strat->
S[atS] =
p.p;
9055 strat->
sig[atS] =
p.sig;
9061 strat->
sevS[atS] =
p.sev;
9071 strat->
sevSig[atS] =
p.sevSig;
9074 strat->
S_2_R[atS] = atR;
9078 Print(
"--- LIST S: %d ---\n",strat->
sl);
9079 for(
k=0;
k<=strat->
sl;
k++)
9083 PrintS(
"--- LIST S END ---\n");
9109 else strat->
P.sev=0;
9117 poly tp = strat->
T[tj].p;
9122 for (
j = 0;
j <= strat->
sl; ++
j)
9136 pos =
posInS(strat, strat->
sl,
p.p,
p.ecart);
9142 for (
i = 0;
i <= strat->
Ll; ++
i)
9166 strat->
enterS(
p, pos, strat, strat->
tl);
9205 for(
i=strat->
tl;
i>=0;
i--)
9207 if (
p.p==strat->
T[
i].p)
9209 printf(
"already in T at pos %d of %d, atT=%d\n",
i,strat->
tl,atT);
9215#ifdef HAVE_TAIL_RING
9218 p.t_p=
p.GetLmTailRing();
9224 if (strat->
tl == strat->
tmax-1)
9226 if (atT <= strat->tl)
9228#ifdef ENTER_USE_MEMMOVE
9229 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9231 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9232 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9234 for (
i=strat->
tl+1;
i>=atT+1;
i--)
9236#ifndef ENTER_USE_MEMMOVE
9237 strat->
T[
i] = strat->
T[
i-1];
9240 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9248 if (!(
currRing->isLPring &&
p.shift > 0))
9264 strat->
T[atT].max_exp =
NULL;
9267 strat->
R[strat->
tl] = &(strat->
T[atT]);
9268 strat->
T[atT].i_r = strat->
tl;
9293 for(
i=strat->
tl;
i>=0;
i--)
9295 if (
p.p==strat->
T[
i].p)
9297 printf(
"already in T at pos %d of %d, atT=%d\n",
i,strat->
tl,atT);
9303#ifdef HAVE_TAIL_RING
9306 p.t_p=
p.GetLmTailRing();
9312 if (strat->
tl == strat->
tmax-1)
9314 if (atT <= strat->tl)
9316#ifdef ENTER_USE_MEMMOVE
9317 memmove(&(strat->
T[atT+1]), &(strat->
T[atT]),
9319 memmove(&(strat->
sevT[atT+1]), &(strat->
sevT[atT]),
9320 (strat->
tl-atT+1)*
sizeof(
unsigned long));
9322 for (
i=strat->
tl+1;
i>=atT+1;
i--)
9324#ifndef ENTER_USE_MEMMOVE
9325 strat->
T[
i] = strat->
T[
i-1];
9328 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9346 strat->
T[atT].max_exp =
NULL;
9349 strat->
R[strat->
tl] = &(strat->
T[atT]);
9350 strat->
T[atT].i_r = strat->
tl;
9357 for(
i=strat->
tl;
i>=0;
i--)
9388 (strat->
syzmax)*
sizeof(
unsigned long),
9390 *
sizeof(
unsigned long));
9393 if (atT < strat->syzl)
9395#ifdef ENTER_USE_MEMMOVE
9396 memmove(&(strat->
syz[atT+1]), &(strat->
syz[atT]),
9397 (strat->
syzl-atT+1)*
sizeof(poly));
9398 memmove(&(strat->
sevSyz[atT+1]), &(strat->
sevSyz[atT]),
9399 (strat->
syzl-atT+1)*
sizeof(
unsigned long));
9401 for (
i=strat->
syzl;
i>=atT+1;
i--)
9403#ifndef ENTER_USE_MEMMOVE
9416 strat->
syz[atT] =
p.sig;
9417 strat->
sevSyz[atT] =
p.sevSig;
9420 Print(
"element in strat->syz: %d--%d ",atT+1,strat->
syzmax);
9430 strat->
L[cc].sig, ~strat->
L[cc].sevSig,
currRing)
9444 PrintS(
"--- Syzygies ---\n");
9447 PrintS(
"--------------------------------\n");
9453 PrintS(
"--------------------------------\n");
9535 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9536 else PrintS(
"ideal/module is not homogeneous\n");
9606 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9607 else PrintS(
"ideal/module is not homogeneous\n");
10146 if ((r->m[
l]!=
NULL)
10153 if ((
Q->m[q]!=
NULL)
10177 if ((r->m[
l]!=
NULL)
10184 if ((
Q->m[q]!=
NULL)
10228 reduction_found=
TRUE;
10259 reduction_found=
TRUE;
10273 if ( reduction_found)
10363 for (
i=strat->
sl;
i>=low;
i--)
10365 int end_pos=strat->
sl;
10367 if (strat->
ak==0) end_pos=
i-1;
10369 if ((T_j !=
NULL)&&(T_j->p==strat->
S[
i]))
10387 Print(
"to (tailR) S[%d]:",
i);
10399 T_j->max_exp =
NULL;
10402 T_j->pCleardenom();
10442 Print(
"to (-tailR) S[%d]:",
i);
10539 assume(L->i_r1 >= -1 && L->i_r1 <= strat->
tl);
10540 assume(L->i_r2 >= -1 && L->i_r2 <= strat->
tl);
10545 if ((L->i_r1 == -1) || (L->i_r2 == -1) )
10550 if ((L->i_r1>=0)&&(strat->
R[L->i_r1]!=
NULL)) p1_max = (strat->
R[L->i_r1])->max_exp;
10552 if ((L->i_r2>=0)&&(strat->
R[L->i_r2]!=
NULL)) p2_max = (strat->
R[L->i_r2])->max_exp;
10578 poly p1_max = (strat->
R[atR])->max_exp;
10579 poly p2_max = (strat->
R[strat->
S_2_R[atS]])->max_exp;
10600 ideal F =
idCopy(Forig);
10604 ideal monred =
idInit(1,1);
10611 if((posconst != -1) && (!
nIsZero(F->m[posconst]->coef)))
10621 for(
int i=0;
i<idelemQ;
i++)
10629 if((posconst != -1) && (!
nIsZero(monred->m[posconst]->coef)))
10631 pmon =
pCopy(monred->m[posconst]);
10646 II->m[
j++] =
prMapR(F->m[
i], nMap, origR, QQ_ring);
10648 II->m[
j++] =
prMapR(
Q->m[
i], nMap, origR, QQ_ring);
10655 if(II->m[
i] !=
NULL)
10656 II->m[
i+1] = II->m[
i];
10659 poly integer =
NULL;
10667 integer =
pHead(syz->m[
i]);
10674 pmon =
prMapR(integer, nMap2, QQ_ring, origR);
10688 poly mindegmon =
NULL;
10693 if(mindegmon ==
NULL)
10694 mindegmon =
pCopy(one->m[
i]);
10697 if(
p_Deg(one->m[
i], QQ_ring) <
p_Deg(mindegmon, QQ_ring))
10698 mindegmon =
pCopy(one->m[
i]);
10702 if(mindegmon !=
NULL)
10705 if(II->m[
i] !=
NULL)
10706 II->m[
i+1] = II->m[
i];
10707 II->m[0] =
pCopy(mindegmon);
10736 pmon =
prMapR(mindegmon, nMap2, QQ_ring, origR);
10767 poly pH =
h->GetP();
10771 for(
int i = 0;
i<=strat->
sl;
i++)
10781#ifdef HAVE_SHIFTBBA
10806#ifdef HAVE_SHIFTBBA
10834 h->SetLmCurrRing();
10835 if((deleted)&&(
h->p!=
NULL))
10843 poly hSig =
h->sig;
10844 poly pH =
h->GetP();
10848 for(
int i = 0;
i<=strat->
sl;
i++)
10859 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
10886 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
10917 h->SetLmCurrRing();
11027 if (expbound == 0) expbound = strat->
tailRing->bitmask << 1;
11044 new_tailRing->pFDeg =
currRing->pFDeg;
11045 new_tailRing->pLDeg =
currRing->pLDeg;
11049 Print(
"[%lu:%d", (
unsigned long) new_tailRing->bitmask, new_tailRing->ExpL_Size);
11058 for (
i=0;
i<=strat->
tl;
i++)
11060 strat->
T[
i].ShallowCopyDelete(new_tailRing, new_tailBin,
11061 p_shallow_copy_delete);
11063 for (
i=0;
i<=strat->
Ll;
i++)
11067 strat->
L[
i].ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11069 if ((strat->
P.t_p !=
NULL) ||
11071 strat->
P.ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11073 if ((L !=
NULL) && (L->tailRing != new_tailRing))
11076 L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11082 L->tailRing = new_tailRing;
11085 L->max_exp = t_l->max_exp;
11089 if ((
T !=
NULL) && (
T->tailRing != new_tailRing &&
T->i_r < 0))
11090 T->ShallowCopyDelete(new_tailRing, new_tailBin, p_shallow_copy_delete);
11097 strat->
tailBin = new_tailBin;
11116 unsigned long l = 0;
11122 for (
i=0;
i<= strat->
Ll;
i++)
11126 for (
i=0;
i<=strat->
tl;
i++)
11154 res->block0 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11155 res->block1 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11156 int **wvhdl = (
int **)
omAlloc0((n+1)*
sizeof(
int*));
11157 res->wvhdl = wvhdl;
11158 for (
int i=1;
i<n;
i++)
11160 res->order[
i] = r->order[
i-1];
11161 res->block0[
i] = r->block0[
i-1];
11162 res->block1[
i] = r->block1[
i-1];
11163 res->wvhdl[
i] = r->wvhdl[
i-1];
11183 WarnS(
"error in nc_rComplete");
11202 res->block0 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11203 res->block1 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11204 int **wvhdl = (
int **)
omAlloc0((n+2)*
sizeof(
int*));
11205 res->wvhdl = wvhdl;
11206 for (
int i=2;
i<n+2;
i++)
11208 res->order[
i] = r->order[
i-2];
11209 res->block0[
i] = r->block0[
i-2];
11210 res->block1[
i] = r->block1[
i-2];
11211 res->wvhdl[
i] = r->wvhdl[
i-2];
11216 res->block0[0] = 1;
11218 for (
int i=0;
i<
res->N; ++
i)
11219 res->wvhdl[0][
i] = 1;
11239 WarnS(
"error in nc_rComplete");
11376#ifdef HAVE_TAIL_BIN
11401Timings
for the different possibilities of posInT:
11402 T15 EDL DL EL L 1-2-3
11403Gonnet 43.26 42.30 38.34 41.98 38.40 100.04
11404Hairer_2_1 1.11 1.15 1.04 1.22 1.08 4.7
11405Twomat3 1.62 1.69 1.70 1.65 1.54 11.32
11406ahml 4.48 4.03 4.03 4.38 4.96 26.50
11407c7 15.02 13.98 15.16 13.24 17.31 47.89
11408c8 505.09 407.46 852.76 413.21 499.19 n/a
11409f855 12.65 9.27 14.97 8.78 14.23 33.12
11410gametwo6 11.47 11.35 14.57 11.20 12.02 35.07
11411gerhard_3 2.73 2.83 2.93 2.64 3.12 6.24
11412ilias13 22.89 22.46 24.62 20.60 23.34 53.86
11413noon8 40.68 37.02 37.99 36.82 35.59 877.16
11414rcyclic_19 48.22 42.29 43.99 45.35 51.51 204.29
11415rkat9 82.37 79.46 77.20 77.63 82.54 267.92
11416schwarz_11 16.46 16.81 16.76 16.81 16.72 35.56
11417test016 16.39 14.17 14.40 13.50 14.26 34.07
11418test017 34.70 36.01 33.16 35.48 32.75 71.45
11419test042 10.76 10.99 10.27 11.57 10.45 23.04
11420test058 6.78 6.75 6.51 6.95 6.22 9.47
11421test066 10.71 10.94 10.76 10.61 10.56 19.06
11422test073 10.75 11.11 10.17 10.79 8.63 58.10
11423test086 12.23 11.81 12.88 12.24 13.37 66.68
11424test103 5.05 4.80 5.47 4.64 4.89 11.90
11425test154 12.96 11.64 13.51 12.46 14.61 36.35
11426test162 65.27 64.01 67.35 59.79 67.54 196.46
11427test164 7.50 6.50 7.68 6.70 7.96 17.13
11428virasoro 3.39 3.50 3.35 3.47 3.70 7.66
11438 if (
length==-1)
return 0;
11441 int op=
p.GetpFDeg();
11442 int ol =
p.GetpLength();
11444 if (set[
length].ecart < o)
11446 if (set[
length].ecart == o)
11448 int oo=set[
length].GetpFDeg();
11449 if ((oo < op) || ((oo==op) && (set[
length].
length < ol)))
11460 if (set[an].ecart > o)
11462 if (set[an].ecart == o)
11464 int oo=set[an].GetpFDeg();
11466 || ((oo==op) && (set[an].
pLength > ol)))
11472 if (set[
i].ecart > o)
11474 else if (set[
i].ecart == o)
11476 int oo=set[
i].GetpFDeg();
11478 || ((oo == op) && (set[
i].
pLength > ol)))
11492 if (
length==-1)
return 0;
11494 int op=
p.GetpFDeg();
11495 int ol =
p.GetpLength();
11497 int oo=set[
length].GetpFDeg();
11498 if ((oo < op) || ((oo==op) && (set[
length].
length < ol)))
11508 int oo=set[an].GetpFDeg();
11510 || ((oo==op) && (set[an].
pLength > ol)))
11515 int oo=set[
i].GetpFDeg();
11517 || ((oo == op) && (set[
i].
pLength > ol)))
11528 int ol =
p.GetpLength();
11542 if (set[an].
pLength>ol)
return an;
11564 else if (strat->
red==
redHoney) printf(
"redHoney\n");
11565 else if (strat->
red==
redEcart) printf(
"redEcart\n");
11566 else if (strat->
red==
redHomog) printf(
"redHomog\n");
11567 else if (strat->
red==
redLazy) printf(
"redLazy\n");
11569 else printf(
"%p\n",(
void*)strat->
red);
11570 printf(
"posInT: ");
11588#ifdef HAVE_MORE_POS_IN_T
11594 else printf(
"%p\n",(
void*)strat->
posInT);
11595 printf(
"posInL: ");
11614 else printf(
"%p\n",(
void*)strat->
posInL);
11615 printf(
"enterS: ");
11619 else printf(
"%p\n",(
void*)strat->
enterS);
11620 printf(
"initEcart: ");
11623 else printf(
"%p\n",(
void*)strat->
initEcart);
11624 printf(
"initEcartPair: ");
11628 printf(
"homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
11630 printf(
"honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
11632 printf(
"chainCrit: ");
11635 else printf(
"%p\n",(
void*)strat->
chainCrit);
11636 printf(
"posInLDependsOnLength=%d\n",
11652 else printf(
"? (%lx)", (
long)
currRing->pLDeg);
11666 else printf(
"? (%lx)", (
long)strat->
tailRing->pLDeg);
11668 printf(
"currRing->pFDeg: ");
11675 else printf(
"? (%lx)", (
long)
currRing->pFDeg);
11683 printf(
"ecartWeights: ");
11705#ifdef HAVE_SHIFTBBA
11710 assume(ifromS <= strat->sl);
11809 PrintS(
"\n--- create strong gcd poly: ");
11812 Print(
"\n q (strat->S[%d]): ", ifromS);
11818 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);
11840 h.i_r1 = -1;
h.i_r2 = -1;
11847 if (atR >= 0 && shiftcount == 0 && ifromS >= 0)
11860 posx = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
11874#ifdef HAVE_SHIFTBBA
11901 int j,compare,compareCoeff;
11905 h.ecart=0;
h.length=0;
11937 for(
j = strat->
Bl;
j>=0;
j--)
11946 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qisFromQ==0))
11961 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qisFromQ==0))
11974 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qisFromQ==0))
12078 h.i_r1 = -1;
h.i_r2 = -1;
12087 if (atR >= 0 && shiftcount == 0 && ifromS >= 0)
12102 posx = strat->
posInL(strat->
B,strat->
Bl,&
h,strat);
12117#ifdef HAVE_SHIFTBBA
12127#ifdef HAVE_SHIFTBBA
12132 assume(q_inS < 0 || strat->S[q_inS] == q);
12142 if (strat->
fromQ !=
NULL && q_inS >= 0)
12143 q_isFromQ = strat->
fromQ[q_inS];
12145 BOOLEAN (*enterPair)(poly, poly, int, int,
kStrategy, int, int, int, int, int);
12154 int neededShift = p_lastVblock - ((
pGetComp(
p) > 0 ||
pGetComp(q) > 0) ? 0 : 1);
12155 int maxPossibleShift =
degbound - q_lastVblock;
12156 int maxShift =
si_min(neededShift, maxPossibleShift);
12157 int firstShift = (q ==
p ? 1 : 0);
12159 for (
int j = firstShift;
j <= maxShift;
j++)
12162 if (enterPair(qq,
p, ecartp, p_isFromQ, strat, -1, ecartq, q_isFromQ,
j, q_inS))
12175 for (
int j = p_lastVblock;
j <= maxPossibleShift;
j++)
12181 enterPair(qq,
p, ecartp, p_isFromQ, strat, -1, ecartq, q_isFromQ, p_lastVblock, q_inS);
12187 return delete_pair;
12191#ifdef HAVE_SHIFTBBA
12197 assume(p_inS < 0 || strat->S[p_inS] ==
p);
12206 if (strat->
fromQ !=
NULL && p_inS >= 0)
12207 p_isFromQ = strat->
fromQ[p_inS];
12212 assume(q_shift <= p_lastVblock);
12219 return enterOnePairShift(q,
p, ecartp, p_isFromQ, strat, -1, ecartq, q_isFromQ, q_shift, -1);
12233#ifdef HAVE_SHIFTBBA
12236#ifdef CRITERION_DEBUG
12241 poly lmq =
pHead(q);
12262 int qfromQ = qisFromQ;
12271 Lp.ecart=0; Lp.length=0;
12281#ifdef CRITERION_DEBUG
12289 if((!((ecartq>0)&&(ecart>0)))
12308#ifdef CRITERION_DEBUG
12314 Lp.ecart =
si_max(ecart,ecartq);
12315 if (strat->
fromT && (ecartq>ecart))
12318#ifdef CRITERION_DEBUG
12340 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12343#ifdef CRITERION_DEBUG
12346 Print(
"--- chain crit using B[%d].lcm=%s\n",
j,
pString(strat->
B[
j].lcm));
12357#ifdef CRITERION_DEBUG
12360 Print(
"--- chain crit using pair to remove B[%d].lcm=%s\n",
j,
pString(strat->
B[
j].lcm));
12393#ifdef CRITERION_DEBUG
12398 if (strat->
fromT && (ecartq>ecart))
12401#ifdef CRITERION_DEBUG
12413 for(
j = strat->
Bl;
j>=0;
j--)
12419 if ((strat->
fromQ==
NULL) || (isFromQ==0) || (qfromQ==0))
12422#ifdef CRITERION_DEBUG
12425 Print(
"--- chain crit using B[%d].lcm=%s\n",
j,
pString(strat->
B[
j].lcm));
12435#ifdef CRITERION_DEBUG
12438 Print(
"--- chain crit using pair to remove B[%d].lcm=%s\n",
j,
pString(strat->
B[
j].lcm));
12455#ifdef CRITERION_DEBUG
12460 if ((strat->
fromQ!=
NULL) && (isFromQ!=0) && (qfromQ!=0))
12463#ifdef CRITERION_DEBUG
12522#ifdef CRITERION_DEBUG
12539 if ( (atR >= 0) && (shiftcount==0) && (ifromS >=0) )
12556 && (Lp.p->coef!=
NULL))
12560 l = strat->
posInL(strat->
B,strat->
Bl,&Lp,strat);
12562#ifdef CRITERION_DEBUG
12575#ifdef HAVE_SHIFTBBA
12581 if (h_lastVblock == 0)
return;
12592 int maxShift =
degbound - h_lastVblock;
12601 for (
i=0;
i<=maxShift;
i++)
12605 for (
j=0;
j<=
k;
j++)
12610 poly
s = strat->
S[
j];
12621 for (
j=0;
j<=
k;
j++)
12623 poly
s = strat->
S[
j];
12638 else if ((isFromQ)&&(strat->
fromQ!=
NULL))
12641 for (
j=0;
j<=
k;
j++)
12646 poly
s = strat->
S[
j];
12653 for (
i=1;
i<=maxShift;
i++)
12657 for (
j=0;
j<=
k;
j++)
12661 poly
s = strat->
S[
j];
12663 if (
i < s_lastVblock || (
pGetComp(
s) > 0 &&
i == s_lastVblock))
12691 for (
j=0;
j<=
k;
j++)
12693 poly
s = strat->
S[
j];
12697 for (
i=1;
i<=maxShift;
i++)
12701 for (
j=0;
j<=
k;
j++)
12703 poly
s = strat->
S[
j];
12705 if (
i < s_lastVblock || (
pGetComp(
s) > 0 &&
i == s_lastVblock))
12722 if (
i < h_lastVblock)
12748 for (
j=0;
j<=
k;
j++)
12753 poly
s = strat->
S[
j];
12770 for (
j=0;
j<=
k;
j++)
12775 poly
s = strat->
S[
j];
12780 for (
i=1;
i<=maxShift;
i++)
12783 for (
j=0;
j<=
k;
j++)
12788 poly
s = strat->
S[
j];
12790 if (
i <= s_lastVblock)
12807 if (
i <= h_lastVblock)
12843#ifdef HAVE_SHIFTBBA
12849 if (h_lastVblock == 0)
return;
12860 int maxShift =
degbound - h_lastVblock;
12869 for (
i=0;
i<=maxShift;
i++)
12872 for (
j=0;
j<=
k;
j++)
12877 poly
s = strat->
S[
j];
12886 for (
j=0;
j<=
k;
j++)
12888 poly
s = strat->
S[
j];
12903 else if ((isFromQ)&&(strat->
fromQ!=
NULL))
12906 for (
j=0;
j<=
k;
j++)
12911 poly
s = strat->
S[
j];
12918 for (
i=1;
i<=maxShift;
i++)
12921 for (
j=0;
j<=
k;
j++)
12925 poly
s = strat->
S[
j];
12936 for (
j=0;
j<=
k;
j++)
12938 poly
s = strat->
S[
j];
12943 for (
i=1;
i<=maxShift;
i++)
12947 for (
j=0;
j<=
k;
j++)
12949 poly
s = strat->
S[
j];
12964 for (
j=0;
j<=
k;
j++)
12970 poly
s = strat->
S[
j];
12987 for (
j=0;
j<=
k;
j++)
12992 poly
s = strat->
S[
j];
12997 for (
i=1;
i<=maxShift;
i++)
13000 for (
j=0;
j<=
k;
j++)
13005 poly
s = strat->
S[
j];
13027#ifdef HAVE_SHIFTBBA
13036 if ( (!strat->
fromT)
13057#ifdef HAVE_SHIFTBBA
13068 for (
int i = 1;
i <= maxPossibleShift;
i++)
13080#ifdef HAVE_SHIFTBBA
13087 p =
h = L->GetLmTailRing();
13089 return L->GetLmCurrRing();
13096 Ln.pLength = L->GetpLength() - 1;
13104 while(!Ln.IsNull())
13108 Ln.SetShortExpVector();
13114 With = &(strat->
T[
j]);
13119 if (With ==
NULL)
break;
13135 pNext(
h) = Ln.LmExtractAndIter();
13138 }
while (!Ln.IsNull());
13141 if (Ln.IsNull())
goto all_done;
13142 if (! withT) With_s.Init(
currRing);
13144 pNext(
h) = Ln.LmExtractAndIter();
13159 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) system(sys)
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)
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 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)
void initHilbCrit(ideal, ideal, intvec **hilb, 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)
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 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)
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)
#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)