12 #define MORA_USE_BUCKETS 16 #define PRE_INTEGER_CHECK 0 145 h->length=h->pLength=
pLength(h->p);
149 if (ret < 0)
return ret;
151 h->ShallowCopyDelete(strat->
tailRing,
179 d = h->GetpFDeg()+ h->ecart;
181 h->SetShortExpVector();
191 ei = strat->
T[
j].ecart;
194 if (ei > h->ecart && ii < strat->tl)
196 li = strat->
T[
j].length;
206 if (i > strat->
tl)
break;
207 if ((strat->
T[i].ecart < ei || (strat->
T[i].ecart == ei &&
208 strat->
T[i].length < li))
215 if (strat->
T[i].ecart < ei || (strat->
T[i].ecart == ei &&
216 strat->
T[i].length < li))
221 ei = strat->
T[
i].ecart;
222 if (ei <= h->ecart)
break;
223 li = strat->
T[
i].length;
240 assume(h->FDeg == h->pFDeg());
241 at = strat->
posInL(strat->
L,strat->
Ll,h,strat);
270 h->SetShortExpVector();
275 h->ecart = d-h->GetpFDeg();
277 h->ecart = d-h->GetpFDeg()+ei-h->ecart;
281 h->ecart = h->pLDeg(strat->
LDegLast) - h->GetpFDeg();
288 if (strat->
honey) h->SetLength();
298 d = h->GetpFDeg()+h->ecart;
305 && ((d >= reddeg) || (pass > strat->
LazyPass)))
310 assume(h->FDeg == h->pFDeg());
311 at = strat->
posInL(strat->
L,strat->
Ll,h,strat);
333 if (h->pTotalDeg()+h->ecart >= (int)strat->
tailRing->bitmask)
338 at = strat->
posInL(strat->
L,strat->
Ll,h,strat);
358 PrintS(
"\n---------------------------- NEW REDRILOC COMPUTATION ----------------------------\n");
359 PrintS(
" The pair h :\n");
363 PrintS(
"\n The actual reducer T is: ");
368 for (iii=0;iii<=strat->
tl;iii++)
375 d = h->GetpFDeg()+ h->ecart;
377 h->SetShortExpVector();
379 Print(
"\n Searching for a poly in T that divides h (of ecart %i) ...\n",h->ecart);
387 ei = strat->
T[
j].ecart;
388 Print(
"\n Found one: T[%i] of ecart %i: ",j,ei);
390 PrintS(
"\n Try to find another with smaller ecart:\n");
394 PrintS(
"\n No poly in T divides h.\n");
413 if (h->GetLmTailRing() ==
NULL)
422 ei = strat->
T[
j].ecart;
427 if (ei > h->ecart && ii < strat->tl)
429 li = strat->
T[
j].length;
439 if (i > strat->
tl)
break;
440 if ((strat->
T[i].ecart < ei || (strat->
T[i].ecart == ei &&
441 strat->
T[i].length < li))
450 if (strat->
T[i].ecart < ei || (strat->
T[i].ecart == ei &&
451 strat->
T[i].length < li))
456 printf(
"\n Intermidiate one, h.ecart = %i < ecart = %i < ei = %i: ",h->ecart,strat->
T[i].ecart, ei);
460 ei = strat->
T[
i].ecart;
461 if (ei <= h->ecart)
break;
462 li = strat->
T[
i].length;
469 PrintS(
"\n None was found.\n");
473 Print(
"\n A better one (ecart = %i): T[%i] = ",ei,ii);
484 printf(
"\nHAD TO REDUCE WITH BIGGER ECART!!!\n");
495 assume(h->FDeg == h->pFDeg());
496 at = strat->
posInL(strat->
L,strat->
Ll,h,strat);
497 if (at <= strat->Ll &&
pLmCmp(h->p, strat->
L[strat->
Ll].p) != 0 && !
nEqual(h->p->coef, strat->
L[strat->
Ll].p->coef))
521 printf(
"\nReduced to 0. Exit\n");
529 h->SetShortExpVector();
534 h->ecart = d-h->GetpFDeg();
536 h->ecart = d-h->GetpFDeg()+ei-h->ecart;
540 h->ecart = h->pLDeg(strat->
LDegLast) - h->GetpFDeg();
542 printf(
"\n Partial Reduced (ecart %i) h = ",h->ecart);
p_Write(h->p,strat->
tailRing);
547 d = h->GetpFDeg()+h->ecart;
554 && ((d >= reddeg) || (pass > strat->
LazyPass)))
559 assume(h->FDeg == h->pFDeg());
560 at = strat->
posInL(strat->
L,strat->
Ll,h,strat);
582 if (h->pTotalDeg()+h->ecart >= (int)strat->
tailRing->bitmask)
587 at = strat->
posInL(strat->
L,strat->
Ll,h,strat);
603 if (h->IsNull())
return 0;
612 d = h->GetpFDeg() + h->ecart;
615 h->SetShortExpVector();
621 h->SetDegStuffReturnLDeg(strat->
LDegLast);
652 h->SetShortExpVector();
665 h->SetDegStuffReturnLDeg(strat->
LDegLast);
675 if (strat->
T[j].ecart <= h->ecart)
676 h->ecart = d - h->GetpFDeg();
678 h->ecart = d - h->GetpFDeg() + strat->
T[
j].ecart - h->ecart;
680 d = h->GetpFDeg() + h->ecart;
683 d = h->SetDegStuffReturnLDeg(strat->
LDegLast);
692 && ((d >= reddeg) || (pass > strat->
LazyPass)))
697 at = strat->
posInL(strat->
L,strat->
Ll,h,strat);
715 if (h->pTotalDeg()+h->ecart >= (int)strat->
tailRing->bitmask)
720 at = strat->
posInL(strat->
L,strat->
Ll,h,strat);
741 int o = H.SetpFDeg();
745 unsigned long not_sev = ~
H.sev;
762 int ei = strat->
T[
j].ecart;
763 int li = strat->
T[
j].length;
774 if (j > strat->
tl)
break;
775 if (ei <= H.ecart)
break;
776 if (((strat->
T[j].ecart < ei)
777 || ((strat->
T[
j].ecart == ei)
778 && (strat->
T[j].length < li)))
786 ei = strat->
T[
j].ecart;
787 li = strat->
T[
j].length;
841 int o = H.SetpFDeg();
845 unsigned long not_sev = ~
H.sev;
858 printf(
"\nSearching for a reducer...\n");
866 int ei = strat->
T[
j].ecart;
867 int li = strat->
T[
j].length;
870 printf(
"\nFound: j = %i, ecart = %i\nTrying to find a better one...\n",j,ei);
pWrite(strat->
T[j].p);
881 if (j > strat->
tl)
break;
882 if (ei <= H.ecart)
break;
883 if (((strat->
T[j].ecart < ei)
884 || ((strat->
T[j].ecart == ei)
885 && (strat->
T[j].length < li)))
894 ei = strat->
T[
j].ecart;
895 li = strat->
T[
j].length;
898 printf(
"\nFound a better one: j = %i, ecart = %i\nTrying to find a better one...\n",j,ei);
919 printf(
"\nHAVE TO REDUCE IT WITH BIGGER ECART\n");
935 printf(
"\nAfter the small reduction it looks like this:\n");
pWrite(H.p);
962 for (i=1; i<=strat->
Ll; i++)
964 at = strat->
posInL(strat->
L,i-1,&(strat->
L[i]),strat);
968 for (j=i-1; j>=at; j--) strat->
L[j+1] = strat->
L[j];
984 for (i=1; i<=strat->
tl; i++)
986 if (strat->
T[i-1].length > strat->
T[i].length)
989 sev = strat->
sevT[
i];
995 if (strat->
T[i].length > strat->
T[at].length)
break;
997 for (j = i-1; j>at; j--)
999 strat->
T[j+1]=strat->
T[
j];
1001 strat->
R[strat->
T[j+1].i_r] = &(strat->
T[j+1]);
1004 strat->
sevT[at+1] = sev;
1005 strat->
R[p.i_r] = &(strat->
T[at+1]);
1071 if (i==last)
return TRUE;
1081 if (L->bucket !=
NULL)
1083 poly p = L->CanonicalizeP();
1102 if (length<0)
return 0;
1105 int op= p->GetpFDeg() +p->ecart;
1106 for (j=length; j>=0; j--)
1113 && (
set[j].GetpFDeg()+
set[j].ecart >= op))
1141 p=strat->
L[strat->
Ll];
1142 strat->
L[strat->
Ll]=strat->
L[
j];
1175 strat->
L[
j].SetLmCurrRing();
1187 p=strat->
L[strat->
Ll];
1188 strat->
L[strat->
Ll]=strat->
L[
j];
1207 while (i <= strat->Ll)
1240 if (! strat->
L[i].IsNull())
1242 strat->
L[
i].SetLmCurrRing();
1243 strat->
L[
i].SetpFDeg();
1245 = strat->
L[
i].pLDeg(strat->
LDegLast) - strat->
L[
i].GetpFDeg();
1252 if (strat->
L[i].IsNull())
1274 while (i <= strat->tl)
1282 if (p.p != strat->
T[i].p)
1310 for (i=strat->
Ll; i>=0; i--)
1312 strat->
L[
i].SetpFDeg();
1314 for (i=strat->
tl; i>=0; i--)
1316 strat->
T[
i].SetpFDeg();
1368 Print(
"new s%d:",atS);
1574 strat->
HCord = 32000;
1617 int hilbeledeg=1,hilbcount=0;
1660 #ifdef HAVE_TAIL_RING 1674 while (strat->
Ll >= 0)
1677 printf(
"\n ------------------------NEW LOOP\n");
1678 printf(
"\nShdl = \n");
1679 for(
int iii = 0; iii<= strat->
sl; iii++)
1681 printf(
"S[%i]:",iii);
1684 printf(
"\n list L has %i\n", strat->
Ll);
1687 for(iii = 0; iii<= strat->
Ll; iii++)
1689 printf(
"L[%i]:",iii);
1701 && (strat->
L[strat->
Ll].ecart+strat->
L[strat->
Ll].GetpFDeg()>
Kstd1_deg))
1708 while ((strat->
Ll >= 0)
1709 && (strat->
L[strat->
Ll].p1!=
NULL) && (strat->
L[strat->
Ll].p2!=
NULL)
1710 && (strat->
L[strat->
Ll].ecart+strat->
L[strat->
Ll].GetpFDeg()>
Kstd1_deg)
1719 if (strat->
Ll<0)
break;
1722 strat->
P = strat->
L[strat->
Ll];
1749 else if (strat->
P.p1 ==
NULL)
1757 if (!strat->
P.IsNull())
1761 message(strat->
P.ecart+strat->
P.GetpFDeg(),&olddeg,&reduc,
strat, red_result);
1764 printf(
"\nThis is P vor red:\n");
p_Write(strat->P.p,strat->tailRing);
p_Write(strat->P.p1,strat->tailRing);
p_Write(strat->P.p2,strat->tailRing);
1765 printf(
"\nBefore Ll = %i\n", strat->Ll);
1767 red_result = strat->red(&strat->P,strat);
1769 printf(
"\nThis is P nach red:\n");
p_Write(strat->P.p,strat->tailRing);
p_Write(strat->P.p1,strat->tailRing);
p_Write(strat->P.p2,strat->tailRing);
1770 printf(
"\nAfter Ll = %i\n", strat->Ll);
1775 if (! strat->
P.IsNull())
1782 strat->
P.pCleardenom();
1786 strat->
P.p =
redtail(&(strat->
P),strat->
sl,strat);
1787 if (strat->
P.p==
NULL)
1789 WerrorS(
"expoent overflow - wrong ordering");
1798 if ((strat->
P.p->next==
NULL)
1800 strat->
P.pCleardenom();
1811 Print(
"\n The new pair list L -- after superenterpairs in loop %d -- is:\n",loop_count);
1812 for(
int iii=0;iii<=strat->
Ll;iii++)
1814 printf(
"\n L[%d]:\n",iii);
1821 posInS(strat,strat->
sl,strat->
P.p, strat->
P.ecart),
1824 printf(
"\nThis pair has been added to S:\n");
1834 khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
1840 if (strat->
P.lcm!=
NULL)
1851 memset(&strat->
P,0,
sizeof(strat->
P));
1906 return (strat->
Shdl);
1981 for (i=strat->
sl; i>=0; i--)
1985 for (i=0; i<=strat->
sl; i++)
1992 h.sev = strat->
sevS[
i];
2013 if ((p!=
NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
2125 for (i=strat->
sl; i>=0; i--)
2139 for (j=0; j<=strat->
sl; j++)
2143 h.pLength = h.length =
pLength(h.p);
2146 h.sev = strat->
sevS[
j];
2160 if ((p!=
NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
2214 if (i<=kModW->length())
2215 return o+(*kModW)[i-1];
2223 for (i=r->N;i>0;i--)
2225 if (kModW ==
NULL)
return j;
2228 return j+(*kModW)[i-1];
2235 return idInit(1,F->rank);
2260 strat->
kHomW=kHomW=vw;
2281 if (strat->
ak > 0 && (w!=
NULL) && (*w!=
NULL))
2283 strat->
kModW = kModW = *
w;
2313 #if PRE_INTEGER_CHECK 2323 printf(
"\nPreintegerCheck found this constant:\n");
pWrite(pFmon);
2342 if (strat->
ak > 0 && (w!=
NULL) && (*w!=
NULL))
2344 strat->
kModW = kModW = *
w;
2361 printf(
"\npreIntegerCheck didn't found any new information\n");
2370 r=
bba(FCopy,Q,
NULL,hilb,strat);
2375 r=
mora(FCopy,Q,*w,hilb,strat);
2377 r=
bba(FCopy,Q,*w,hilb,strat);
2394 r=
mora(F,Q,*w,hilb,strat);
2396 r=
bba(F,Q,*w,hilb,strat);
2412 if ((delete_w)&&(w!=
NULL)&&(*w!=
NULL))
delete *w;
2417 int newIdeal,
intvec *vw)
2420 return idInit(1,F->rank);
2460 strat->
kHomW=kHomW=vw;
2481 if (strat->
ak > 0 && (w!=
NULL) && (*w!=
NULL))
2483 strat->
kModW = kModW = *
w;
2517 r=
mora(F,Q,*w,hilb,strat);
2525 r=
sba(F,Q,*w,hilb,strat);
2542 if ((delete_w)&&(w!=
NULL)&&(*w!=
NULL))
delete *
w;
2553 bool sigdrop =
TRUE;
2555 printf(
"\nEnter the nice kSba loop\n");
2558 int totalsbaruns = 1,blockedreductions = 20,blockred = 0,loops = 0;
2559 while(sigdrop && (loops < totalsbaruns || totalsbaruns == -1)
2560 && (blockred <= blockedreductions))
2611 strat->
kHomW=kHomW=vw;
2632 if (strat->
ak > 0 && (w!=
NULL) && (*w!=
NULL))
2634 strat->
kModW = kModW = *
w;
2668 r=
mora(F,Q,*w,hilb,strat);
2675 r=
sba(r,Q,*w,hilb,strat);
2702 printf(
"\nsbaEnterS = %i\n",sbaEnterS);
2705 if ((delete_w)&&(w!=
NULL)&&(*w!=
NULL))
delete *w;
2708 if(sigdrop || blockred > blockedreductions)
2711 printf(
"\nWent to std\n");
2715 r =
kStd(r, Q, h, w, hilb, syzComp, newIdeal, vw);
2721 #ifdef HAVE_SHIFTBBA 2723 int newIdeal,
intvec *vw,
int uptodeg,
int lV)
2746 strat->
kHomW=kHomW=vw;
2767 if (strat->
ak > 0 && (w!=
NULL) && (*w!=
NULL))
2769 strat->
kModW = kModW = *
w;
2788 PrintS(
"No local ordering possible for shifts");
2795 r=
bbaShift(F,Q,*w,hilb,strat,uptodeg,lV);
2811 if ((delete_w)&&(w!=
NULL)&&(*w!=
NULL))
delete *w;
2828 return idInit(1,F->rank);
2833 sb =
kStd(F, Q, h, w, hilb);
2863 strat->
minim=(reduced % 2)+1;
2884 if (strat->
ak > 0 && (w!=
NULL) && (*w!=
NULL))
2912 r=
mora(F,Q,*w,hilb,strat);
2919 r=
bba(F,Q,*w,hilb,strat);
2937 if ((delete_w)&&(temp_w!=
NULL))
delete temp_w;
2945 else if (strat->
M==
NULL)
2948 Warn(
"no minimal generating set computed");
3005 res=
kNF1(F,Q,pp,strat,lazyReduce);
3007 res=
kNF2(F,Q,pp,strat,lazyReduce);
3049 res=
kNF2Bound(F,Q,pp,bound,strat,lazyReduce);
3100 res=
kNF1(F,Q,pp,strat,lazyReduce);
3102 res=
kNF2(F,Q,pp,strat,lazyReduce);
3153 res=
kNF2Bound(F,Q,pp,bound,strat,lazyReduce);
3168 poly ret =
kNF(F, Q, p, syzComp, lazyReduce);
3222 initS(tempF, tempQ, strat);
3251 ideal shdl=strat->
Shdl;
3301 strat->
kModW = kModW =
w;
3333 withT = ! strat->
homog;
3338 #ifdef HAVE_TAIL_RING 3343 while (strat->
Ll >= 0)
3350 strat->
P = strat->
L[strat->
Ll];
3353 if (strat->
P.p1 ==
NULL)
3359 if (strat->
P.p ==
NULL && strat->
P.t_p ==
NULL)
3367 &olddeg,&reduc,
strat, red_result);
3370 red_result = strat->red(&strat->P,strat);
3374 if (red_result == 1)
3380 strat->
P.GetP(strat->
lmBin);
3382 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
3389 strat->
P.pCleardenom();
3393 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
3394 strat->
P.pCleardenom();
3402 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
3414 strat->
enterS(strat->
P, pos, strat, strat->
tl);
3422 for(;ii<=strat->
sl;ii++)
3425 memset(&h,0,
sizeof(h));
3427 h.p=strat->
S[ii]; strat->
S[ii]=
NULL;
3429 h.sev=strat->
sevS[ii];
3433 if (strat->
T[jj].p==h.p)
3435 strat->
T[jj].p=
NULL;
3438 memmove(&(strat->
T[jj]),&(strat->
T[jj+1]),
3439 (strat->
tl-jj)*
sizeof(strat->
T[jj]));
3440 memmove(&(strat->
sevT[jj]),&(strat->
sevT[jj+1]),
3441 (strat->
tl-jj)*
sizeof(strat->
sevT[jj]));
3448 int lpos=strat->
posInL(strat->
L,strat->
Ll,&h,strat);
3453 Print(
"move S[%d] -> L[%d]: ",ii,pos);
3461 for(ii=pos+1;ii<=strat->
sl;ii++) strat->
fromQ[ii]=0;
3470 if (strat->
P.lcm!=
NULL)
3483 memset(&(strat->
P), 0,
sizeof(strat->
P));
3504 #ifdef HAVE_TAIL_RING 3511 for(i=strat->
sl;i>=0;i--) strat->
S_2_R[
i]=-1;
3539 if (w!=
NULL)
delete w;
3582 res1=
kNF(null,Q,res);
3587 if (
idElem(res)<=1) need_retry=0;
3588 while (need_retry && (counter>0))
3594 int new_elems=
idElem(res1);
3595 counter -= (new_elems >= elems);
3598 if (
idElem(res1)<=1) need_retry=0;
3604 res=
kNF(null,Q,res1);
3609 if (
idElem(res)<=1) need_retry=0;
3620 #ifdef MORA_USE_BUCKETS BOOLEAN rHasLocalOrMixedOrdering(const ring r)
#define pSetmComp(p)
TODO:
void initEcartPairBba(LObject *Lp, poly, poly, int, int)
void updateT(kStrategy strat)
poly k_NF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce, const ring _currRing)
NOTE: this is just a wrapper which sets currRing for the actual kNF call.
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
ideal SCAQuotient(const ring r)
KINLINE TObject ** initR()
poly redtail(LObject *L, int pos, kStrategy strat)
void enterSSba(LObject &p, int atS, kStrategy strat, int atR)
poly kNF2Bound(ideal F, ideal Q, poly q, int bound, kStrategy strat, int lazyReduce)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
int redRing(LObject *h, kStrategy strat)
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 CanonicalForm bound(const CFMatrix &M)
int posInT2(const TSet set, const int length, LObject &p)
static poly redMoraNFRing(poly h, kStrategy strat, int flag)
int redEcart(LObject *h, kStrategy strat)
KINLINE unsigned long * initsevT()
#define TEST_OPT_DEGBOUND
void initBuchMoraPos(kStrategy strat)
BOOLEAN(* rewCrit1)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
static BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
pLDegProc pOrigLDeg_TailRing
void initMora(ideal F, kStrategy strat)
#define idDelete(H)
delete an ideal
void messageStat(int hilbcount, kStrategy strat)
void kEcartWeights(poly *s, int sl, short *eweight, const ring R)
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly, kStrategy strat, int start=0)
Compatiblity layer for legacy polynomial operations (over currRing)
ideal kSba(ideal F, ideal Q, tHomog h, intvec **w, int sbaOrder, int arri, intvec *hilb, int syzComp, int newIdeal, intvec *vw)
long totaldegreeWecart(poly p, ring r)
void chainCritNormal(poly p, int ecart, kStrategy strat)
void initBuchMora(ideal F, ideal Q, kStrategy strat)
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
int redFirst(LObject *h, kStrategy strat)
BOOLEAN posInLDependsOnLength
long p_WDegree(poly p, const ring r)
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
static int doRed(LObject *h, TObject *with, BOOLEAN intoT, kStrategy strat, bool redMoraNF)
#define omFreeSize(addr, size)
#define idSimpleAdd(A, B)
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
void initSba(ideal F, kStrategy strat)
static short rVar(const ring r)
#define rVar(r) (r->N)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
long pLDeg0c(poly p, int *l, const ring r)
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
#define TEST_OPT_MULTBOUND
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
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)
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 cancelunit(LObject *L, BOOLEAN inNF)
void WerrorS(const char *s)
void initBba(kStrategy strat)
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
int redSig(LObject *h, kStrategy strat)
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
ideal sba(ideal F0, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
int(* red)(LObject *L, kStrategy strat)
void initBuchMoraPosRing(kStrategy strat)
int redHomog(LObject *h, kStrategy strat)
KINLINE poly redtailBba(poly p, int pos, kStrategy strat, BOOLEAN normalize)
poly p_KillSquares(const poly p, const short iFirstAltVar, const short iLastAltVar, const ring r)
int(* posInT)(const TSet T, const int tl, LObject &h)
void HEckeTest(poly pp, kStrategy strat)
long(* pLDegProc)(poly p, int *length, ring r)
static void p_LmFree(poly p, ring)
#define pGetComp(p)
Component.
void updateL(kStrategy strat)
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
char completeReduce_retry
void kStratInitChangeTailRing(kStrategy strat)
#define TEST_OPT_NOT_BUCKETS
static BOOLEAN rField_has_simple_inverse(const ring r)
pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring, ring)
void enterT(LObject &p, kStrategy strat, int atT)
void missingAxis(int *last, kStrategy strat)
int redHoney(LObject *h, kStrategy strat)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
ideal kStdShift(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, int uptodeg, int lV)
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
int redRiloc(LObject *h, kStrategy strat)
void(* initEcart)(TObject *L)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
int redLazy(LObject *h, kStrategy strat)
void(* enterOnePair)(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
void initS(ideal F, ideal Q, kStrategy strat)
poly kNF2(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
ideal kInterRedBba(ideal F, ideal Q, int &need_retry)
omError_t omTestMemory(int check_level)
void initEcartPairMora(LObject *Lp, poly, poly, int ecartF, int ecartG)
#define TEST_OPT_INTSTRATEGY
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
#define TEST_OPT_STAIRCASEBOUND
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int syzComp
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
void initHilbCrit(ideal, ideal, intvec **hilb, kStrategy strat)
void enterSMora(LObject &p, int atS, kStrategy strat, int atR=-1)
int scMult0Int(ideal S, ideal Q, const ring tailRing)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
poly kNF1(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
void initEcartBBA(TObject *h)
void updateLHC(kStrategy strat)
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
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)
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
long kHomModDeg(poly p, ring r)
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
ideal kInterRed(ideal F, ideal Q)
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject *L)
return -1 if no divisor is found number of first divisor in S, otherwise
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 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
void initBuchMoraCrit(kStrategy strat)
static int si_max(const int a, const int b)
void reorderL(kStrategy strat)
ideal kInterRedOld(ideal F, ideal Q)
void PrintS(const char *s)
void deleteHC(LObject *L, kStrategy strat, BOOLEAN fromNext)
int redSigRing(LObject *h, kStrategy strat)
static long p_MinComp(poly p, ring lmRing, ring tailRing)
static void kOptimizeLDeg(pLDegProc ldeg, kStrategy strat)
int posInT17(const TSet set, const int length, LObject &p)
int(* posInLOld)(const LSet Ls, const int Ll, LObject *Lo, const kStrategy strat)
static unsigned pLength(poly a)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
poly kNFBound(ideal F, ideal Q, poly p, int bound, int syzComp, int lazyReduce)
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static short scaFirstAltVar(ring r)
BOOLEAN rHasMixedOrdering(const ring r)
void enterT_strong(LObject &p, kStrategy strat, int atT)
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
void rChangeCurrRing(ring r)
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
BOOLEAN arriRewCriterion(poly, unsigned long, poly, kStrategy strat, int start=0)
#define TEST_OPT_RETURN_SB
static void p_Delete(poly *p, const ring r)
void khCheck(ideal Q, intvec *w, intvec *hilb, int &eledeg, int &count, kStrategy strat)
ideal idInit(int idsize, int rank)
initialise an ideal / module
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int)
int p_IsPurePower(const poly p, const ring r)
return i, if head depends only on var(i)
void(* chainCrit)(poly p, int ecart, kStrategy strat)
void postReduceByMon(LObject *h, kStrategy strat)
used for GB over ZZ: intermediate reduction by monomial elements background: any known constant eleme...
static BOOLEAN rField_is_Ring(const ring r)
void cleanT(kStrategy strat)
ideal id_KillSquares(const ideal id, const short iFirstAltVar, const short iLastAltVar, const ring r, const bool bSkipZeroes)
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
void firstUpdate(kStrategy strat)
BOOLEAN rHasGlobalOrdering(const ring r)
void khCheckLocInhom(ideal Q, intvec *w, intvec *hilb, int &count, kStrategy strat)
ideal kMin_std(ideal F, ideal Q, tHomog h, intvec **w, ideal &M, intvec *hilb, int syzComp, int reduced)
void pNorm(poly p, const ring R=currRing)
BOOLEAN hasPurePower(const poly p, int last, int *length, kStrategy strat)
void reorderT(kStrategy strat)
BOOLEAN(* s_poly_proc_t)(kStrategy strat)
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
static short scaLastAltVar(ring r)
void updateS(BOOLEAN toT, kStrategy strat)
ideal bbaShift(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat, int uptodeg, int lV)
static bool rIsSCA(const ring r)
void completeReduce(kStrategy strat, BOOLEAN withT)
static poly redMoraNF(poly h, kStrategy strat, int flag)
long kModDeg(poly p, ring r)
void chainCritOpt_1(poly, int, kStrategy strat)
long maxdegreeWecart(poly p, int *l, 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 ...
int idElem(const ideal F)
count non-zero elements
static BOOLEAN kMoraUseBucket(kStrategy strat)
void p_wrp(poly p, ring lmRing, ring tailRing)
void p_Write(poly p, ring lmRing, ring tailRing)
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)
void enterSMoraNF(LObject &p, int atS, kStrategy strat, int atR=-1)
void initEcartNormal(TObject *h)
#define OPT_NOTREGULARITY
#define TEST_OPT_REDTHROUGH
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
static ideal nc_GB(const ideal F, const ideal Q, const intvec *w, const intvec *hilb, kStrategy strat, const ring r)
int(* red2)(LObject *L, kStrategy strat)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
KINLINE poly kNoetherTail()
#define SI_RESTORE_OPT1(A)
KINLINE BOOLEAN arriRewDummy(poly, unsigned long, poly, kStrategy, int)
static BOOLEAN rField_is_numeric(const ring r)
void exitBuchMora(kStrategy strat)
void Werror(const char *fmt,...)
pFDegProc pOrigFDeg_TailRing
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
void kDebugPrint(kStrategy strat)
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int int lazyReduce
ideal mora(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
#define pCopy(p)
return a copy of the poly