47#define ENTER_USE_MEMMOVE
87#ifdef ENTER_USE_MYMEMMOVE
119 unsigned long _d = (
unsigned long) d;
120 unsigned long _s = (
unsigned long)
s;
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))
255 for (
int i=1;
i<= (
int) L->bucket->buckets_used;
i++)
257 poly
p=L->bucket->buckets[
i];
262 L->bucket->buckets[
i]=
NULL;
263 L->bucket->buckets_length[
i]=0;
272 L->bucket->buckets_length[
i]=
pLength(L->bucket->buckets[
i]);
280 int i=L->bucket->buckets_used;
281 while ((
i>0)&&(L->bucket->buckets[
i]==
NULL))
284 L->bucket->buckets_used=
i;
299 poly
p = L->GetLmTailRing();
310 if (L->bucket !=
NULL)
342 L->ecart = L->pLDeg() - L->GetpFDeg();
352 L->ecart = L->pLDeg(strat->
LDegLast) - L->GetpFDeg();
377 ring r = L->tailRing;
378 poly
p = L->GetLmTailRing();
536 return (
unsigned long*)
omAlloc0(
maxnr*
sizeof(
unsigned long));
574 for (
j=0;
j<=strat->
tl;
j++)
578 if (strat->
T[
j].max_exp !=
NULL)
588 if (strat->
T[
j].t_p !=
NULL)
596 if (
currRing->isLPring && strat->
T[
j].shift > 0)
605 if (
p == strat->
S[
i])
607 if (strat->
T[
j].t_p !=
NULL)
609 if (p_shallow_copy_delete!=
NULL)
633 for (
j=0;
j<=strat->
tl;
j++)
637 if (strat->
T[
j].max_exp !=
NULL)
647 if (strat->
T[
j].t_p !=
NULL)
659 if (
p == strat->
S[
i])
661 if (strat->
T[
j].t_p !=
NULL)
708 if ((*
k) < 0)
return FALSE;
709 if (((p1 == (*p).p1) && (p2 == (*p).p2))
710 || ((p1 == (*p).p2) && (p2 == (*p).p1)))
723 if (
T[
i].
p ==
p)
return i;
734 if (
i >= 0)
return i;
737 while (strat !=
NULL);
762 if (
i >= 0)
return i;
765 while (strat !=
NULL);
779#define kFalseReturn(x) do { if (!x) return FALSE;} while (0)
785 for (
i=1;
i<=tailRing->N;
i++)
788 return "Lm[i] different";
791 return "Lm[0] different";
793 return "Lm.next different";
795 return "Lm.coeff different";
802 ring tailRing =
T->tailRing;
827 if (
T->t_p ==
NULL &&
i > 0)
844 if (
T->t_p !=
NULL &&
i >= 0 &&
TN ==
'T')
848 if (
T->max_exp !=
NULL)
849 return dReportError(
"%c[%d].max_exp is not NULL as it should be",
TN,
i);
853 if (
T->max_exp ==
NULL)
877 if (
T->p ==
NULL &&
i > 0)
893 if ((
i >= 0) && (
T->pLength != 0)
898 return dReportError(
"%c[%d] pLength error: has %d, specified to have %d",
903 if (
i >= 0 && (
TN ==
'T' ||
TN ==
'L'))
906 if (strat->
homog && (
T->FDeg !=
T->pFDeg()))
910 return dReportError(
"%c[%d] FDeg error: has %d, specified to have %d",
911 TN,
i ,
T->pFDeg(), d);
916 if (
i >= 0 &&
TN ==
'T')
953 if (L->bucket !=
NULL)
956 r_assume(L->bucket->bucket_ring == L->tailRing);
974 return dReportError(
"L[%d] wrong sev: has %lo, specified to have %lo",
1017 -1, strat->
T, strat->
tl));
1020 if (strat->
T !=
NULL)
1022 for (
i=0;
i<=strat->
tl;
i++)
1031 if (strat->
L !=
NULL)
1033 for (
i=0;
i<=strat->
Ll;
i++)
1036 strat->
L[
i].Next() != strat->
tail,
i,
1037 strat->
T, strat->
tl));
1048 if (strat->
S !=
NULL)
1058 for (
i=0;
i<=strat->
sl;
i++)
1060 if (strat->
S[
i] !=
NULL &&
1063 return dReportError(
"S[%d] wrong sev: has %o, specified to have %o",
1079 for (
i=0;
i<=strat->
tl;
i++)
1081 if (strat->
T[
i].i_r < 0 || strat->
T[
i].i_r > strat->
tl)
1082 return dReportError(
"strat->T[%d].i_r == %d out of bounds",
i,
1084 if (strat->
R[strat->
T[
i].i_r] != &(strat->
T[
i]))
1088 if ((strat->
S !=
NULL)&&(strat->
tl>=0))
1090 for (
i=0;
i<=strat->
sl;
i++)
1095 if (strat->
S_2_R[
i] != strat->
T[
j].i_r)
1101 #ifdef HAVE_SHIFTBBA
1106 for (
i=0;
i<=strat->
Ll;
i++)
1108 if (strat->
L[
i].p1 !=
NULL && strat->
L[
i].p2)
1110 if (strat->
L[
i].i_r1 < 0 ||
1111 strat->
L[
i].i_r1 > strat->
tl ||
1112 strat->
L[
i].T_1(strat)->p != strat->
L[
i].p1)
1114 if (strat->
L[
i].i_r2 < 0 ||
1115 strat->
L[
i].i_r2 > strat->
tl ||
1116 strat->
L[
i].T_2(strat)->p != strat->
L[
i].p2)
1121 if (strat->
L[
i].i_r1 != -1)
1123 if (strat->
L[
i].i_r2 != -1)
1126 if (strat->
L[
i].i_r != -1)
1140#ifdef ENTER_USE_MEMMOVE
1141 memmove(&(strat->
S[
i]), &(strat->
S[
i+1]), (strat->
sl -
i)*
sizeof(poly));
1147 for (
j=
i;
j<strat->
sl;
j++)
1149 strat->
S[
j] = strat->
S[
j+1];
1157#ifdef ENTER_USE_MEMMOVE
1165#ifdef ENTER_USE_MEMMOVE
1173#ifdef ENTER_USE_MEMMOVE
1176 for (
j=
i;
j<strat->
sl;
j++)
1190 && (strat->
P.p1!=
NULL))
1196 for (
int i=lv;
i>0;
i--)
1220 if (set[
j].sig!=
NULL)
1252 #ifdef HAVE_SHIFTBBA
1262#ifdef ENTER_USE_MEMMOVE
1266 for (
i=
j;
i < (*length);
i++)
1288#ifdef ENTER_USE_MEMMOVE
1305 h->FDeg =
h->pFDeg();
1306 h->ecart =
h->pLDeg() -
h->FDeg;
1313 h->FDeg =
h->pFDeg();
1320 Lp->FDeg =
Lp->pFDeg();
1327 Lp->FDeg =
Lp->pFDeg();
1374 h.ecart=0;
h.length=0;
1398 for(
j = strat->
Bl;
j>=0;
j--)
1519 h.i_r1 = -1;
h.i_r2 = -1;
1540 else strat->
P.sev=0L;
1554 poly m1, m2,
gcd,
si;
1583 for (
int j = 0;
j < strat->
sl;
j++)
1589 && !(strat->
sevS[
j] & ~sev)
1632 PrintS(
"\n--- create strong gcd poly: ");
1635 Print(
"\n strat->S[%d]: ",
i);
1658 h.i_r1 = -1;
h.i_r2 = -1;
1664 h.p1 =
p;
h.p2 = strat->
S[
i];
1684 if(
h.IsNull())
return FALSE;
1701 if(strat->
sl < 0)
return FALSE;
1703 for(
i=0;
i<strat->
sl;
i++)
1739 h->i_r1 = -1;
h->i_r2 = -1;
1761 poly m1, m2,
gcd,
si;
1809 PrintS(
"\n--- create strong gcd poly: ");
1812 Print(
"\n strat->S[%d]: ",
i);
1864 h.i_r1 = -1;
h.i_r2 = -1;
1882 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1909 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1922 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
1926 h.p1 =
p;
h.p2 = strat->
S[
i];
1965#ifndef HAVE_RATGRING
1967#elif defined(HAVE_RATGRING)
1984 if((!((strat->
ecartS[
i]>0)&&(ecart>0)))
2077 for(
j = strat->
Bl;
j>=0;
j--)
2176 Lp.p1 = strat->
S[
i];
2255 if((!((strat->
ecartS[
i]>0)&&(ecart>0)))
2351 for(
j = strat->
Bl;
j>=0;
j--)
2407 Lp.p1 = strat->
S[
i];
2465#ifndef HAVE_RATGRING
2467#elif defined(HAVE_RATGRING)
2497 PrintS(
"----------------\n");
2500 PrintS(
"----------------\n");
2506 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",
sigCmp);
2638 Lp.checked = strat->
sl+1;
2657 PrintS(
"SIGNATURE OF PAIR: ");
2661 Lp.p1 = strat->
S[
i];
2740#ifndef HAVE_RATGRING
2742#elif defined(HAVE_RATGRING)
2785 Print(
"----------------\n");
2788 Print(
"----------------\n");
2813 Print(
"IN PAIR GENERATION - COMPARING SIGS: %d\n",
sigCmp);
2845 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
3017 Lp.checked = strat->
sl+1;
3036 PrintS(
"SIGNATURE OF PAIR: ");
3040 Lp.p1 = strat->
S[
i];
3087 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
3142 Lp.p1 = strat->
S[
i];
3175 int j=strat->
Ll+strat->
Bl+1;
3183 for (
i=strat->
Bl;
i>=0;
i--)
3185 j = strat->
posInL(strat->
L,
j,&(strat->
B[
i]),strat);
3196 int j=strat->
Ll+strat->
Bl+1;
3204 for (
i=strat->
Bl;
i>=0;
i--)
3231 for (
j=0;
j<=strat->
sl;
j++)
3235 for (
i=strat->
Bl;
i>=0;
i--)
3250 for (
j=0;
j<=strat->
sl;
j++)
3254 for (
i=strat->
Bl;
i>=0;
i--)
3277 for (
j=strat->
Ll;
j>=0;
j--)
3283 if (strat->
L[
j].p == strat->
tail)
3329 for (
j=strat->
Ll;
j>=0;
j--)
3349 for(
i=
j-1;
i>=0;
i--)
3368 for (
j=strat->
Ll;
j>=0;
j--)
3370 #ifdef HAVE_SHIFTBBA
3371 if ((strat->
L[
j].p1!=
NULL) &&
3404 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3407 if (strat->
L[
j].p2 ==
p)
3413 if ((strat->
L[
i].p2 ==
p) &&
pLmEqual(strat->
L[
j].lcm,strat->
L[
i].lcm))
3427 strat->
L[
i].p2 = strat->
tail;
3444 else if (strat->
L[
j].p2 == strat->
tail)
3483 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3486 if (strat->
L[
j].p2 ==
p)
3492 if ((strat->
L[
i].p2 ==
p) &&
pLmEqual(strat->
L[
j].lcm,strat->
L[
i].lcm))
3506 strat->
L[
i].p2 = strat->
tail;
3523 else if (strat->
L[
j].p2 == strat->
tail)
3544 for (
j=0;
j<=strat->
sl;
j++)
3548 for (
i=strat->
Bl;
i>=0;
i--)
3556 Print(
"chain-crit-part: S[%d]=",
j);
3558 Print(
" divide B[%d].lcm=",
i);
3580 for (
j=strat->
Ll;
j>=0;
j--)
3586 if (strat->
L[
j].p == strat->
tail)
3590 PrintS(
"chain-crit-part: pCompareChainPart p=");
3592 Print(
" delete L[%d]",
j);
3621 Print(
"chain-crit-part: sugar B[%d].lcm=",
j);
3623 Print(
" delete B[%d]",
i);
3634 Print(
"chain-crit-part: sugar B[%d].lcm=",
i);
3636 Print(
" delete B[%d]",
j);
3656 for (
j=strat->
Ll;
j>=0;
j--)
3664 PrintS(
"chain-crit-part: sugar:pCompareChainPart p=");
3666 Print(
" delete L[%d]",
j);
3684 for(
i=
j-1;
i>=0;
i--)
3690 Print(
"chain-crit-part: equal lcm B[%d].lcm=",
j);
3692 Print(
" delete B[%d]\n",
i);
3709 for (
j=strat->
Ll;
j>=0;
j--)
3717 PrintS(
"chain-crit-part: pCompareChainPart p=");
3719 Print(
" delete L[%d]",
j);
3748 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
3751 if (strat->
L[
j].p2 ==
p)
3757 if ((strat->
L[
i].p2 ==
p) &&
pLmEqual(strat->
L[
j].lcm,strat->
L[
i].lcm))
3774 strat->
L[
i].p2 = strat->
tail;
3781 PrintS(
"chain-crit-part: divisible_by p=");
3783 Print(
" delete L[%d]",
l);
3794 PrintS(
"chain-crit-part: divisible_by(2) p=");
3796 Print(
" delete L[%d]",
i);
3807 else if (strat->
L[
j].p2 == strat->
tail)
3835 for (
j=0;
j<=
k;
j++)
3848 for (
j=0;
j<=
k;
j++)
3857 for (
j=0;
j<=
k;
j++)
3870 #ifdef HAVE_RATGRING
3900 for (
j=0;
j<=
k;
j++)
3913 for (
j=0;
j<=
k;
j++)
3922 for (
j=0;
j<=
k;
j++)
4020 for (
j=0;
j<=strat->
sl;
j++)
4024 for (
i=strat->
Bl;
i>=0;
i--)
4031 PrintS(
"--- chain criterion func chainCritRing type 1\n");
4034 PrintS(
" strat->B[i].lcm:");
4039 wrp(strat->
B[
i].lcm);
4054 for (
j=strat->
Ll;
j>=0;
j--)
4067 PrintS(
"--- chain criterion func chainCritRing type 2\n");
4068 PrintS(
"strat->L[j].p:");
4099 if (strat->
L[0].p2 == strat->
tail) strat->
L[0].p2 =
p;
4102 if (strat->
L[
j].p2 ==
p)
4117 PrintS(
"--- chain criterion func chainCritRing type 3\n");
4118 PrintS(
"strat->L[j].lcm:");
4119 wrp(strat->
L[
j].lcm);
4120 PrintS(
" strat->L[i].lcm:");
4121 wrp(strat->
L[
i].lcm);
4135 strat->
L[
i].p2 = strat->
tail;
4152 else if (strat->
L[
j].p2 == strat->
tail)
4178 for (
j=0;
j<=
k;
j++)
4190 for (
j=0;
j<=
k;
j++)
4198 for (
j=0;
j<=
k;
j++)
4210 #ifdef HAVE_RATGRING
4282 PrintS(
"--- create zero spoly: ");
4366 PrintS(
"--- create zero spoly: ");
4403 strat->
enterS(strat->
P,strat->
sl+1,strat, strat->
tl+1);
4454 if ( (!strat->
fromT)
4514 if ( (!strat->
fromT)
4539 if ( (!strat->
fromT)
4564 for (
j=0;
j<=
k;
j++)
4578 for (
j=0;
j<=
k;
j++)
4641 for (;
i<=strat->
sl;
i++)
4649 sev = strat->
sevS[
i];
4654 strat->
S[
j] = strat->
S[
j-1];
4801 || ((op == o) && (
pLtCmp(set[mon],
p) == -1)))
4812 || ((op == o) && (
pLtCmp(set[
an],
p) == -1)))
4819 || ((op == o) && (
pLtCmp(set[
i],
p) == -1)))
4845 || ((op == o) && (
pLtCmp(set[
an],
p) == -1)))
4852 || ((op == o) && (
pLtCmp(set[
i],
p) == -1)))
4866 if (end<0)
return 0;
4873 for(
i=start;
i<end;
i++)
4887 || ((op == o) && (
pLtCmp(set[
an],
p) == -1)))
4894 || ((op == o) && (
pLtCmp(set[
i],
p) == -1)))
4919 if (
length==-1)
return 0;
4948 if (
length==-1)
return 0;
4976 if (
length==-1)
return 0;
4978 int o =
p.GetpFDeg();
4979 int op = set[
length].GetpFDeg();
4994 op= set[
an].GetpFDeg();
5001 op = set[
i].GetpFDeg();
5013 if (
length==-1)
return 0;
5015 int o =
p.GetpFDeg();
5016 int op = set[
length].GetpFDeg();
5030 op= set[
an].GetpFDeg();
5037 op = set[
i].GetpFDeg();
5054 if (
length==-1)
return 0;
5057 int o =
p.GetpFDeg();
5058 int op = set[
length].GetpFDeg();
5074 op = set[
an].GetpFDeg();
5077 || (( op == o) && (set[
an].length ==
p.
length)
5083 op = set[
i].GetpFDeg();
5086 || (( op == o) && (set[
i].length ==
p.
length)
5097 if (
length==-1)
return 0;
5100 int o =
p.GetpFDeg();
5101 int op = set[
length].GetpFDeg();
5116 op = set[
an].GetpFDeg();
5119 || (( op == o) && (set[
an].length ==
p.
length)
5125 op = set[
i].GetpFDeg();
5128 || (( op == o) && (set[
i].length ==
p.
length)
5144 if (
length==-1)
return 0;
5146 int o =
p.GetpFDeg();
5148 if (set[
length].GetpFDeg() <= o)
5158 if (set[
an].GetpFDeg() > o)
5163 if (set[
i].GetpFDeg() > o)
5173 if (
length==-1)
return 0;
5174 int ol =
p.GetpLength();
5188 int oo=set[
an].ecart;
5195 int oo=set[
i].ecart;
5229 if (
length==-1)
return 0;
5231 int o =
p.GetpFDeg() +
p.ecart;
5247 op = set[
an].GetpFDeg()+set[
an].ecart;
5254 op = set[
i].GetpFDeg()+set[
i].ecart;
5266 if (
length==-1)
return 0;
5268 int o =
p.GetpFDeg() +
p.ecart;
5283 op = set[
an].GetpFDeg()+set[
an].ecart;
5290 op = set[
i].GetpFDeg()+set[
i].ecart;
5327 if (
length==-1)
return 0;
5329 int o =
p.GetpFDeg() +
p.ecart;
5334 || (( op == o) && (set[
length].ecart >
p.ecart))
5335 || (( op == o) && (set[
length].ecart==
p.ecart)
5346 op = set[
an].GetpFDeg()+set[
an].ecart;
5348 || (( op == o) && (set[
an].ecart <
p.ecart))
5349 || (( op == o) && (set[
an].ecart==
p.ecart)
5355 op = set[
i].GetpFDeg()+set[
i].ecart;
5357 || (( op == o) && (set[
i].ecart <
p.ecart))
5358 || (( op == o) && (set[
i].ecart ==
p.ecart)
5369 if (
length==-1)
return 0;
5371 int o =
p.GetpFDeg() +
p.ecart;
5375 || (( op == o) && (set[
length].ecart >
p.ecart))
5376 || (( op == o) && (set[
length].ecart==
p.ecart)
5387 op = set[
an].GetpFDeg()+set[
an].ecart;
5389 || (( op == o) && (set[
an].ecart <
p.ecart))
5390 || (( op == o) && (set[
an].ecart==
p.ecart)
5396 op = set[
i].GetpFDeg()+set[
i].ecart;
5398 || (( op == o) && (set[
i].ecart <
p.ecart))
5399 || (( op == o) && (set[
i].ecart ==
p.ecart)
5415 if (
length==-1)
return 0;
5419 int o =
p.GetpFDeg() +
p.ecart;
5429 || ((op == o) && (set[
length].ecart >
p.ecart))
5430 || ((op == o) && (set[
length].ecart==
p.ecart)
5446 int op = set[
an].GetpFDeg()+set[
an].ecart;
5448 || ((op == o) && (set[
an].ecart <
p.ecart))
5449 || ((op == o) && (set[
an].ecart==
p.ecart)
5460 int op = set[
i].GetpFDeg()+set[
i].ecart;
5462 || ((op == o) && (set[
i].ecart <
p.ecart))
5463 || ((op == o) && (set[
i].ecart ==
p.ecart)
5477 if (
length==-1)
return 0;
5481 int o =
p.GetpFDeg() +
p.ecart;
5490 || ((op == o) && (set[
length].ecart >
p.ecart))
5491 || ((op == o) && (set[
length].ecart==
p.ecart)
5507 int op = set[
an].GetpFDeg()+set[
an].ecart;
5509 || ((op == o) && (set[
an].ecart <
p.ecart))
5510 || ((op == o) && (set[
an].ecart==
p.ecart)
5521 int op = set[
i].GetpFDeg()+set[
i].ecart;
5523 || ((op == o) && (set[
i].ecart <
p.ecart))
5524 || ((op == o) && (set[
i].ecart ==
p.ecart)
5544 if (
length==-1)
return 0;
5547 int op=
p.GetpFDeg();
5549 if (set[
length].ecart < o)
5551 if (set[
length].ecart == o)
5565 if (set[
an].ecart > o)
5567 if (set[
an].ecart == o)
5569 int oo=set[
an].GetpFDeg();
5577 if (set[
i].ecart > o)
5579 else if (set[
i].ecart == o)
5581 int oo=set[
i].GetpFDeg();
5603 int d=
p->GetpFDeg();
5604 int op=set[
length].GetpFDeg();
5619 op=set[
an].GetpFDeg();
5621 || ((op == d) && (
p->p1!=
NULL) && (set[
an].p1==
NULL))
5627 op=set[
i].GetpFDeg();
5629 || ((op==d) && (
p->p1!=
NULL) && (set[
i].p1==
NULL))
5752 if (set[
an].FDeg >
p->FDeg)
5756 if (set[
an].FDeg ==
p->FDeg)
5774 if (set[
i].FDeg >
p->FDeg)
5778 if (set[
i].FDeg ==
p->FDeg)
5793 if (strat->
syzl==0)
return 0;
5837 int o =
p->GetpFDeg();
5838 int op = set[
length].GetpFDeg();
5851 op = set[
an].GetpFDeg();
5858 op = set[
i].GetpFDeg();
5880 int o =
p->GetpFDeg();
5881 int op = set[
length].GetpFDeg();
5893 op = set[
an].GetpFDeg();
5900 op = set[
i].GetpFDeg();
5914 int o =
p->GetpFDeg();
5915 int op = set[
length].GetpFDeg();
5927 op = set[
an].GetpFDeg();
5934 op = set[
i].GetpFDeg();
5948 if (
length < 0)
return 0;
5958 if (set[
an].FDeg >
p->FDeg)
5962 if (set[
an].FDeg ==
p->FDeg)
5992 if (set[
i].FDeg >
p->FDeg)
5996 if (set[
i].FDeg ==
p->FDeg)
6004 if (set[
i].t_p!=
NULL)
6036 if (coeff == 0)
return -1;
6039 while (
tmp % 2 == 0)
6097 int o =
p->GetpFDeg();
6098 int op = set[
length].GetpFDeg();
6113 op = set[
an].GetpFDeg();
6116 || ((op == o) && (set[
an].length <=
p->
length)
6122 op = set[
i].GetpFDeg();
6125 || ((op == o) && (set[
i].length <=
p->
length)
6139 int o =
p->GetpFDeg();
6140 int op = set[
length].GetpFDeg();
6154 op = set[
an].GetpFDeg();
6157 || ((op == o) && (set[
an].length <=
p->
length)
6163 op = set[
i].GetpFDeg();
6166 || ((op == o) && (set[
i].length <=
p->
length)
6186 int o =
p->GetpFDeg();
6188 if (set[
length].GetpFDeg() > o)
6198 if (set[
an].GetpFDeg() >= o)
6203 if (set[
i].GetpFDeg() >= o)
6221 int o =
p->GetpFDeg() +
p->ecart;
6235 op = set[
an].GetpFDeg() + set[
an].ecart;
6242 op = set[
i].GetpFDeg() + set[
i].ecart;
6257 int o =
p->GetpFDeg() +
p->ecart;
6270 op = set[
an].GetpFDeg() + set[
an].ecart;
6277 op = set[
i].GetpFDeg() + set[
i].ecart;
6298 int o =
p->GetpFDeg() +
p->ecart;
6303 && (set[
length].ecart >
p->ecart))
6305 && (set[
length].ecart ==
p->ecart)
6315 if ((set[
an].GetpFDeg() + set[
an].ecart > o)
6316 || ((set[
an].GetpFDeg() + set[
an].ecart == o)
6317 && (set[
an].ecart >
p->ecart))
6318 || ((set[
an].GetpFDeg() + set[
an].ecart == o)
6319 && (set[
an].ecart ==
p->ecart)
6325 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6326 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6327 && (set[
i].ecart >
p->ecart))
6328 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6329 && (set[
i].ecart ==
p->ecart)
6343 int o =
p->GetpFDeg() +
p->ecart;
6347 && (set[
length].ecart >
p->ecart))
6349 && (set[
length].ecart ==
p->ecart)
6359 if ((set[
an].GetpFDeg() + set[
an].ecart > o)
6360 || ((set[
an].GetpFDeg() + set[
an].ecart == o)
6361 && (set[
an].ecart >
p->ecart))
6362 || ((set[
an].GetpFDeg() + set[
an].ecart == o)
6363 && (set[
an].ecart ==
p->ecart)
6369 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6370 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6371 && (set[
i].ecart >
p->ecart))
6372 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6373 && (set[
i].ecart ==
p->ecart)
6396 int o =
p->GetpFDeg() +
p->ecart;
6405 && (set[
length].ecart >
p->ecart))
6407 && (set[
length].ecart ==
p->ecart)
6422 if ((set[
an].GetpFDeg() + set[
an].ecart > o)
6423 || ((set[
an].GetpFDeg() + set[
an].ecart == o)
6424 && (set[
an].ecart >
p->ecart))
6425 || ((set[
an].GetpFDeg() + set[
an].ecart == o)
6426 && (set[
an].ecart ==
p->ecart)
6437 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6438 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6439 && (set[
i].ecart >
p->ecart))
6440 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6441 && (set[
i].ecart ==
p->ecart)
6461 int o =
p->GetpFDeg() +
p->ecart;
6469 && (set[
length].ecart >
p->ecart))
6471 && (set[
length].ecart ==
p->ecart)
6486 if ((set[
an].GetpFDeg() + set[
an].ecart > o)
6487 || ((set[
an].GetpFDeg() + set[
an].ecart == o)
6488 && (set[
an].ecart >
p->ecart))
6489 || ((set[
an].GetpFDeg() + set[
an].ecart == o)
6490 && (set[
an].ecart ==
p->ecart)
6501 if ((set[
i].GetpFDeg() + set[
i].ecart > o)
6502 || ((set[
i].GetpFDeg() + set[
i].ecart == o)
6503 && (set[
i].ecart >
p->ecart))
6504 || ((set[
i].GetpFDeg() +set[
i].ecart == o)
6505 && (set[
i].ecart ==
p->ecart)
6524 PrintS(
"syzygy criterion checks: ");
6527 for (
int k=0;
k<strat->
syzl;
k++)
6532 Print(
"checking with: %d / %d -- \n",
k,strat->
syzl);
6561 PrintS(
"--- syzygy criterion checks: ");
6586 Print(
"checking with: %d -- ",
k);
6611 PrintS(
"rewritten criterion checks: ");
6614 for(
int k = strat->
sl;
k>=start;
k--)
6618 PrintS(
"checking with: ");
6634 PrintS(
"ALL ELEMENTS OF S\n----------------------------------------\n");
6635 for(
int kk = 0;
kk<strat->
sl+1;
kk++)
6639 PrintS(
"------------------------------\n");
6669 for (
int ii=strat->
sl;
ii>start;
ii--)
6675 if (!(
pLmCmp(p1,p2) == 1))
6694 for (
int i=strat->
Bl;
i>-1;
i--)
6715 for (
int ii=strat->
sl;
ii>-1;
ii--)
6721 if (!(
pLmCmp(p1,p2) == 1))
6742 const unsigned long not_sev = ~L->sev;
6743 const unsigned long* sev = strat->
sevS;
6757 #if defined(PDEBUG) || defined(PDIV_DEBUG)
6777 #if defined(PDEBUG) || defined(PDIV_DEBUG)
6796 if (strat->
tl < 0 || strat->
S_2_R[
j] == -1)
6819 #if defined(PDEBUG) || defined(PDIV_DEBUG)
6833 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[
j]);
6851 #if defined(PDEBUG) || defined(PDIV_DEBUG)
6866 assume(t !=
NULL && t->t_p !=
NULL && t->tailRing == r && t->p == strat->
S[
j]);
6963 p =
h = L->GetLmTailRing();
6965 return L->GetLmCurrRing();
7000 Ln.SetShortExpVector();
7043 }
while (!
Ln.IsNull());
7068 return L->GetLmCurrRing();
7076 p =
h = L->GetLmTailRing();
7078 return L->GetLmCurrRing();
7085 Ln.pLength = L->GetpLength() - 1;
7109 Ln.SetShortExpVector();
7150 }
while (!
Ln.IsNull());
7183 return L->GetLmCurrRing();
7193 p =
h = L->GetLmTailRing();
7228 Ln.SetShortExpVector();
7262 }
while (!
Ln.IsNull());
7291 }
while (!
Ln.IsNull());
7322 p =
h = L->GetLmTailRing();
7324 return L->GetLmCurrRing();
7331 Ln.pLength = L->GetpLength() - 1;
7344 Ln.SetShortExpVector();
7356 poly
p_Ln=
Ln.GetLmCurrRing();
7370 }
while (!
Ln.IsNull());
7394 return L->GetLmCurrRing();
7428 p =
h = L->GetLmTailRing();
7430 return L->GetLmCurrRing();
7437 Ln.pLength = L->GetpLength() - 1;
7450 Ln.SetShortExpVector();
7462 poly
p_Ln=
Ln.GetLmCurrRing();
7479 }
while (!
Ln.IsNull());
7504 return L->GetLmCurrRing();
7540 if (strat->
Ll != *
reduc && strat->
Ll > 0)
7557 Print(
"product criterion:%d chain criterion:%d\n",strat->
cp,strat->
c3);
7559 #ifdef HAVE_SHIFTBBA
7561 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7573 #ifdef HAVE_SHIFTBBA
7575 if (strat->
cv!=0)
Print(
"shift V criterion:%d\n",strat->
cv);
7590 for (
i=0;
i<=strat->
sl;
i++)
7602 for (
i=0;
i<=strat->
tl;
i++)
7607 Print(
" o:%ld e:%d l:%d",
7608 strat->
T[
i].pFDeg(),strat->
T[
i].ecart,strat->
T[
i].
length);
7613 for (
i=strat->
Ll;
i>=0;
i--)
7622 Print(
" o:%ld e:%d l:%d",
7623 strat->
L[
i].pFDeg(),strat->
L[
i].ecart,strat->
L[
i].
length);
7645 strat->
S=strat->
Shdl->m;
7679 strat->
enterS(
h,pos,strat,-1);
7680 strat->
fromQ[pos]=1;
7713 strat->
enterS(
h,pos,strat,-1);
7739 strat->
S=strat->
Shdl->m;
7773 strat->
enterS(
h,pos,strat,-1);
7774 strat->
fromQ[pos]=1;
7806 pos = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
7836 strat->
S = strat->
Shdl->m;
7878 strat->
enterS(
h,pos,strat,-1);
7879 strat->
fromQ[pos]=1;
7989 for(
i=1;
i<=strat->
sl;
i++)
8005#if defined(DEBUGF5) || defined(DEBUGF51)
8006 PrintS(
"------------- GENERATING SYZ RULES NEW ---------------\n");
8043 for (
k = 0;
k<
i;
k++)
8087 for (
k = 0;
k<strat->
sl+1;
k++)
8108 PrintS(
"Principal syzygies:\n");
8112 PrintS(
"--------------------------------\n");
8122 PrintS(
"--------------------------------\n");
8142 strat->
S=strat->
Shdl->m;
8177 strat->
enterS(
h,pos,strat, strat->
tl+1);
8179 strat->
fromQ[pos]=1;
8207 strat->
enterS(
h,pos,strat, strat->
tl+1);
8249 h.is_normalized = 0;
8256 strat->
enterS(
h,pos,strat, strat->
tl+1);
8286 strat->
S=strat->
Shdl->m;
8321 strat->
enterS(
h,pos,strat, strat->
tl+1);
8323 strat->
fromQ[pos]=1;
8351 strat->
enterS(
h,pos,strat, strat->
tl+1);
8393 h.is_normalized = 0;
8400 strat->
enterS(
h,pos,strat, strat->
tl+1);
8441 if (!
pIsVector((*p).p) && ((*p).ecart != 0))
8686 for (
i=0;
i<=strat->
sl;
i++)
8778 else {
suc=-1;
break; }
8789 for (
i=0;
i<=strat->
sl;
i++)
8837 *
sizeof(
unsigned long));
8864 strat->
Shdl->m=strat->
S;
8868#ifdef ENTER_USE_MEMMOVE
8870 (strat->
sl -
atS + 1)*
sizeof(poly));
8872 (strat->
sl -
atS + 1)*
sizeof(
int));
8874 (strat->
sl -
atS + 1)*
sizeof(
unsigned long));
8876 (strat->
sl -
atS + 1)*
sizeof(
int));
8879 (strat->
sl -
atS + 1)*
sizeof(
int));
8886 strat->
S[
i] = strat->
S[
i-1];
8901#ifdef ENTER_USE_MEMMOVE
8903 (strat->
sl -
atS + 1)*
sizeof(
int));
8960 *
sizeof(
unsigned long));
8964 *
sizeof(
unsigned long));
8992 strat->
Shdl->m=strat->
S;
9001#ifdef ENTER_USE_MEMMOVE
9003 (strat->
sl -
atS + 1)*
sizeof(poly));
9005 (strat->
sl -
atS + 1)*
sizeof(poly));
9007 (strat->
sl -
atS + 1)*
sizeof(
unsigned long));
9009 (strat->
sl -
atS + 1)*
sizeof(
int));
9011 (strat->
sl -
atS + 1)*
sizeof(
unsigned long));
9013 (strat->
sl -
atS + 1)*
sizeof(
int));
9016 (strat->
sl -
atS + 1)*
sizeof(
int));
9023 strat->
S[
i] = strat->
S[
i-1];
9040#ifdef ENTER_USE_MEMMOVE
9042 (strat->
sl -
atS + 1)*
sizeof(
int));
9053 strat->
S[
atS] =
p.p;
9077 Print(
"--- LIST S: %d ---\n",strat->
sl);
9078 for(
k=0;
k<=strat->
sl;
k++)
9082 PrintS(
"--- LIST S END ---\n");
9108 else strat->
P.sev=0;
9116 poly
tp = strat->
T[
tj].p;
9121 for (
j = 0;
j <= strat->
sl; ++
j)
9135 pos =
posInS(strat, strat->
sl,
p.p,
p.ecart);
9141 for (
i = 0;
i <= strat->
Ll; ++
i)
9165 strat->
enterS(
p, pos, strat, strat->
tl);
9204 for(
i=strat->
tl;
i>=0;
i--)
9206 if (
p.p==strat->
T[
i].p)
9208 printf(
"already in T at pos %d of %d, atT=%d\n",
i,strat->
tl,
atT);
9214#ifdef HAVE_TAIL_RING
9217 p.t_p=
p.GetLmTailRing();
9223 if (strat->
tl == strat->
tmax-1)
9227#ifdef ENTER_USE_MEMMOVE
9231 (strat->
tl-
atT+1)*
sizeof(
unsigned long));
9235#ifndef ENTER_USE_MEMMOVE
9236 strat->
T[
i] = strat->
T[
i-1];
9239 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9247 if (!(
currRing->isLPring &&
p.shift > 0))
9266 strat->
R[strat->
tl] = &(strat->
T[
atT]);
9267 strat->
T[
atT].i_r = strat->
tl;
9292 for(
i=strat->
tl;
i>=0;
i--)
9294 if (
p.p==strat->
T[
i].p)
9296 printf(
"already in T at pos %d of %d, atT=%d\n",
i,strat->
tl,
atT);
9302#ifdef HAVE_TAIL_RING
9305 p.t_p=
p.GetLmTailRing();
9311 if (strat->
tl == strat->
tmax-1)
9315#ifdef ENTER_USE_MEMMOVE
9319 (strat->
tl-
atT+1)*
sizeof(
unsigned long));
9323#ifndef ENTER_USE_MEMMOVE
9324 strat->
T[
i] = strat->
T[
i-1];
9327 strat->
R[strat->
T[
i].i_r] = &(strat->
T[
i]);
9348 strat->
R[strat->
tl] = &(strat->
T[
atT]);
9349 strat->
T[
atT].i_r = strat->
tl;
9356 for(
i=strat->
tl;
i>=0;
i--)
9389 *
sizeof(
unsigned long));
9394#ifdef ENTER_USE_MEMMOVE
9396 (strat->
syzl-
atT+1)*
sizeof(poly));
9398 (strat->
syzl-
atT+1)*
sizeof(
unsigned long));
9402#ifndef ENTER_USE_MEMMOVE
9443 PrintS(
"--- Syzygies ---\n");
9446 PrintS(
"--------------------------------\n");
9452 PrintS(
"--------------------------------\n");
9534 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9535 else PrintS(
"ideal/module is not homogeneous\n");
9605 if (strat->
homog)
PrintS(
"ideal/module is homogeneous\n");
9606 else PrintS(
"ideal/module is not homogeneous\n");
10145 if ((r->m[
l]!=
NULL)
10152 if ((
Q->m[q]!=
NULL)
10176 if ((r->m[
l]!=
NULL)
10183 if ((
Q->m[q]!=
NULL)
10386 Print(
"to (tailR) S[%d]:",
i);
10401 T_j->pCleardenom();
10441 Print(
"to (-tailR) S[%d]:",
i);
10538 assume(L->i_r1 >= -1 && L->i_r1 <= strat->
tl);
10539 assume(L->i_r2 >= -1 && L->i_r2 <= strat->
tl);
10544 if ((L->i_r1 == -1) || (L->i_r2 == -1) )
10549 if ((L->i_r1>=0)&&(strat->
R[L->i_r1]!=
NULL))
p1_max = (strat->
R[L->i_r1])->max_exp;
10551 if ((L->i_r2>=0)&&(strat->
R[L->i_r2]!=
NULL))
p2_max = (strat->
R[L->i_r2])->max_exp;
10766 poly
pH =
h->GetP();
10770 for(
int i = 0;
i<=strat->
sl;
i++)
10833 h->SetLmCurrRing();
10842 poly
hSig =
h->sig;
10843 poly
pH =
h->GetP();
10847 for(
int i = 0;
i<=strat->
sl;
i++)
10916 h->SetLmCurrRing();
11057 for (
i=0;
i<=strat->
tl;
i++)
11060 p_shallow_copy_delete);
11062 for (
i=0;
i<=strat->
Ll;
i++)
11066 strat->
L[
i].ShallowCopyDelete(
new_tailRing, p_shallow_copy_delete);
11068 if ((strat->
P.t_p !=
NULL) ||
11070 strat->
P.ShallowCopyDelete(
new_tailRing, p_shallow_copy_delete);
11075 L->ShallowCopyDelete(
new_tailRing, p_shallow_copy_delete);
11084 L->max_exp =
t_l->max_exp;
11115 unsigned long l = 0;
11121 for (
i=0;
i<= strat->
Ll;
i++)
11125 for (
i=0;
i<=strat->
tl;
i++)
11155 int **wvhdl = (
int **)
omAlloc0((n+1)*
sizeof(
int*));
11156 res->wvhdl = wvhdl;
11157 for (
int i=1;
i<n;
i++)
11159 res->order[
i] = r->order[
i-1];
11160 res->block0[
i] = r->block0[
i-1];
11161 res->block1[
i] = r->block1[
i-1];
11162 res->wvhdl[
i] = r->wvhdl[
i-1];
11182 WarnS(
"error in nc_rComplete");
11203 int **wvhdl = (
int **)
omAlloc0((n+2)*
sizeof(
int*));
11204 res->wvhdl = wvhdl;
11205 for (
int i=2;
i<n+2;
i++)
11207 res->order[
i] = r->order[
i-2];
11208 res->block0[
i] = r->block0[
i-2];
11209 res->block1[
i] = r->block1[
i-2];
11210 res->wvhdl[
i] = r->wvhdl[
i-2];
11215 res->block0[0] = 1;
11217 for (
int i=0;
i<
res->N; ++
i)
11218 res->wvhdl[0][
i] = 1;
11238 WarnS(
"error in nc_rComplete");
11375#ifdef HAVE_TAIL_BIN
11402Gonnet 43.26 42.30 38.34 41.98 38.40 100.04
11404Twomat3 1.62 1.69 1.70 1.65 1.54 11.32
11405ahml 4.48 4.03 4.03 4.38 4.96 26.50
11406c7 15.02 13.98 15.16 13.24 17.31 47.89
11407c8 505.09 407.46 852.76 413.21 499.19 n/a
11408f855 12.65 9.27 14.97 8.78 14.23 33.12
11409gametwo6 11.47 11.35 14.57 11.20 12.02 35.07
11411ilias13 22.89 22.46 24.62 20.60 23.34 53.86
11412noon8 40.68 37.02 37.99 36.82 35.59 877.16
11413rcyclic_19 48.22 42.29 43.99 45.35 51.51 204.29
11414rkat9 82.37 79.46 77.20 77.63 82.54 267.92
11415schwarz_11 16.46 16.81 16.76 16.81 16.72 35.56
11416test016 16.39 14.17 14.40 13.50 14.26 34.07
11417test017 34.70 36.01 33.16 35.48 32.75 71.45
11418test042 10.76 10.99 10.27 11.57 10.45 23.04
11419test058 6.78 6.75 6.51 6.95 6.22 9.47
11420test066 10.71 10.94 10.76 10.61 10.56 19.06
11421test073 10.75 11.11 10.17 10.79 8.63 58.10
11422test086 12.23 11.81 12.88 12.24 13.37 66.68
11423test103 5.05 4.80 5.47 4.64 4.89 11.90
11424test154 12.96 11.64 13.51 12.46 14.61 36.35
11425test162 65.27 64.01 67.35 59.79 67.54 196.46
11426test164 7.50 6.50 7.68 6.70 7.96 17.13
11427virasoro 3.39 3.50 3.35 3.47 3.70 7.66
11437 if (
length==-1)
return 0;
11440 int op=
p.GetpFDeg();
11441 int ol =
p.GetpLength();
11443 if (set[
length].ecart < o)
11445 if (set[
length].ecart == o)
11459 if (set[
an].ecart > o)
11461 if (set[
an].ecart == o)
11463 int oo=set[
an].GetpFDeg();
11471 if (set[
i].ecart > o)
11473 else if (set[
i].ecart == o)
11475 int oo=set[
i].GetpFDeg();
11491 if (
length==-1)
return 0;
11493 int op=
p.GetpFDeg();
11494 int ol =
p.GetpLength();
11507 int oo=set[
an].GetpFDeg();
11514 int oo=set[
i].GetpFDeg();
11527 int ol =
p.GetpLength();
11587#ifdef HAVE_MORE_POS_IN_T
11623 printf(
"initEcartPair: ");
11627 printf(
"homog=%d, LazyDegree=%d, LazyPass=%d, ak=%d,\n",
11629 printf(
"honey=%d, sugarCrit=%d, Gebauer=%d, noTailReduction=%d, use_buckets=%d\n",
11635 printf(
"posInLDependsOnLength=%d\n",
11667 printf(
"currRing->pFDeg: ");
11682 printf(
"ecartWeights: ");
11704#ifdef HAVE_SHIFTBBA
11808 PrintS(
"\n--- create strong gcd poly: ");
11817 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);
11839 h.i_r1 = -1;
h.i_r2 = -1;
11873#ifdef HAVE_SHIFTBBA
11904 h.ecart=0;
h.length=0;
11936 for(
j = strat->
Bl;
j>=0;
j--)
12077 h.i_r1 = -1;
h.i_r2 = -1;
12116#ifdef HAVE_SHIFTBBA
12126#ifdef HAVE_SHIFTBBA
12190#ifdef HAVE_SHIFTBBA
12232#ifdef HAVE_SHIFTBBA
12235#ifdef CRITERION_DEBUG
12280#ifdef CRITERION_DEBUG
12288 if((!((
ecartq>0)&&(ecart>0)))
12307#ifdef CRITERION_DEBUG
12317#ifdef CRITERION_DEBUG
12342#ifdef CRITERION_DEBUG
12345 Print(
"--- chain crit using B[%d].lcm=%s\n",
j,
pString(strat->
B[
j].lcm));
12356#ifdef CRITERION_DEBUG
12359 Print(
"--- chain crit using pair to remove B[%d].lcm=%s\n",
j,
pString(strat->
B[
j].lcm));
12392#ifdef CRITERION_DEBUG
12400#ifdef CRITERION_DEBUG
12412 for(
j = strat->
Bl;
j>=0;
j--)
12421#ifdef CRITERION_DEBUG
12424 Print(
"--- chain crit using B[%d].lcm=%s\n",
j,
pString(strat->
B[
j].lcm));
12434#ifdef CRITERION_DEBUG
12437 Print(
"--- chain crit using pair to remove B[%d].lcm=%s\n",
j,
pString(strat->
B[
j].lcm));
12454#ifdef CRITERION_DEBUG
12462#ifdef CRITERION_DEBUG
12521#ifdef CRITERION_DEBUG
12561#ifdef CRITERION_DEBUG
12574#ifdef HAVE_SHIFTBBA
12604 for (
j=0;
j<=
k;
j++)
12609 poly
s = strat->
S[
j];
12620 for (
j=0;
j<=
k;
j++)
12622 poly
s = strat->
S[
j];
12640 for (
j=0;
j<=
k;
j++)
12645 poly
s = strat->
S[
j];
12656 for (
j=0;
j<=
k;
j++)
12660 poly
s = strat->
S[
j];
12690 for (
j=0;
j<=
k;
j++)
12692 poly
s = strat->
S[
j];
12700 for (
j=0;
j<=
k;
j++)
12702 poly
s = strat->
S[
j];
12747 for (
j=0;
j<=
k;
j++)
12752 poly
s = strat->
S[
j];
12769 for (
j=0;
j<=
k;
j++)
12774 poly
s = strat->
S[
j];
12782 for (
j=0;
j<=
k;
j++)
12787 poly
s = strat->
S[
j];
12842#ifdef HAVE_SHIFTBBA
12871 for (
j=0;
j<=
k;
j++)
12876 poly
s = strat->
S[
j];
12885 for (
j=0;
j<=
k;
j++)
12887 poly
s = strat->
S[
j];
12905 for (
j=0;
j<=
k;
j++)
12910 poly
s = strat->
S[
j];
12920 for (
j=0;
j<=
k;
j++)
12924 poly
s = strat->
S[
j];
12935 for (
j=0;
j<=
k;
j++)
12937 poly
s = strat->
S[
j];
12946 for (
j=0;
j<=
k;
j++)
12948 poly
s = strat->
S[
j];
12963 for (
j=0;
j<=
k;
j++)
12969 poly
s = strat->
S[
j];
12986 for (
j=0;
j<=
k;
j++)
12991 poly
s = strat->
S[
j];
12999 for (
j=0;
j<=
k;
j++)
13004 poly
s = strat->
S[
j];
13026#ifdef HAVE_SHIFTBBA
13035 if ( (!strat->
fromT)
13056#ifdef HAVE_SHIFTBBA
13079#ifdef HAVE_SHIFTBBA
13086 p =
h = L->GetLmTailRing();
13088 return L->GetLmCurrRing();
13095 Ln.pLength = L->GetpLength() - 1;
13103 while(!
Ln.IsNull())
13107 Ln.SetShortExpVector();
13137 }
while (!
Ln.IsNull());
13158 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)
void scComputeHC(ideal S, ideal Q, int ak, poly &hEdge)
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
#define idDelete(H)
delete an ideal
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
static BOOLEAN length(leftv result, leftv arg)
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring tailRing)
KINLINE int ksReducePolyTailLC_Z(LObject *PR, TObject *PW, LObject *Red)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
KINLINE TObject ** initR()
KINLINE int ksReducePolyTail(LObject *PR, TObject *PW, LObject *Red)
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether)
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
KINLINE int ksReducePolyTail_Z(LObject *PR, TObject *PW, LObject *Red)
KINLINE unsigned long * initsevT()
int redLiftstd(LObject *h, kStrategy strat)
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
void kBucketDestroy(kBucket_pt *bucket_pt)
int ksCheckCoeff(number *a, number *b, const coeffs r)
BOOLEAN pCompareChainPart(poly p, poly p1, poly p2, poly lcm, const ring R)
BOOLEAN pCompareChain(poly p, poly p1, poly p2, poly lcm, const ring R)
Returns TRUE if.
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
long kHomModDeg(poly p, const ring r)
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
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)