22 #define EXT_POLY_NEW 0 52 #define ENTER_USE_MEMMOVE 92 #ifdef ENTER_USE_MYMEMMOVE 93 inline void _my_memmove_d_gt_s(
unsigned long* d,
unsigned long*
s,
long l)
95 register unsigned long* _dl = (
unsigned long*) d;
96 register unsigned long* _sl = (
unsigned long*)
s;
97 register long _i =
l - 1;
107 inline void _my_memmove_d_lt_s(
unsigned long* d,
unsigned long*
s,
long l)
109 register long _ll =
l;
110 register unsigned long* _dl = (
unsigned long*) d;
111 register unsigned long* _sl = (
unsigned long*)
s;
112 register long _i = 0;
122 inline void _my_memmove(
void* d,
void*
s,
long l)
124 unsigned long _d = (
unsigned long) d;
125 unsigned long _s = (
unsigned long)
s;
126 unsigned long _l = ((
l) + SIZEOF_LONG - 1) >> LOG_SIZEOF_LONG;
128 if (_d > _s) _my_memmove_d_gt_s(_d, _s, _l);
129 else _my_memmove_d_lt_s(_d, _s, _l);
133 #define memmove(d,s,l) _my_memmove(d, s, l) 140 #define pDivComp_EQUAL 2 141 #define pDivComp_LESS 1 142 #define pDivComp_GREATER -1 143 #define pDivComp_INCOMP 0 155 unsigned long la, lb;
156 unsigned long divmask =
currRing->divmask;
166 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
173 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
203 unsigned long la, lb;
204 unsigned long divmask =
currRing->divmask;
214 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
221 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
228 if (
b) {
return -1; }
249 poly p = L->GetLmTailRing();
252 if (L->bucket !=
NULL)
290 L->ecart = L->pLDeg() - L->GetpFDeg();
341 ring
r = L->tailRing;
342 poly p = L->GetLmTailRing();
347 printf(
"\n cancelunit\n");
415 printf(
"\nDoes not divide\n");
420 printf(
"\nDivides. Go On\n");
434 number eins=
nInit(1);
522 inline static unsigned long*
initsevS (
const int maxnr)
524 return (
unsigned long*)
omAlloc0(maxnr*
sizeof(
unsigned long));
528 return (
int*)
omAlloc0(maxnr*
sizeof(
int));
532 int &length,
const int incr)
537 assume((length+incr) > 0);
541 (length+incr)*
sizeof(
TObject));
543 sevT = (
unsigned long*)
omReallocSize(sevT, length*
sizeof(
long*),
544 (length+incr)*
sizeof(
long*));
547 (length+incr)*
sizeof(
TObject*));
548 for (
i=length-1;
i>=0;
i--)
R[
T[
i].i_r] = &(
T[
i]);
665 assume(((*length)+incr)>0);
668 ((*length)+incr)*
sizeof(
LObject));
688 if ((*
k) < 0)
return FALSE;
689 if (((p1 == (*p).p1) && (
p2 == (*p).p2))
690 || ((p1 == (*p).p2) && (
p2 == (*p).p1)))
709 if ((*
k) < 0)
return FALSE;
721 for (
i=0;
i<=tlength;
i++)
723 if (
T[
i].
p ==
p)
return i;
734 if (
i >= 0)
return i;
750 #define kFalseReturn(x) do { if (!x) return FALSE;} while (0) 759 return "Lm[i] different";
762 return "Lm[0] different";
764 return "Lm.next different";
766 return "Lm.coeff different";
785 if (
T->t_p ==
NULL &&
i > 0)
791 const char* msg = kTest_LmEqual(
T->p,
T->t_p,
T->tailRing);
802 if (
T->t_p !=
NULL &&
i >= 0 && TN ==
'T')
806 if (
T->max_exp !=
NULL)
807 return dReportError(
"%c[%d].max_exp is not NULL as it should be", TN,
i);
811 if (
T->max_exp ==
NULL)
835 if (
T->p ==
NULL &&
i > 0)
840 if ((
i >= 0) && (
T->pLength != 0)
845 return dReportError(
"%c[%d] pLength error: has %d, specified to have %d",
850 if (
i >= 0 && (TN ==
'T' || TN ==
'L'))
853 if (
T->FDeg !=
T->pFDeg())
857 return dReportError(
"%c[%d] FDeg error: has %d, specified to have %d",
858 TN,
i ,
T->pFDeg(), d);
863 if (
i >= 0 && TN ==
'T')
878 if (L->bucket !=
NULL)
880 kFalseReturn(
kbTest(L->bucket));
881 r_assume(L->bucket->bucket_ring == L->tailRing);
888 if (testp!=2) kFalseReturn(
kTest_T(L, strat_tailRing, lpos,
'L'));
897 return dReportError(
"L[%d] wrong sev: has %o, specified to have %o",
906 else if (tlength > 0 &&
T !=
NULL && (lpos >=0) && (testp!=2))
986 return dReportError(
"S[%d] wrong sev: has %o, specified to have %o",
1005 return dReportError(
"strat->T[%d].i_r == %d out of bounds",
i,
1024 #ifdef HAVE_SHIFTBBA 1060 #ifdef ENTER_USE_MEMMOVE 1077 #ifdef ENTER_USE_MEMMOVE 1085 #ifdef ENTER_USE_MEMMOVE 1093 #ifdef ENTER_USE_MEMMOVE 1112 #ifdef ENTER_USE_MEMMOVE 1133 #ifdef ENTER_USE_MEMMOVE 1141 #ifdef ENTER_USE_MEMMOVE 1149 #ifdef ENTER_USE_MEMMOVE 1176 if (
set[
j].sig!=
NULL)
1208 if (*length > 0 &&
j < *length)
1210 #ifdef ENTER_USE_MEMMOVE 1211 memmove(&(
set[
j]), &(
set[
j+1]), (*length -
j)*
sizeof(
LObject));
1214 for (
i=
j;
i < (*length);
i++)
1219 memset(&(
set[*length]),0,
sizeof(
LObject));
1235 if (at <= (*length))
1237 memmove(&((*
set)[at+1]), &((*set)[at]), ((*length)-at+1)*
sizeof(
LObject));
1239 for (
i=(*length)+1;
i>=at+1;
i--) (*
set)[
i] = (*set)[
i-1];
1253 h->FDeg =
h->pFDeg();
1254 h->ecart =
h->pLDeg() -
h->FDeg;
1261 h->FDeg =
h->pFDeg();
1268 Lp->FDeg = Lp->pFDeg();
1275 Lp->FDeg = Lp->pFDeg();
1276 (*Lp).ecart =
si_max(ecartF,ecartG);
1277 (*Lp).ecart = (*Lp).ecart- (Lp->FDeg -
p_FDeg((*Lp).lcm,
currRing));
1286 return (ecart1 <= ecart2);
1317 int j,compare,compareCoeff;
1321 h.ecart=0;
h.length=0;
1345 printf(
"\nChainCrit in enteronepairring\n");
1351 printf(
"\nh - neue Paar\n");
1356 printf(
"\ncompare = %i\ncompareCoeff = %i\n",compare,compareCoeff);
1366 printf(
"\nGelöscht h\n");
1377 printf(
"\nGelöscht: B[j]\n");
1387 printf(
"\nGelöscht h\n");
1403 printf(
"\nGelöscht h\n");
1414 printf(
"\nGelöscht: B[j]\n");
1496 printf(
"\nThis is afterwards:\n");
1499 h.i_r1 = -1;
h.i_r2 = -1;
1591 PrintS(
"\n--- create strong gcd poly: ");
1594 Print(
"\n strat->S[%d]: ",
i);
1618 h.i_r1 = -1;
h.i_r2 = -1;
1644 if(
h.IsNull())
return FALSE;
1696 printf(
"\nCan replace * (sig = *) with * (sig = *) since of * with sig *\n");
1708 h->i_r1 = -1;
h->i_r2 = -1;
1778 PrintS(
"\n--- create strong gcd poly: ");
1781 Print(
"\n strat->S[%d]: ",
i);
1805 if(
pLmCmp(pSigMult,sSigMult) == 0)
1814 if(
pLtCmp(pSigMult,sSigMult)==1)
1834 h.i_r1 = -1;
h.i_r2 = -1;
1840 printf(
"\nPossible sigdrop in enterpairstrongSig (due to lost of sig)\n");
1847 printf(
"\nAfter redRing reduce:\n");
pWrite(
h.p);
1853 printf(
"\nCancel the sigdrop. It reduced to 0\n");
1862 printf(
"\nSigdrop. end\n");
1880 printf(
"\nSigDrop in enteronestrongpolySig\n");
1892 printf(
"\nCancel the sigdrop after redRing (=0)\n");
1901 printf(
"\nAfter redRing still sigdrop:\n");
pWrite(
h.p);
1919 printf(
"\nnow: ");
pWrite(pairsig);
1961 Lp.ecart=0; Lp.length=0;
1966 #ifndef HAVE_RATGRING 1968 #elif defined(HAVE_RATGRING) 2246 Lp.ecart=0; Lp.length=0;
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);
2601 Lp.sevSig = ~pSigMultNegSev;
2608 Lp.sevSig = ~sSigMultNegSev;
2640 Lp.prod_crit =
TRUE;
2652 PrintS(
"SIGNATURE OF PAIR: ");
2699 printf(
"\nTrying to add p and S[%i]\n",
i);
2729 unsigned long pSigMultNegSev,sSigMultNegSev;
2733 Lp.ecart=0; Lp.length=0;
2738 #ifndef HAVE_RATGRING 2740 #elif defined(HAVE_RATGRING) 2758 printf(
"\nIn Spoly: m1, m2 :\n");
pWrite(m1);
pWrite(m2);
2779 if(pSigMult !=
NULL)
2782 if(sSigMult !=
NULL)
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);
2824 printf(
"\nPossible sigdrop in enterpairSig (due to lost of sig)\n");
2841 printf(
"\nAfter redRing reduce:\n");
pWrite(Lp.p);
2847 printf(
"\nCancel the sigdrop. It reduced to 0\n");
2856 printf(
"\nSigdrop. end\n");
2874 Lp.sig =
pCopy(pSigMult);
2910 printf(
"\nDELETED!\n");
2989 Lp.sig =
pNeg(Lp.sig);
3000 Lp.sevSig = ~pSigMultNegSev;
3007 Lp.sevSig = ~sSigMultNegSev;
3023 printf(
"\nrewCrit3 deletes it!\n");
3043 Lp.prod_crit =
TRUE;
3055 PrintS(
"SIGNATURE OF PAIR: ");
3093 printf(
"\nSigDrop in enteronepairSig\n");
pWrite(Lp.sig);
3104 printf(
"\nCancel the sigdrop after redRing (=0)\n");
3113 printf(
"\nAfter redRing still sigdrop:\n");
pWrite(Lp.p);
3124 printf(
"\nThis spair was added to B:\n");
3357 for(
i=
j-1;
i>=0;
i--)
3534 #ifdef HAVE_RATGRING 3559 Print(
"chain-crit-part: S[%d]=",
j);
3561 Print(
" divide B[%d].lcm=",
i);
3593 PrintS(
"chain-crit-part: pCompareChainPart p=");
3595 Print(
" delete L[%d]",
j);
3624 Print(
"chain-crit-part: sugar B[%d].lcm=",
j);
3626 Print(
" delete B[%d]",
i);
3637 Print(
"chain-crit-part: sugar B[%d].lcm=",
i);
3639 Print(
" delete B[%d]",
j);
3667 PrintS(
"chain-crit-part: sugar:pCompareChainPart p=");
3669 Print(
" delete L[%d]",
j);
3687 for(
i=
j-1;
i>=0;
i--)
3693 Print(
"chain-crit-part: equal lcm B[%d].lcm=",
j);
3695 Print(
" delete B[%d]\n",
i);
3720 PrintS(
"chain-crit-part: pCompareChainPart p=");
3722 Print(
" delete L[%d]",
j);
3784 PrintS(
"chain-crit-part: divisible_by p=");
3786 Print(
" delete L[%d]",
l);
3797 PrintS(
"chain-crit-part: divisible_by(2) p=");
3799 Print(
" delete L[%d]",
i);
3838 for (
j=0;
j<=
k;
j++)
3851 for (
j=0;
j<=
k;
j++)
3854 PrintS(
"\n Trying to add spoly : \n");
3865 for (
j=0;
j<=
k;
j++)
3878 #ifdef HAVE_RATGRING 3908 for (
j=0;
j<=
k;
j++)
3921 for (
j=0;
j<=
k;
j++)
3930 for (
j=0;
j<=
k;
j++)
3944 #ifdef HAVE_RATGRING 4001 #ifdef HAVE_RATGRING 4040 PrintS(
"--- chain criterion func chainCritRing type 1\n");
4043 PrintS(
" strat->B[i].lcm:");
4053 printf(
"\nChainCrit1\n");
4078 printf(
"\nChainCrit2\n");
4088 PrintS(
"--- chain criterion func chainCritRing type 2\n");
4089 PrintS(
"strat->L[j].p:");
4138 PrintS(
"--- chain criterion func chainCritRing type 3\n");
4139 PrintS(
"strat->L[j].lcm:");
4141 PrintS(
" strat->L[i].lcm:");
4147 printf(
"\nChainCrit3\n");
4193 if (arg <= 0)
return 0;
4205 if (arg <= 0)
return 0;
4206 if (arg%2 == 1) { arg--; }
4216 #ifdef HAVE_VANIDEAL 4227 int l,
j,compare,compareCoeff;
4231 Lp.ecart=0; Lp.length=0;
4248 if (compareCoeff == 0 || compare == compareCoeff)
4266 if (compareCoeff == 1)
4273 if (compareCoeff == -1)
4316 tmp_h.SetShortExpVector();
4344 if ((*cabsind <
bound) && (*cabsind - step[1] +
add <
bound))
4353 if (
N == 1)
return 0;
4355 while (
exp[
i] == cexp[
i] &&
i <=
N)
i++;
4357 *cabsind -= cind[
i];
4360 *cabsind += cind[
i];
4363 if (
i >
N)
return 0;
4367 for (
int j =
i + 1;
j <=
N;
j++)
4369 if (step[1] > step[
j]) step[1] = step[
j];
4372 if (*cabsind - step[1] +
add >=
bound)
4375 *cabsind -= cind[
i];
4377 *cabsind += cind[
i];
4380 if (
i >
N)
return 0;
4383 }
while (step[1] != -1);
4389 for (
i = 2;
i <=
N;
i++)
4391 if (step[1] > step[
i]) step[1] = step[
i];
4417 for (
int i = 1;
i <= leadRing->N;
i++)
4423 if (cabsind < leadRing->ch)
4431 for (
int i = 1;
i <= leadRing->N;
i++)
4433 for (
long j = 1;
j <=
exp[
i];
j++)
4451 for (
int i = 1;
i <= leadRing->N;
i++)
4457 zeroPoly =
pNext(zeroPoly);
4483 if (
exp[
i] & 1 != 0)
4498 PrintS(
"-------------\npoly :");
4501 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4502 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4504 Print(
"cind : %d\n", cabsind);
4521 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4557 PrintS(
"-------------\npoly :");
4560 Print(
"cexp : (%d, %d)\n", cexp[1], cexp[2]);
4561 Print(
"cind : (%d, %d)\n", cind[1], cind[2]);
4563 Print(
"cind : %d\n", cabsind);
4581 Print(
"%d, (%d, %d), ind = (%d, %d)\n", cabsind, cexp[1], cexp[2], cind[1], cind[2]);
4589 G0->m[
IDELEMS(G0) - 1] = zeroPoly;
4608 for (
j=0;
j<=
k;
j++)
4684 PrintS(
"--- create zero spoly: ");
4766 PrintS(
"--- create zero spoly: ");
4793 printf(
"\nSigdrop in enterextended spoly\n");
pWrite(
h);
pWrite(hSig);
4799 printf(
"\nAfter redRing reduce:\n");
pWrite(Lp.p);
4805 printf(
"\nCancel the sigdrop. It reduced to 0\n");
4814 printf(
"\nSigdrop. end\n");
4904 printf(
"\n Trying to add extended spolys\n");
4909 printf(
"\n Trying to add spolys\n");
4914 printf(
"\n Trying to add gcd-polys\n");
4982 for (
j=0;
j<=
k;
j++)
4985 if ((iCompH==iCompSj)
4996 for (
j=0;
j<=
k;
j++)
4999 if ((iCompH==iCompSj)
5051 int i,
j,at,ecart, s2r;
5064 if (new_suc > at) new_suc = at;
5070 for (
j=
i;
j>=at+1;
j--)
5083 for (
j=
i;
j>=at+1;
j--)
5091 if (new_suc <= strat->sl) *suc=new_suc;
5105 if(length==-1)
return 0;
5124 || ((o==oo) && (
pLmCmp(
set[length],
p)!= cmp_int)))
5146 if (
pLmCmp(
set[length],
p)== -cmp_int)
5154 if (cmp == cmp_int)
return an;
5155 if (cmp == -cmp_int)
return en;
5161 if (cmp == cmp_int) en =
i;
5162 else if (cmp == -cmp_int) an =
i;
5171 if (
pLmCmp(
set[length],
p)== -cmp_int)
5178 if (
pLmCmp(
set[an],
p) == cmp_int)
return an;
5179 if (
pLmCmp(
set[an],
p) == -cmp_int)
return en;
5187 else if (
pLmCmp(
set[
i],
p) == -cmp_int) an=
i;
5205 if (length<0)
return 0;
5210 for(
int i = 0;
i<=length;
i++)
5219 || ((op == o) && (
pLtCmp(
set[mon],
p) == -1)))
5230 || ((op == o) && (
pLtCmp(
set[an],
p) == -1)))
5237 || ((op == o) && (
pLtCmp(
set[
i],
p) == -1)))
5249 || ((op == o) && (
pLtCmp(
set[length],
p) == -1)))
5253 for(
i=0;
i<=length;
i++)
5263 || ((op == o) && (
pLtCmp(
set[an],
p) == -1)))
5270 || ((op == o) && (
pLtCmp(
set[
i],
p) == -1)))
5282 if(end < 0 || end >=
IDELEMS(F))
5284 if (end<0)
return 0;
5291 for(
i=start;
i<end;
i++)
5305 || ((op == o) && (
pLtCmp(
set[an],
p) == -1)))
5312 || ((op == o) && (
pLtCmp(
set[
i],
p) == -1)))
5337 if (length==-1)
return 0;
5368 if (
set[length].length<
p.length)
5379 if (
set[an].length>
p.length)
return an;
5383 if (
set[
i].length>
p.length) en=
i;
5395 if (length==-1)
return 0;
5397 int o =
p.GetpFDeg();
5398 int op =
set[length].GetpFDeg();
5412 op=
set[an].GetpFDeg();
5419 op =
set[
i].GetpFDeg();
5431 if (length==-1)
return 0;
5433 int o =
p.GetpFDeg();
5434 int op =
set[length].GetpFDeg();
5448 op=
set[an].GetpFDeg();
5455 op =
set[
i].GetpFDeg();
5472 if (length==-1)
return 0;
5473 int o =
p.GetpFDeg();
5474 int op =
set[length].GetpFDeg();
5479 if ((op < o) || (
pLmCmp(
set[length].
p,
p.p)== -cmp_int))
5486 op =
set[an].GetpFDeg();
5487 if (op > o)
return an;
5488 if (op < 0)
return en;
5490 if (cmp == cmp_int)
return an;
5491 if (cmp == -cmp_int)
return en;
5496 op =
set[
i].GetpFDeg();
5498 else if (op < o) an =
i;
5502 if (cmp == cmp_int) en =
i;
5503 else if (cmp == -cmp_int) an =
i;
5549 if (length==-1)
return 0;
5551 int o =
p.GetpFDeg();
5552 int op =
set[length].GetpFDeg();
5555 || (( op == o) && (
set[length].length<
p.length))
5556 || (( op == o) && (
set[length].length ==
p.length)
5567 op =
set[an].GetpFDeg();
5569 || (( op == o) && (
set[an].length >
p.length))
5570 || (( op == o) && (
set[an].length ==
p.length)
5576 op =
set[
i].GetpFDeg();
5578 || (( op == o) && (
set[
i].length >
p.length))
5579 || (( op == o) && (
set[
i].length ==
p.length)
5591 if (length==-1)
return 0;
5593 int o =
p.GetpFDeg();
5594 int op =
set[length].GetpFDeg();
5597 || (( op == o) && (
set[length].length<
p.length))
5598 || (( op == o) && (
set[length].length ==
p.length)
5609 op =
set[an].GetpFDeg();
5611 || (( op == o) && (
set[an].length >
p.length))
5612 || (( op == o) && (
set[an].length ==
p.length)
5618 op =
set[
i].GetpFDeg();
5620 || (( op == o) && (
set[
i].length >
p.length))
5621 || (( op == o) && (
set[
i].length ==
p.length)
5637 if (length==-1)
return 0;
5639 int o =
p.GetpFDeg();
5641 if (
set[length].GetpFDeg() <= o)
5651 if (
set[an].GetpFDeg() > o)
5656 if (
set[
i].GetpFDeg() > o)
5666 int ol =
p.GetpLength();
5667 if (length==-1)
return 0;
5671 int oo=
set[length].ecart;
5672 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
5682 int oo=
set[an].ecart;
5684 || ((oo==op) && (
set[an].
pLength > ol)))
5689 int oo=
set[
i].ecart;
5691 || ((oo == op) && (
set[
i].
pLength > ol)))
5723 if (length==-1)
return 0;
5725 int o =
p.GetpFDeg() +
p.ecart;
5726 int op =
set[length].GetpFDeg()+
set[length].ecart;
5740 op =
set[an].GetpFDeg()+
set[an].ecart;
5747 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5759 if (length==-1)
return 0;
5761 int o =
p.GetpFDeg() +
p.ecart;
5762 int op =
set[length].GetpFDeg()+
set[length].ecart;
5776 op =
set[an].GetpFDeg()+
set[an].ecart;
5783 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5820 if (length==-1)
return 0;
5822 int o =
p.GetpFDeg() +
p.ecart;
5823 int op =
set[length].GetpFDeg()+
set[length].ecart;
5826 || (( op == o) && (
set[length].ecart >
p.ecart))
5827 || (( op == o) && (
set[length].ecart==
p.ecart)
5838 op =
set[an].GetpFDeg()+
set[an].ecart;
5840 || (( op == o) && (
set[an].ecart <
p.ecart))
5841 || (( op == o) && (
set[an].ecart==
p.ecart)
5847 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5849 || (( op == o) && (
set[
i].ecart <
p.ecart))
5850 || (( op == o) && (
set[
i].ecart ==
p.ecart)
5861 if (length==-1)
return 0;
5863 int o =
p.GetpFDeg() +
p.ecart;
5864 int op =
set[length].GetpFDeg()+
set[length].ecart;
5867 || (( op == o) && (
set[length].ecart >
p.ecart))
5868 || (( op == o) && (
set[length].ecart==
p.ecart)
5879 op =
set[an].GetpFDeg()+
set[an].ecart;
5881 || (( op == o) && (
set[an].ecart <
p.ecart))
5882 || (( op == o) && (
set[an].ecart==
p.ecart)
5888 op =
set[
i].GetpFDeg()+
set[
i].ecart;
5890 || (( op == o) && (
set[
i].ecart <
p.ecart))
5891 || (( op == o) && (
set[
i].ecart ==
p.ecart)
5907 if (length==-1)
return 0;
5911 int o =
p.GetpFDeg() +
p.ecart;
5918 int op =
set[length].GetpFDeg()+
set[length].ecart;
5920 || ((op == o) && (
set[length].ecart >
p.ecart))
5921 || ((op == o) && (
set[length].ecart==
p.ecart)
5937 int op =
set[an].GetpFDeg()+
set[an].ecart;
5939 || ((op == o) && (
set[an].ecart <
p.ecart))
5940 || ((op == o) && (
set[an].ecart==
p.ecart)
5951 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
5953 || ((op == o) && (
set[
i].ecart <
p.ecart))
5954 || ((op == o) && (
set[
i].ecart ==
p.ecart)
5968 if (length==-1)
return 0;
5972 int o =
p.GetpFDeg() +
p.ecart;
5979 int op =
set[length].GetpFDeg()+
set[length].ecart;
5981 || ((op == o) && (
set[length].ecart >
p.ecart))
5982 || ((op == o) && (
set[length].ecart==
p.ecart)
5998 int op =
set[an].GetpFDeg()+
set[an].ecart;
6000 || ((op == o) && (
set[an].ecart <
p.ecart))
6001 || ((op == o) && (
set[an].ecart==
p.ecart)
6012 int op =
set[
i].GetpFDeg()+
set[
i].ecart;
6014 || ((op == o) && (
set[
i].ecart <
p.ecart))
6015 || ((op == o) && (
set[
i].ecart ==
p.ecart)
6035 if (length==-1)
return 0;
6038 int op=
p.GetpFDeg();
6040 if (
set[length].ecart < o)
6042 if (
set[length].ecart == o)
6044 int oo=
set[length].GetpFDeg();
6045 if ((oo < op) || ((oo==op) && (
set[length].length <
p.length)))
6056 if (
set[an].ecart > o)
6058 if (
set[an].ecart == o)
6060 int oo=
set[an].GetpFDeg();
6062 || ((oo==op) && (
set[an].length >
p.length)))
6068 if (
set[
i].ecart > o)
6070 else if (
set[
i].ecart == o)
6072 int oo=
set[
i].GetpFDeg();
6074 || ((oo == op) && (
set[
i].length >
p.length)))
6092 if (length<0)
return 0;
6094 int d=
p->GetpFDeg();
6095 int op=
set[length].GetpFDeg();
6098 || ((op == d) && (
p->p1!=
NULL)&&(
set[length].p1==
NULL))
6109 op=
set[an].GetpFDeg();
6111 || ((op == d) && (
p->p1!=
NULL) && (
set[an].p1==
NULL))
6117 op=
set[
i].GetpFDeg();
6119 || ((op==d) && (
p->p1!=
NULL) && (
set[
i].p1==
NULL))
6135 if (length<0)
return 0;
6161 if (length<0)
return 0;
6193 if (length<0)
return 0;
6218 if (length<0)
return 0;
6219 if (
pLtCmp(
set[length].sig,
p->sig)== 1)
6232 cmp =
pLtCmp(
set[an].sig,
p->sig);
6239 if (
set[an].FDeg >
p->FDeg)
6241 if (
set[an].FDeg < p->FDeg)
6243 if (
set[an].FDeg ==
p->FDeg)
6261 if (
set[
i].FDeg >
p->FDeg)
6263 if (
set[
i].FDeg < p->FDeg)
6265 if (
set[
i].FDeg ==
p->FDeg)
6280 if (length < 0)
return 0;
6281 if (
set[length].FDeg >
p->FDeg)
6283 if (
set[length].FDeg ==
p->FDeg)
6284 if(
set[length].GetpLength() >
p->GetpLength())
6295 if (
set[an].FDeg >
p->FDeg)
6297 if(
set[an].FDeg ==
p->FDeg)
6299 if(
set[an].GetpLength() >
p->GetpLength())
6303 if(
set[an].GetpLength() ==
p->GetpLength())
6320 if (
set[
i].FDeg >
p->FDeg)
6324 if(
set[
i].FDeg ==
p->FDeg)
6326 if(
set[
i].GetpLength() >
p->GetpLength())
6330 if(
set[
i].GetpLength() ==
p->GetpLength())
6393 if (length<0)
return 0;
6395 int o =
p->GetpFDeg();
6396 int op =
set[length].GetpFDeg();
6408 op =
set[an].GetpFDeg();
6415 op =
set[
i].GetpFDeg();
6435 if (length<0)
return 0;
6437 int o =
p->GetpFDeg();
6438 int op =
set[length].GetpFDeg();
6450 op =
set[an].GetpFDeg();
6457 op =
set[
i].GetpFDeg();
6469 if (length<0)
return 0;
6470 if(start == (length +1))
return (length+1);
6471 int o =
p->GetpFDeg();
6472 int op =
set[length].GetpFDeg();
6484 op =
set[an].GetpFDeg();
6491 op =
set[
i].GetpFDeg();
6505 if (length < 0)
return 0;
6515 if (
set[an].FDeg >
p->FDeg)
6517 if (
set[an].FDeg < p->FDeg)
6519 if (
set[an].FDeg ==
p->FDeg)
6527 if (
set[an].t_p!=
NULL)
6549 if (
set[
i].FDeg >
p->FDeg)
6551 if (
set[
i].FDeg < p->FDeg)
6553 if (
set[
i].FDeg ==
p->FDeg)
6561 if (
set[
i].t_p!=
NULL)
6593 if (coeff == 0)
return -1;
6596 while (tmp % 2 == 0)
6615 if (length < 0)
return 0;
6617 int o =
p->GetpFDeg();
6618 int op =
set[length].GetpFDeg();
6620 if ((op > o) || ((op == o) && (
pLmCmp(
set[length].
p,
p->p) != -
currRing->OrdSgn)))
6629 op =
set[an].GetpFDeg();
6630 if ((op > o) || ((op == o) && (
pLmCmp(
set[an].
p,
p->p) != -
currRing->OrdSgn)))
6635 op =
set[
i].GetpFDeg();
6691 if (length<0)
return 0;
6693 int o =
p->GetpFDeg();
6694 int op =
set[length].GetpFDeg();
6697 || ((op == o) && (
set[length].length >
p->length))
6698 || ((op == o) && (
set[length].length <=
p->length)
6708 op =
set[an].GetpFDeg();
6710 || ((op == o) && (
set[an].length >
p->length))
6711 || ((op == o) && (
set[an].length <=
p->length)
6717 op =
set[
i].GetpFDeg();
6719 || ((op == o) && (
set[
i].length >
p->length))
6720 || ((op == o) && (
set[
i].length <=
p->length)
6732 if (length<0)
return 0;
6734 int o =
p->GetpFDeg();
6735 int op =
set[length].GetpFDeg();
6738 || ((op == o) && (
set[length].length >
p->length))
6739 || ((op == o) && (
set[length].length <=
p->length)
6749 op =
set[an].GetpFDeg();
6751 || ((op == o) && (
set[an].length >
p->length))
6752 || ((op == o) && (
set[an].length <=
p->length)
6758 op =
set[
i].GetpFDeg();
6760 || ((op == o) && (
set[
i].length >
p->length))
6761 || ((op == o) && (
set[
i].length <=
p->length)
6779 if (length<0)
return 0;
6781 int o =
p->GetpFDeg();
6783 if (
set[length].GetpFDeg() > o)
6793 if (
set[an].GetpFDeg() >= o)
6798 if (
set[
i].GetpFDeg() >= o)
6814 if (length<0)
return 0;
6816 int o =
p->GetpFDeg() +
p->ecart;
6817 int op =
set[length].GetpFDeg() +
set[length].ecart;
6829 op =
set[an].GetpFDeg() +
set[an].ecart;
6836 op =
set[
i].GetpFDeg() +
set[
i].ecart;
6849 if (length<0)
return 0;
6851 int o =
p->GetpFDeg() +
p->ecart;
6852 int op =
set[length].GetpFDeg() +
set[length].ecart;
6864 op =
set[an].GetpFDeg() +
set[an].ecart;
6871 op =
set[
i].GetpFDeg() +
set[
i].ecart;
6890 if (length<0)
return 0;
6892 int o =
p->GetpFDeg() +
p->ecart;
6894 if ((
set[length].GetpFDeg() +
set[length].ecart > o)
6895 || ((
set[length].GetpFDeg() +
set[length].ecart == o)
6896 && (
set[length].ecart >
p->ecart))
6897 || ((
set[length].GetpFDeg() +
set[length].ecart == o)
6898 && (
set[length].ecart ==
p->ecart)
6908 if ((
set[an].GetpFDeg() +
set[an].ecart > o)
6909 || ((
set[an].GetpFDeg() +
set[an].ecart == o)
6910 && (
set[an].ecart >
p->ecart))
6911 || ((
set[an].GetpFDeg() +
set[an].ecart == o)
6912 && (
set[an].ecart ==
p->ecart)
6918 if ((
set[
i].GetpFDeg() +
set[
i].ecart > o)
6919 || ((
set[
i].GetpFDeg() +
set[
i].ecart == o)
6920 && (
set[
i].ecart >
p->ecart))
6921 || ((
set[
i].GetpFDeg() +
set[
i].ecart == o)
6922 && (
set[
i].ecart ==
p->ecart)
6934 if (length<0)
return 0;
6936 int o =
p->GetpFDeg() +
p->ecart;
6938 if ((
set[length].GetpFDeg() +
set[length].ecart > o)
6939 || ((
set[length].GetpFDeg() +
set[length].ecart == o)
6940 && (
set[length].ecart >
p->ecart))
6941 || ((
set[length].GetpFDeg() +
set[length].ecart == o)
6942 && (
set[length].ecart ==
p->ecart)
6952 if ((
set[an].GetpFDeg() +
set[an].ecart > o)
6953 || ((
set[an].GetpFDeg() +
set[an].ecart == o)
6954 && (
set[an].ecart >
p->ecart))
6955 || ((
set[an].GetpFDeg() +
set[an].ecart == o)
6956 && (
set[an].ecart ==
p->ecart)
6962 if ((
set[
i].GetpFDeg() +
set[
i].ecart > o)
6963 || ((
set[
i].GetpFDeg() +
set[
i].ecart == o)
6964 && (
set[
i].ecart >
p->ecart))
6965 || ((
set[
i].GetpFDeg() +
set[
i].ecart == o)
6966 && (
set[
i].ecart ==
p->ecart)
6984 if (length<0)
return 0;
6989 int o =
p->GetpFDeg() +
p->ecart;
6995 if ((
set[length].GetpFDeg() +
set[length].ecart > o)
6996 || ((
set[length].GetpFDeg() +
set[length].ecart == o)
6997 && (
set[length].ecart >
p->ecart))
6998 || ((
set[length].GetpFDeg() +
set[length].ecart == o)
6999 && (
set[length].ecart ==
p->ecart)
7014 if ((
set[an].GetpFDeg() +
set[an].ecart > o)
7015 || ((
set[an].GetpFDeg() +
set[an].ecart == o)
7016 && (
set[an].ecart >
p->ecart))
7017 || ((
set[an].GetpFDeg() +
set[an].ecart == o)
7018 && (
set[an].ecart ==
p->ecart)
7029 if ((
set[
i].GetpFDeg() +
set[
i].ecart > o)
7030 || ((
set[
i].GetpFDeg() +
set[
i].ecart == o)
7031 && (
set[
i].ecart >
p->ecart))
7032 || ((
set[
i].GetpFDeg() +
set[
i].ecart == o)
7033 && (
set[
i].ecart ==
p->ecart)
7048 if (length<0)
return 0;
7053 int o =
p->GetpFDeg() +
p->ecart;
7059 if ((
set[length].GetpFDeg() +
set[length].ecart > o)
7060 || ((
set[length].GetpFDeg() +
set[length].ecart == o)
7061 && (
set[length].ecart >
p->ecart))
7062 || ((
set[length].GetpFDeg() +
set[length].ecart == o)
7063 && (
set[length].ecart ==
p->ecart)
7078 if ((
set[an].GetpFDeg() +
set[an].ecart > o)
7079 || ((
set[an].GetpFDeg() +
set[an].ecart == o)
7080 && (
set[an].ecart >
p->ecart))
7081 || ((
set[an].GetpFDeg() +
set[an].ecart == o)
7082 && (
set[an].ecart ==
p->ecart)
7093 if ((
set[
i].GetpFDeg() +
set[
i].ecart > o)
7094 || ((
set[
i].GetpFDeg() +
set[
i].ecart == o)
7095 && (
set[
i].ecart >
p->ecart))
7096 || ((
set[
i].GetpFDeg() +
set[
i].ecart == o)
7097 && (
set[
i].ecart ==
p->ecart)
7116 PrintS(
"syzygy criterion checks: ");
7156 PrintS(
"--- syzygy criterion checks: ");
7181 Print(
"checking with: %d -- ",
k);
7209 PrintS(
"rewritten criterion checks: ");
7216 PrintS(
"checking with: ");
7235 PrintS(
"ALL ELEMENTS OF S\n----------------------------------------\n");
7236 for(
int kk = 0; kk<
strat->
sl+1; kk++)
7240 PrintS(
"------------------------------\n");
7267 printf(
"\narriRewCrit\n");
7273 for (
int ii=
strat->
sl; ii>start; ii--)
7282 printf(
"\narriRewCrit deleted: sig, P.sig\n");
7298 printf(
"\narriRewCritPre\n");
7317 printf(
"\nDelete!\n");
7323 printf(
"\nDelete this one!\n");
7330 for (
int ii=
strat->
sl; ii>-1; ii--)
7341 printf(
"\nDelete this one!\n");
7362 const unsigned long not_sev = ~L->sev;
7376 if (
j > pos)
return NULL;
7377 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7384 if (!(sev[
j] & not_sev) &&
7399 if (
j > pos)
return NULL;
7400 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7407 if (!(sev[
j] & not_sev) &&
7439 if (
j > pos)
return NULL;
7441 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7450 if (! (sev[
j] & not_sev) && (ecart== LONG_MAX || ecart>=
strat->
ecartS[
j]))
7468 if (
j > pos)
return NULL;
7470 #if defined(PDEBUG) || defined(PDIV_DEBUG) 7479 if (! (sev[
j] & not_sev) && (ecart== LONG_MAX || ecart>=
strat->
ecartS[
j]))
7532 if (With ==
NULL)
break;
7548 if (hn ==
NULL)
goto all_done;
7574 #define REDTAIL_CANONICALIZE 100 7578 p =
h = L->GetLmTailRing();
7580 return L->GetLmCurrRing();
7587 Ln.pLength = L->GetpLength() - 1;
7611 Ln.SetShortExpVector();
7622 if (With ==
NULL)
break;
7649 pNext(
h) = Ln.LmExtractAndIter();
7652 }
while (!Ln.IsNull());
7655 if (Ln.IsNull())
goto all_done;
7656 if (! withT) With_s.Init(
currRing);
7658 pNext(
h) = Ln.LmExtractAndIter();
7677 return L->GetLmCurrRing();
7682 #define REDTAIL_CANONICALIZE 100 7686 p =
h = L->GetLmTailRing();
7688 return L->GetLmCurrRing();
7695 Ln.pLength = L->GetpLength() - 1;
7719 Ln.SetShortExpVector();
7730 if (With ==
NULL)
break;
7757 pNext(
h) = Ln.LmExtractAndIter();
7760 }
while (!Ln.IsNull());
7772 if (! withT) With_s.Init(
currRing);
7774 pNext(
h) = Ln.LmExtractAndIter();
7793 return L->GetLmCurrRing();
7803 p =
h = L->GetLmTailRing();
7805 return L->GetLmCurrRing();
7812 Ln.pLength = L->GetpLength() - 1;
7825 Ln.SetShortExpVector();
7827 if (With ==
NULL)
break;
7837 poly p_Ln=Ln.GetLmCurrRing();
7838 poly p_With=With->GetLmCurrRing();
7850 if (Ln.bucket!=
NULL)
7881 pNext(
h) = Ln.LmExtractAndIter();
7884 }
while (!Ln.IsNull());
7887 if (Ln.IsNull())
goto all_done;
7890 pNext(
h) = Ln.LmExtractAndIter();
7908 return L->GetLmCurrRing();
7938 if (red_result == 0)
7940 else if (red_result < 0)
7942 if ((red_result > 0) || ((
strat->
Ll % 100)==99))
7962 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
7975 if (hilbcount!=0)
Print(
"hilbert series criterion:%d\n",hilbcount);
8006 Print(
" o:%ld e:%d l:%d",
8021 Print(
" o:%ld e:%d l:%d",
8410 #if defined(DEBUGF5) || defined(DEBUGF51) 8411 PrintS(
"------------- GENERATING SYZ RULES NEW ---------------\n");
8418 while (i <= strat->sl)
8448 for (
k = 0;
k<
i;
k++)
8513 PrintS(
"Principal syzygies:\n");
8516 Print(
"ps %d\n",ps);
8517 PrintS(
"--------------------------------\n");
8527 PrintS(
"--------------------------------\n");
8655 h.is_normalized = 0;
8800 h.is_normalized = 0;
8831 while (
j <= maxIndex)
8848 if (!
pIsVector((*p).p) && ((*p).ecart != 0))
8912 while (j<=strat->sl)
8936 while (
j <= maxIndex)
8990 while (
j <= maxIndex);
9020 while (i<=strat->sl)
9128 while (i<=strat->sl)
9183 else { suc=-1;
break; }
9238 *
sizeof(
unsigned long));
9267 if (atS <= strat->sl)
9269 #ifdef ENTER_USE_MEMMOVE 9273 (
strat->
sl - atS + 1)*
sizeof(
int));
9275 (
strat->
sl - atS + 1)*
sizeof(
unsigned long));
9277 (
strat->
sl - atS + 1)*
sizeof(
int));
9280 (
strat->
sl - atS + 1)*
sizeof(
int));
9302 #ifdef ENTER_USE_MEMMOVE 9304 (
strat->
sl - atS + 1)*
sizeof(
int));
9340 *
sizeof(
unsigned long));
9344 *
sizeof(
unsigned long));
9379 if (atS <= strat->sl)
9381 #ifdef ENTER_USE_MEMMOVE 9387 (
strat->
sl - atS + 1)*
sizeof(
unsigned long));
9389 (
strat->
sl - atS + 1)*
sizeof(
int));
9391 (
strat->
sl - atS + 1)*
sizeof(
unsigned long));
9393 (
strat->
sl - atS + 1)*
sizeof(
int));
9396 (
strat->
sl - atS + 1)*
sizeof(
int));
9420 #ifdef ENTER_USE_MEMMOVE 9422 (
strat->
sl - atS + 1)*
sizeof(
int));
9462 PrintS(
"--- LIST S END ---\n");
9487 printf(
"already in T at pos %d of %d, atT=%d\n",
i,
strat->
tl,atT);
9493 #ifdef HAVE_TAIL_RING 9496 p.t_p=
p.GetLmTailRing();
9504 if (atT <= strat->tl)
9506 #ifdef ENTER_USE_MEMMOVE 9510 (
strat->
tl-atT+1)*
sizeof(
unsigned long));
9514 #ifndef ENTER_USE_MEMMOVE 9532 printf(
"\nenterT: add in position %i\n",atT);
9573 printf(
"already in T at pos %d of %d, atT=%d\n",
i,
strat->
tl,atT);
9579 #ifdef HAVE_TAIL_RING 9582 p.t_p=
p.GetLmTailRing();
9590 if (atT <= strat->tl)
9592 #ifdef ENTER_USE_MEMMOVE 9596 (
strat->
tl-atT+1)*
sizeof(
unsigned long));
9600 #ifndef ENTER_USE_MEMMOVE 9618 printf(
"\nenterT_strong: add in position %i\n",atT);
9638 printf(
"\nDas ist p:\n");
pWrite(
p.p);
9669 printf(
"\n Entersyz:\n");
pWrite(
p.sig);
9679 *
sizeof(
unsigned long));
9682 if (atT < strat->syzl)
9684 #ifdef ENTER_USE_MEMMOVE 9688 (
strat->
syzl-atT+1)*
sizeof(
unsigned long));
9692 #ifndef ENTER_USE_MEMMOVE 9736 PrintS(
"--- Syzygies ---\n");
9739 PrintS(
"--------------------------------\n");
9745 PrintS(
"--------------------------------\n");
9781 #ifdef HAVE_RATGRING 9827 else PrintS(
"ideal/module is not homogeneous\n");
9858 #ifdef HAVE_RATGRING 9898 else PrintS(
"ideal/module is not homogeneous\n");
9904 (
const LSet set,
const int length,
10426 if ((
Q->m[q]!=
NULL)
10457 if ((
Q->m[q]!=
NULL)
10501 reduction_found=
TRUE;
10532 reduction_found=
TRUE;
10546 if ( reduction_found)
10660 Print(
"to (tailR) S[%d]:",
i);
10672 T_j->max_exp =
NULL;
10675 T_j->pCleardenom();
10716 Print(
"to (-tailR) S[%d]:",
i);
10727 sloppy_max =
FALSE;
10763 if (j < strat->
HCord)
10814 if ((L->i_r1 == -1) || (L->i_r2 == -1) )
10868 ideal F =
idCopy(Forig);
10872 ideal monred =
idInit(1,1);
10879 if((posconst != -1) && (!
nIsZero(F->m[posconst]->coef)))
10889 for(
int i=0;
i<idelemQ;
i++)
10897 if((posconst != -1) && (!
nIsZero(monred->m[posconst]->coef)))
10899 pmon =
pCopy(monred->m[posconst]);
10914 II->m[
j++] =
prMapR(F->m[
i], nMap, origR, QQ_ring);
10916 II->m[
j++] =
prMapR(
Q->m[
i], nMap, origR, QQ_ring);
10923 if(II->m[
i] !=
NULL)
10924 II->m[
i+1] = II->m[
i];
10935 integer =
pHead(syz->m[
i]);
10942 pmon =
prMapR(integer, nMap2, QQ_ring, origR);
10961 if(mindegmon ==
NULL)
10962 mindegmon =
pCopy(one->m[
i]);
10965 if(
p_Deg(one->m[
i], QQ_ring) <
p_Deg(mindegmon, QQ_ring))
10966 mindegmon =
pCopy(one->m[
i]);
10970 if(mindegmon !=
NULL)
10973 if(II->m[
i] !=
NULL)
10974 II->m[
i+1] = II->m[
i];
10975 II->m[0] =
pCopy(mindegmon);
11004 pmon =
prMapR(mindegmon, nMap2, QQ_ring, origR);
11035 poly pH =
h->GetP();
11094 h->SetLmCurrRing();
11095 if((deleted)&&(
h->p!=
NULL))
11103 poly hSig =
h->sig;
11104 poly pH =
h->GetP();
11119 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
11146 if(sigMult!=
NULL &&
pLtCmp(hSig,sigMult) == 1)
11177 h->SetLmCurrRing();
11259 if (expbound == 0) expbound =
strat->
tailRing->bitmask << 1;
11276 new_tailRing->pFDeg =
currRing->pFDeg;
11277 new_tailRing->pLDeg =
currRing->pLDeg;
11281 Print(
"[%lu:%d", (
unsigned long) new_tailRing->bitmask, new_tailRing->ExpL_Size);
11292 strat->
T[
i].ShallowCopyDelete(new_tailRing, new_tailBin,
11293 p_shallow_copy_delete);
11299 strat->
L[
i].ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11303 strat->
P.ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11305 if ((L !=
NULL) && (L->tailRing != new_tailRing))
11308 L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
11314 L->tailRing = new_tailRing;
11317 L->max_exp = t_l->max_exp;
11321 if ((
T !=
NULL) && (
T->tailRing != new_tailRing &&
T->i_r < 0))
11322 T->ShallowCopyDelete(new_tailRing, new_tailBin, p_shallow_copy_delete);
11355 unsigned long l = 0;
11392 res->block0 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11393 res->block1 = (
int *)
omAlloc0((n+1)*
sizeof(int));
11394 int **wvhdl = (
int **)
omAlloc0((n+1)*
sizeof(
int*));
11395 res->wvhdl = wvhdl;
11396 for (
int i=1;
i<n;
i++)
11398 res->order[
i] =
r->order[
i-1];
11399 res->block0[
i] =
r->block0[
i-1];
11400 res->block1[
i] =
r->block1[
i-1];
11401 res->wvhdl[
i] =
r->wvhdl[
i-1];
11420 #ifndef SING_NDEBUG 11421 WarnS(
"error in nc_rComplete");
11440 res->block0 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11441 res->block1 = (
int *)
omAlloc0((n+2)*
sizeof(int));
11442 int **wvhdl = (
int **)
omAlloc0((n+2)*
sizeof(
int*));
11443 res->wvhdl = wvhdl;
11444 for (
int i=2;
i<n+2;
i++)
11446 res->order[
i] =
r->order[
i-2];
11447 res->block0[
i] =
r->block0[
i-2];
11448 res->block1[
i] =
r->block1[
i-2];
11449 res->wvhdl[
i] =
r->wvhdl[
i-2];
11454 res->block0[0] = 1;
11456 for (
int i=0;
i<
res->N; ++
i)
11457 res->wvhdl[0][
i] = 1;
11476 #ifndef SING_NDEBUG 11477 WarnS(
"error in nc_rComplete");
11614 #ifdef HAVE_TAIL_BIN 11641 Timings
for the different possibilities of posInT:
11642 T15 EDL DL EL L 1-2-3
11643 Gonnet 43.26 42.30 38.34 41.98 38.40 100.04
11644 Hairer_2_1 1.11 1.15 1.04 1.22 1.08 4.7
11645 Twomat3 1.62 1.69 1.70 1.65 1.54 11.32
11646 ahml 4.48 4.03 4.03 4.38 4.96 26.50
11647 c7 15.02 13.98 15.16 13.24 17.31 47.89
11648 c8 505.09 407.46 852.76 413.21 499.19 n/
a 11649 f855 12.65 9.27 14.97 8.78 14.23 33.12
11650 gametwo6 11.47 11.35 14.57 11.20 12.02 35.07
11651 gerhard_3 2.73 2.83 2.93 2.64 3.12 6.24
11652 ilias13 22.89 22.46 24.62 20.60 23.34 53.86
11653 noon8 40.68 37.02 37.99 36.82 35.59 877.16
11654 rcyclic_19 48.22 42.29 43.99 45.35 51.51 204.29
11655 rkat9 82.37 79.46 77.20 77.63 82.54 267.92
11656 schwarz_11 16.46 16.81 16.76 16.81 16.72 35.56
11657 test016 16.39 14.17 14.40 13.50 14.26 34.07
11658 test017 34.70 36.01 33.16 35.48 32.75 71.45
11659 test042 10.76 10.99 10.27 11.57 10.45 23.04
11660 test058 6.78 6.75 6.51 6.95 6.22 9.47
11661 test066 10.71 10.94 10.76 10.61 10.56 19.06
11662 test073 10.75 11.11 10.17 10.79 8.63 58.10
11663 test086 12.23 11.81 12.88 12.24 13.37 66.68
11664 test103 5.05 4.80 5.47 4.64 4.89 11.90
11665 test154 12.96 11.64 13.51 12.46 14.61 36.35
11666 test162 65.27 64.01 67.35 59.79 67.54 196.46
11667 test164 7.50 6.50 7.68 6.70 7.96 17.13
11668 virasoro 3.39 3.50 3.35 3.47 3.70 7.66
11678 if (length==-1)
return 0;
11681 int op=
p.GetpFDeg();
11682 int ol =
p.GetpLength();
11684 if (
set[length].ecart < o)
11686 if (
set[length].ecart == o)
11688 int oo=
set[length].GetpFDeg();
11689 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
11700 if (
set[an].ecart > o)
11702 if (
set[an].ecart == o)
11704 int oo=
set[an].GetpFDeg();
11706 || ((oo==op) && (
set[an].
pLength > ol)))
11712 if (
set[
i].ecart > o)
11714 else if (
set[
i].ecart == o)
11716 int oo=
set[
i].GetpFDeg();
11718 || ((oo == op) && (
set[
i].
pLength > ol)))
11732 if (length==-1)
return 0;
11734 int op=
p.GetpFDeg();
11735 int ol =
p.GetpLength();
11737 int oo=
set[length].GetpFDeg();
11738 if ((oo < op) || ((oo==op) && (
set[length].length < ol)))
11748 int oo=
set[an].GetpFDeg();
11750 || ((oo==op) && (
set[an].
pLength > ol)))
11755 int oo=
set[
i].GetpFDeg();
11757 || ((oo == op) && (
set[
i].
pLength > ol)))
11768 int ol =
p.GetpLength();
11771 if (
set[length].length<
p.length)
11782 if (
set[an].
pLength>ol)
return an;
11826 #ifdef HAVE_MORE_POS_IN_T 11864 PrintS(
"initEcartPair: ");
11868 Print(
"homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
11870 Print(
"honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
11876 Print(
"posInLDependsOnLength=%d\n",
11908 PrintS(
"currRing->pFDeg: ");
11923 PrintS(
"ecartWeights: ");
11930 #ifndef SING_NDEBUG 11935 #ifdef HAVE_SHIFTBBA 11949 #ifdef HAVE_SHIFTBBA 11966 #ifdef HAVE_SHIFTBBA 12058 #ifdef HAVE_SHIFTBBA 12070 memset(&
h,0,
sizeof(
h));
12087 #ifdef HAVE_SHIFTBBA 12163 #ifdef HAVE_SHIFTBBA 12215 enterOnePairShift(qq,
p, ecart, isFromQ,
strat, -1, ecartq, qfromQ, 0,
i, uptodeg, lV);
12217 for (
j=1;
j<= toInsert;
j++)
12233 enterOnePairShift(q,
p, ecart, isFromQ,
strat, -1, ecartq, qfromQ,
j,
i, uptodeg, lV);
12238 #ifdef HAVE_SHIFTBBA 12280 for (;
j<= toInsert;
j++)
12297 enterOnePairShift(q,
p, ecart, isFromQ,
strat, -1, ecartq, qfromQ,
j, -1, uptodeg, lV);
12302 #ifdef HAVE_SHIFTBBA 12306 void enterOnePairShift (
poly q,
poly p,
int ecart,
int isFromQ,
kStrategy strat,
int atR,
int ecartq,
int qisFromQ,
int shiftcount,
int ifromS,
int ,
int lV)
12330 int qfromQ = qisFromQ;
12339 Lp.ecart=0; Lp.length=0;
12345 if (!
isInV(Lp.lcm, lV))
12350 PrintS(
"V crit applied to q = ");
12365 if((!((ecartq>0)&&(ecart>0)))
12387 Lp.ecart =
si_max(ecart,ecartq);
12562 if ( (atR >= 0) && (shiftcount==0) && (ifromS >=0) )
12587 #ifdef HAVE_SHIFTBBA 12608 for (
j=0;
j<=
k;
j++)
12623 for (
j=0;
j<=
k;
j++)
12636 for (
j=0;
j<=
k;
j++)
12661 #ifdef HAVE_SHIFTBBA 12692 #ifdef HAVE_SHIFTBBA 12719 for (
i=1;
i<=toInsert;
i++)
12739 #ifdef HAVE_SHIFTBBA 12746 p =
h = L->GetLmTailRing();
12748 return L->GetLmCurrRing();
12755 Ln.pLength = L->GetpLength() - 1;
12763 while(!Ln.IsNull())
12767 Ln.SetShortExpVector();
12778 if (With ==
NULL)
break;
12794 pNext(
h) = Ln.LmExtractAndIter();
12797 }
while (!Ln.IsNull());
12800 if (Ln.IsNull())
goto all_done;
12801 if (! withT) With_s.Init(
currRing);
12803 pNext(
h) = Ln.LmExtractAndIter();
12818 return L->GetLmCurrRing();
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
#define TEST_OPT_INFREDTAIL
#define pSetmComp(p)
TODO:
void initEcartPairBba(LObject *Lp, poly, poly, int, int)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
static void enterOnePairSig(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
int getIndexRng(long coeff)
int posInL11(const LSet set, const int length, LObject *p, const kStrategy)
poly redtailBbaBound(LObject *L, int pos, kStrategy strat, int bound, BOOLEAN withT, BOOLEAN normalize)
BOOLEAN kbTest(kBucket_pt bucket)
Tests
denominator_list_s * denominator_list
int posInT_pLength(const TSet set, const int length, LObject &p)
#define omRealloc0Size(addr, o_size, size)
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
unsigned long p_GetMaxExpL(poly p, const ring r, unsigned long l_max)
return the maximal exponent of p in form of the maximal long var
static FORCE_INLINE number n_IntMod(number a, number b, const coeffs r)
for r a field, return n_Init(0,r) always: n_Div(a,b,r)*b+n_IntMod(a,b,r)==a n_IntMod(a,b,r) >=0
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
int posInSMonFirst(const kStrategy strat, const int length, const poly p)
KINLINE TObject ** initR()
const CanonicalForm int s
int posInTrg0(const TSet set, const int length, LObject &p)
void omMergeStickyBinIntoBin(omBin sticky_bin, omBin into_bin)
void initSbaPos(kStrategy strat)
poly redtail(LObject *L, int pos, kStrategy strat)
void enterOnePairShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS, int, int lV)
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
void enterSSba(LObject &p, int atS, kStrategy strat, int atR)
int posInL17(const LSet set, const int length, LObject *p, const kStrategy)
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
int itoInsert(poly p, int uptodeg, int lV, const ring r)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
int redRing(LObject *h, kStrategy strat)
void enterSMora(LObject &p, int atS, kStrategy strat, int atR=-1)
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
static FORCE_INLINE BOOLEAN n_IsUnit(number n, const coeffs r)
TRUE iff n has a multiplicative inverse in the given coeff field/ring r.
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
static CanonicalForm bound(const CFMatrix &M)
int posInT2(const TSet set, const int length, LObject &p)
long pLDeg1(poly p, int *l, const ring r)
static int p_Cmp(poly p1, poly p2, ring r)
KINLINE unsigned long * initsevT()
#define TEST_OPT_DEGBOUND
void pLcmRat(poly a, poly b, poly m, int rat_shift)
void initBuchMoraPos(kStrategy strat)
void clearSbatch(poly h, int k, int pos, kStrategy strat)
BOOLEAN(* rewCrit1)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
BOOLEAN p_LmCheckIsFromRing(poly p, ring r)
int posInL11Ring(const LSet set, const int length, LObject *p, const kStrategy)
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
int posInL11Ringls(const LSet set, const int length, LObject *p, const kStrategy)
pLDegProc pOrigLDeg_TailRing
#define idDelete(H)
delete an ideal
long pLDeg1c_Totaldegree(poly p, int *l, const ring r)
int posInLF5CRing(const LSet set, int start, const int length, LObject *p, const kStrategy)
static int * initS_2_R(const int maxnr)
#define pLtCmpOrdSgnDiffM(p, q)
void messageStat(int hilbcount, kStrategy strat)
void postReduceByMonSig(LObject *h, kStrategy strat)
static int min(int a, int b)
int posInL15Ring(const LSet set, const int length, LObject *p, const kStrategy)
static int si_min(const int a, const int b)
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly, kStrategy strat, int start=0)
long pLDeg1c(poly p, int *l, const ring r)
int posInIdealMonFirst(const ideal F, const poly p, int start, int end)
Compatiblity layer for legacy polynomial operations (over currRing)
int posInT1(const TSet set, const int length, LObject &p)
long totaldegreeWecart(poly p, ring r)
void chainCritNormal(poly p, int ecart, kStrategy strat)
void initenterpairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
KINLINE int ksReducePolyTail(LObject *PR, TObject *PW, LObject *Red)
static void enterOnePairLift(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
int posInL17Ring(const LSet set, const int length, LObject *p, const kStrategy)
int posInLrg0(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
void initBuchMora(ideal F, ideal Q, kStrategy strat)
static poly p_Mult_mm(poly p, poly m, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
static void enterOnePairManyShifts(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
static BOOLEAN rIsSyzIndexRing(const ring r)
void cancelunit1(LObject *p, int *suc, int index, kStrategy strat)
int posInL15(const LSet set, const int length, LObject *p, const kStrategy)
void initenterpairsSigRing(poly h, poly hSig, int hFrom, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
poly prMoveR(poly &p, ring src_r, ring dest_r)
void reorderS(int *suc, kStrategy strat)
static int rGetCurrSyzLimit(const ring r)
void initenterstrongPairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
static BOOLEAN p_LmExpVectorAddIsOk(const poly p1, const poly p2, const ring r)
static poly pp_Mult_nn(poly p, number n, const ring r)
int posInL13(const LSet set, const int length, LObject *p, const kStrategy)
static BOOLEAN rIsRatGRing(const ring r)
#define TEST_OPT_CONTENTSB
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
BOOLEAN posInLDependsOnLength
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
int kFindInT(poly p, TSet T, int tlength)
returns index of p in TSet, or -1 if not found
int(* posInLSba)(const LSet set, const int length, LObject *L, const kStrategy strat)
#define omFreeSize(addr, size)
int posInL110Ring(const LSet set, const int length, LObject *p, const kStrategy)
void cleanTSbaRing(kStrategy strat)
static short rVar(const ring r)
#define rVar(r) (r->N)
static int pDivComp(poly p, poly q)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
int ksCheckCoeff(number *a, number *b)
BOOLEAN sbaCheckGcdPair(LObject *h, kStrategy strat)
void initSyzRules(kStrategy strat)
int posInT15Ring(const TSet set, const int length, LObject &p)
long pLDeg0c(poly p, int *l, const ring r)
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
static unsigned long p_GetMaxExp(const unsigned long l, const ring r)
void initenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void initSL(ideal F, ideal Q, kStrategy strat)
ring rModifyRing(ring r, BOOLEAN omit_degree, BOOLEAN try_omit_comp, unsigned long exp_limit)
void scComputeHC(ideal S, ideal Q, int ak, poly &hEdge, ring tailRing)
int posInLRing(const LSet set, const int length, LObject *p, const kStrategy)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
#define pCmp(p1, p2)
pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2))) ...
void p_Lcm(const poly a, const poly b, poly m, const ring r)
static poly pp_Mult_mm(poly p, poly m, const ring r)
static BOOLEAN p_HasNotCF_Lift(poly p1, poly p2, const ring r)
p_HasNotCF for the IDLIFT case: ignore component
denominator_list DENOMINATOR_LIST
void enterpairsSpecial(poly h, int k, int ecart, int pos, kStrategy strat, int atR=-1)
poly pMove2CurrTail(poly p, kStrategy strat)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
#define pHasNotCF(p1, p2)
void initSSpecialSba(ideal F, ideal Q, ideal P, kStrategy strat)
static long p_Totaldegree(poly p, const ring r)
void deleteInS(int i, kStrategy strat)
static BOOLEAN rField_is_Domain(const ring r)
pShallowCopyDeleteProc p_shallow_copy_delete
BOOLEAN(* rewCrit3)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
ring sbaRing(kStrategy strat, const ring r, BOOLEAN, int)
poly preIntegerCheck(const ideal Forig, const ideal Q)
used for GB over ZZ: look for constant and monomial elements in the ideal background: any known const...
void initSLSba(ideal F, ideal Q, kStrategy strat)
void cancelunit(LObject *L, BOOLEAN inNF)
poly kCreateZeroPoly(long exp[], long cabsind, poly *t_p, ring leadRing, ring tailRing)
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
poly nc_CreateShortSpoly(poly p1, poly p2, const ring r)
static BOOLEAN enterOneStrongPolySig(int i, poly p, poly sig, int, int, kStrategy strat, int atR)
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
static void enterOnePairSigRing(int i, poly p, poly pSig, int, int ecart, int isFromQ, kStrategy strat, int atR=-1)
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
poly redtailBba(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
int posInLF5C(const LSet, const int, LObject *, const kStrategy strat)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
long pLDeg1_Deg(poly p, int *l, const ring r)
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR, int uptodeg, int lV)
static unsigned long * initsevS(const int maxnr)
ring rAssure_c_dp(const ring r)
int posInL17_cRing(const LSet set, const int length, LObject *p, const kStrategy)
int posInT15(const TSet set, const int length, LObject &p)
int(* red)(LObject *L, kStrategy strat)
void initBuchMoraPosRing(kStrategy strat)
int nextZeroSimplexExponent(long exp[], long ind[], long cexp[], long cind[], long *cabsind, long step[], long bound, long N)
int redHomog(LObject *h, kStrategy strat)
static void enterOnePairRing(int i, poly p, int, int isFromQ, kStrategy strat, int atR)
static poly redBba1(poly h, int maxIndex, kStrategy strat)
int(* posInT)(const TSet T, const int tl, LObject &h)
static number p_SetCoeff(poly p, number n, ring r)
void HEckeTest(poly pp, kStrategy strat)
#define omCheckBinAddrSize(addr, size)
poly p_Sub(poly p1, poly p2, const ring r)
void chainCritSig(poly p, int, kStrategy strat)
static void p_LmFree(poly p, ring)
void enterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
#define pGetComp(p)
Component.
int posInL110(const LSet set, const int length, LObject *p, const kStrategy)
#define pLtCmpOrdSgnDiffP(p, q)
int posInT0(const TSet, const int length, LObject &)
int redFirstShift(LObject *h, kStrategy strat)
static poly p_Copy(poly p, const ring r)
returns a copy of p
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
void enterExtendedSpoly(poly h, kStrategy strat)
static FORCE_INLINE number n_Ann(number a, const coeffs r)
if r is a ring with zero divisors, return an annihilator!=0 of b otherwise return NULL ...
BOOLEAN(* syzCrit)(poly sig, unsigned long not_sevSig, kStrategy strat)
char completeReduce_retry
void initenterpairsShift(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
void kStratInitChangeTailRing(kStrategy strat)
static poly redBba(poly h, int maxIndex, kStrategy strat)
int posInLSig(const LSet set, const int length, LObject *p, const kStrategy)
long pLDeg1c_Deg(poly p, int *l, const ring r)
pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring, ring)
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
BOOLEAN kPosInLDependsOnLength(int(*pos_in_l)(const LSet set, const int length, LObject *L, const kStrategy strat))
void enterT(LObject &p, kStrategy strat, int atT)
poly prMapR(poly src, nMapFunc nMap, ring src_r, ring dest_r)
int redHoney(LObject *h, kStrategy strat)
void p_Cleardenom_n(poly ph, const ring r, number &c)
poly p_LPshift(poly p, int sh, int uptodeg, int lV, const ring r)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
void updateSShift(kStrategy strat, int uptodeg, int lV)
#define pFalseReturn(cond)
BOOLEAN p_CheckPolyRing(poly p, ring r)
#define omReallocSize(addr, o_size, size)
void(* initEcart)(TObject *L)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pGetExp(p, i)
Exponent.
void(* enterOnePair)(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
void initS(ideal F, ideal Q, kStrategy strat)
void enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV)
int posInT11(const TSet set, const int length, LObject &p)
static int rBlocks(ring r)
void initSSpecial(ideal F, ideal Q, ideal P, kStrategy strat)
int posInT17_c(const TSet set, const int length, LObject &p)
long p_Deg(poly a, const ring r)
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
void chainCritRing(poly p, int, kStrategy strat)
int posInT11Ring(const TSet set, const int length, LObject &p)
KINLINE TObject * S_2_T(int i)
void kBucketDestroy(kBucket_pt *bucket_pt)
void initEcartPairMora(LObject *Lp, poly, poly, int ecartF, int ecartG)
#define TEST_OPT_INTSTRATEGY
static void p_SetCompP(poly p, int i, ring r)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define TEST_OPT_NOT_SUGAR
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ...
static void enlargeT(TSet &T, TObject **&R, unsigned long *&sevT, int &length, const int incr)
const CanonicalForm CFMap CFMap & N
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
static int max(int a, int b)
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int syzComp
BOOLEAN isInPairsetL(int length, poly p1, poly p2, int *k, kStrategy strat)
void enterExtendedSpolySig(poly h, poly hSig, kStrategy strat)
void initHilbCrit(ideal, ideal, intvec **hilb, kStrategy strat)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
void enterOnePairSpecial(int i, poly p, int ecart, kStrategy strat, int atR=-1)
long p_WFirstTotalDegree(poly p, const ring r)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
void initEcartBBA(TObject *h)
int posInT17Ring(const TSet set, const int length, LObject &p)
void messageStatSBA(int hilbcount, kStrategy strat)
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
void enterOneZeroPairRing(poly f, poly t_p, poly p, int ecart, kStrategy strat, int atR=-1)
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z:...
long pLDeg0(poly p, int *l, const ring r)
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
#define pp_Test(p, lmRing, tailRing)
BOOLEAN pCompareChain(poly p, poly p1, poly p2, poly lcm, const ring R)
Returns TRUE if.
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
long kHomModDeg(poly p, ring r)
poly pMoveCurrTail2poly(poly p, kStrategy strat)
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted ...
static long p_FDeg(const poly p, const ring r)
static int p_LmCmp(poly p, poly q, const ring r)
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject *T, unsigned long expbound)
int posInL0(const LSet set, const int length, LObject *p, const kStrategy)
#define pIsConstant(p)
like above, except that Comp might be != 0
TObject * kFindDivisibleByInS(kStrategy strat, int pos, LObject *L, TObject *T, long ecart)
void initBuchMoraCrit(kStrategy strat)
static poly p_ShallowCopyDelete(poly p, const ring r, omBin bin)
static int si_max(const int a, const int b)
int posInL17_c(const LSet set, const int length, LObject *p, const kStrategy)
static void p_ExpVectorCopy(poly d_p, poly s_p, const ring r)
void exitSba(kStrategy strat)
void rDebugPrint(const ring r)
void PrintS(const char *s)
void kDebugPrint(kStrategy strat)
Output some debug info about a given strategy.
int isInV(poly p, int lV)
void deleteHC(LObject *L, kStrategy strat, BOOLEAN fromNext)
void superenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
static void p_ExpVectorAdd(poly p1, poly p2, const ring r)
int posInT17(const TSet set, const int length, LObject &p)
static poly p_LmFreeAndNext(poly p, ring)
static unsigned pLength(poly a)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
void deleteInSSba(int i, kStrategy strat)
static FORCE_INLINE int n_DivComp(number a, number b, const coeffs r)
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static FORCE_INLINE number n_Lcm(number a, number b, const coeffs r)
in Z: return the lcm of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
omBin omGetStickyBinOfBin(omBin bin)
void initBuchMoraShift(ideal F, ideal Q, kStrategy strat)
BOOLEAN rHasMixedOrdering(const ring r)
void enterT_strong(LObject &p, kStrategy strat, int atT)
static void enlargeL(LSet *L, int *length, const int incr)
static BOOLEAN _p_LmDivisibleByPart(poly a, const ring r_a, poly b, const ring r_b, const int start, const int end)
static int index(p_Length length, p_Ord ord)
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
void rChangeCurrRing(ring r)
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether)
poly redtailBba_Z(LObject *L, int pos, kStrategy strat)
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat)
BOOLEAN arriRewCriterion(poly, unsigned long, poly, kStrategy strat, int start=0)
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
void enterSMoraNF(LObject &p, int atS, kStrategy strat, int atR=-1)
#define rRing_has_Comp(r)
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
static void p_Delete(poly *p, const ring r)
static FORCE_INLINE number n_ExtGcd(number a, number b, number *s, number *t, const coeffs r)
beware that ExtGCD is only relevant for a few chosen coeff. domains and may perform something unexpec...
unsigned long p_GetShortExpVector(const poly p, const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
poly p_LPshiftT(poly p, int sh, int uptodeg, int lV, kStrategy strat, const ring r)
void kMergeBintoLSba(kStrategy strat)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
void initenterzeropairsRing(poly p, int ecart, kStrategy strat, int atR)
poly(* pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r, omBin dest_bin)
returns a poly from dest_r which is a ShallowCopy of s_p from source_r assumes that source_r->N == de...
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int)
#define TEST_OPT_SUGARCRIT
BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat)
void(* chainCrit)(poly p, int ecart, kStrategy strat)
void initPairtest(kStrategy strat)
long pLDegb(poly p, int *l, const ring r)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void postReduceByMon(LObject *h, kStrategy strat)
used for GB over ZZ: intermediate reduction by monomial elements background: any known constant eleme...
BOOLEAN p_CheckIsFromRing(poly p, ring r)
static BOOLEAN rField_is_Ring(const ring r)
static BOOLEAN enterOneStrongPoly(int i, poly p, int, int, kStrategy strat, int atR, bool enterTstrong)
void cleanT(kStrategy strat)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
void pEnlargeSet(poly **p, int l, int increment)
long pLDeg1_Totaldegree(poly p, int *l, const ring r)
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
int redEcart(LObject *h, kStrategy strat)
#define pLtCmpOrdSgnEqP(p, q)
BOOLEAN rHasGlobalOrdering(const ring r)
void rDelete(ring r)
unconditionally deletes fields in r
long ind_fact_2(long arg)
int posInSyz(const kStrategy strat, poly sig)
int posInT110(const TSet set, const int length, LObject &p)
void pNorm(poly p, const ring R=currRing)
#define pInit()
allocates a new monomial and initializes everything to 0
#define TEST_OPT_CANCELUNIT
void initSbaCrit(kStrategy strat)
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
#define omSizeWOfBin(bin_ptr)
void updateS(BOOLEAN toT, kStrategy strat)
int posInT110Ring(const TSet set, const int length, LObject &p)
static bool rIsSCA(const ring r)
void completeReduce(kStrategy strat, BOOLEAN withT)
int posInL0Ring(const LSet set, const int length, LObject *p, const kStrategy)
#define REDTAIL_CANONICALIZE
BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat)
void chainCritOpt_1(poly, int, kStrategy strat)
void rKillModifiedRing(ring r)
long maxdegreeWecart(poly p, int *l, ring r)
static void p_Setm(poly p, const ring r)
void updateResult(ideal r, ideal Q, kStrategy strat)
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
KINLINE TObject * s_2_t(int i)
long pLDeg1_WFirstTotalDegree(poly p, int *l, const ring r)
int redFirst(LObject *h, kStrategy strat)
int posInLSpecial(const LSet set, const int length, LObject *p, const kStrategy)
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring tailRing)
static nc_type & ncRingType(nc_struct *p)
static intset initec(const int maxnr)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
static int pDivCompRing(poly p, poly q)
long pLDeg1c_WFirstTotalDegree(poly p, int *l, const ring r)
poly pCopyL2p(LObject H, kStrategy strat)
int idElem(const ideal F)
count non-zero elements
int dReportError(const char *fmt,...)
#define ALLOW_PROD_CRIT(A)
static poly p_Neg(poly p, const ring r)
static void p_LmDelete(poly p, const ring r)
BOOLEAN isInPairsetB(poly q, int *k, kStrategy strat)
static void initenterstrongPairsSig(poly h, poly hSig, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
long p_WTotaldegree(poly p, const ring r)
static poly redMora(poly h, int maxIndex, kStrategy strat)
void kMergeBintoL(kStrategy strat)
void p_wrp(poly p, ring lmRing, ring tailRing)
void p_Write(poly p, ring lmRing, ring tailRing)
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
int kFindDivisibleByInT(const kStrategy strat, const LObject *L, const int start)
return -1 if no divisor is found number of first divisor in T, otherwise
BOOLEAN newHEdge(kStrategy strat)
int posInT19(const TSet set, const int length, LObject &p)
poly redtailBbaShift(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
void initEcartNormal(TObject *h)
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r1, const ring r2)
static LSet initL(int nr=setmaxL)
static poly p_Add_q(poly p, poly q, const ring r)
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
int posInT_EcartpLength(const TSet set, const int length, LObject &p)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
KINLINE poly kNoetherTail()
static BOOLEAN sugarDivisibleBy(int ecart1, int ecart2)
poly p_Cleardenom(poly p, const ring r)
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
void chainCritPart(poly p, int ecart, kStrategy strat)
void nKillChar(coeffs r)
undo all initialisations
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static poly p_Mult_q(poly p, poly q, const ring r)
void enterOnePairSelfShifts(poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int, int uptodeg, int lV)
void exitBuchMora(kStrategy strat)
pFDegProc pOrigFDeg_TailRing
#define ENTER_USE_MEMMOVE
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
static int p_LtCmpNoAbs(poly p, poly q, const ring r)
int posInT17_cRing(const TSet set, const int length, LObject &p)
int posInT13(const TSet set, const int length, LObject &p)
void enterSyz(LObject &p, kStrategy strat, int atT)
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
BOOLEAN p_OneComp(poly p, const ring r)
return TRUE if all monoms have the same component
#define pCopy(p)
return a copy of the poly
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
void kBucket_Add_q(kBucket_pt bucket, poly q, int *l)
Add to Bucket a poly ,i.e. Bpoly == q+Bpoly
poly p_GetMaxExpP(poly p, const ring r)
return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0...
int posInLSigRing(const LSet set, const int length, LObject *p, const kStrategy)
BOOLEAN pCompareChainPart(poly p, poly p1, poly p2, poly lcm, const ring R)