12#define MORA_USE_BUCKETS
14#define PRE_INTEGER_CHECK 0
146 if (ret < 0)
return ret;
176 d =
h->GetpFDeg()+
h->ecart;
178 h->SetShortExpVector();
188 ei = strat->
T[
j].ecart;
193 unsigned long not_sev=~h->sev;
194 poly h_t=
h->GetLmTailRing();
195 li = strat->
T[
j].length;
196 if (li<=0) li=strat->
T[
j].GetpLength();
205 if (
i > strat->
tl)
break;
207 if (strat->
T[
i].length<=0) strat->
T[
i].GetpLength();
208 if ((strat->
T[
i].ecart < ei || (strat->
T[
i].ecart == ei &&
209 strat->
T[
i].length < li))
216 if (strat->
T[
i].ecart < ei || (strat->
T[
i].ecart == ei &&
217 strat->
T[
i].length < li))
222 ei = strat->
T[
i].ecart;
223 if (ei <= h->ecart)
break;
224 li = strat->
T[
i].length;
242 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
279 else if (
h->t_p!=
NULL)
298 else if (
h->t_p!=
NULL)
309 h->SetShortExpVector();
314 h->ecart = d-
h->GetpFDeg();
316 h->ecart = d-
h->GetpFDeg()+ei-
h->ecart;
320 h->ecart =
h->pLDeg(strat->
LDegLast) -
h->GetpFDeg();
327 if (strat->
honey)
h->SetLength();
337 d =
h->GetpFDeg()+
h->ecart;
344 && ((d >= reddeg) || (pass > strat->
LazyPass)))
350 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
372 if (
h->pTotalDeg()+
h->ecart >= (
int)strat->
tailRing->bitmask)
377 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
393 d =
h->GetpFDeg()+
h->ecart;
395 h->SetShortExpVector();
414 if (
h->GetLmTailRing() ==
NULL)
423 ei = strat->
T[
j].ecart;
425 if (ei >
h->ecart && ii < strat->tl)
427 li = strat->
T[
j].length;
437 if (
i > strat->
tl)
break;
438 if ((strat->
T[
i].ecart < ei || (strat->
T[
i].ecart == ei &&
439 strat->
T[
i].length < li))
448 if (strat->
T[
i].ecart < ei || (strat->
T[
i].ecart == ei &&
449 strat->
T[
i].length < li))
454 ei = strat->
T[
i].ecart;
455 if (ei <= h->ecart)
break;
456 li = strat->
T[
i].length;
474 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
475 if (at <= strat->Ll &&
pLmCmp(
h->p, strat->
L[strat->
Ll].p) != 0 && !
nEqual(
h->p->coef, strat->
L[strat->
Ll].p->coef))
504 h->SetShortExpVector();
509 h->ecart = d-
h->GetpFDeg();
511 h->ecart = d-
h->GetpFDeg()+ei-
h->ecart;
515 h->ecart =
h->pLDeg(strat->
LDegLast) -
h->GetpFDeg();
518 d =
h->GetpFDeg()+
h->ecart;
525 && ((d >= reddeg) || (pass > strat->
LazyPass)))
531 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
553 if (
h->pTotalDeg()+
h->ecart >= (
int)strat->
tailRing->bitmask)
558 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
574 poly T0p = strat->
T[0].p;
575 int T0ecart = strat->
T[0].ecart;
578 d =
h->GetpFDeg()+
h->ecart;
580 h->SetShortExpVector();
582 &&strat->
T[0].GetpFDeg() == 0
583 && strat->
T[0].length <= 2)
596 && T0ecart <= h->ecart)
616 h->LmDeleteAndIter();
636 if (
h->GetLmTailRing() ==
NULL)
645 ei = strat->
T[
j].ecart;
648 if (ei >
h->ecart && ii < strat->tl)
650 li = strat->
T[
j].length;
660 if (
i > strat->
tl)
break;
661 if ((strat->
T[
i].ecart < ei || (strat->
T[
i].ecart == ei &&
662 strat->
T[
i].length < li))
671 if (strat->
T[
i].ecart < ei || (strat->
T[
i].ecart == ei &&
672 strat->
T[
i].length < li))
677 ei = strat->
T[
i].ecart;
678 if (ei <= h->ecart)
break;
679 li = strat->
T[
i].length;
698 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
699 if (at <= strat->Ll &&
pLmCmp(
h->p, strat->
L[strat->
Ll].p) != 0 && !
nEqual(
h->p->coef, strat->
L[strat->
Ll].p->coef))
728 h->SetShortExpVector();
733 h->ecart = d-
h->GetpFDeg();
735 h->ecart = d-
h->GetpFDeg()+ei-
h->ecart;
739 h->ecart =
h->pLDeg(strat->
LDegLast) -
h->GetpFDeg();
742 d =
h->GetpFDeg()+
h->ecart;
749 && ((d >= reddeg) || (pass > strat->
LazyPass)))
755 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
777 if (
h->pTotalDeg()+
h->ecart >= (
int)strat->
tailRing->bitmask)
782 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
797 if (strat->
tl<0)
return 1;
798 if (
h->IsNull())
return 0;
806 reddeg = d =
h->GetpFDeg();
812 h->SetShortExpVector();
818 h->SetDegStuffReturnLDeg(strat->
LDegLast);
859 else if (
h->t_p!=
NULL)
878 else if (
h->t_p!=
NULL)
887 h->SetShortExpVector();
900 h->SetDegStuffReturnLDeg(strat->
LDegLast);
910 if (strat->
T[
j].ecart <=
h->ecart)
911 h->ecart = d -
h->GetpFDeg();
913 h->ecart = d -
h->GetpFDeg() + strat->
T[
j].ecart -
h->ecart;
915 d =
h->GetpFDeg() +
h->ecart;
918 d =
h->SetDegStuffReturnLDeg(strat->
LDegLast);
928 && ((d >= reddeg) || (pass > strat->
LazyPass)))
933 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
957 if (
h->pTotalDeg()+
h->ecart >= (
int)strat->
tailRing->bitmask)
962 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
983 int o =
H.SetpFDeg();
998 unsigned long not_sev = ~ H.sev;
1004 int ei = strat->
T[
j].ecart;
1005 int li = strat->
T[
j].length;
1016 if (
j > strat->
tl)
break;
1017 if (ei <=
H.ecart)
break;
1018 if (((strat->
T[
j].ecart < ei)
1019 || ((strat->
T[
j].ecart == ei)
1020 && (strat->
T[
j].length < li)))
1028 ei = strat->
T[
j].ecart;
1029 li = strat->
T[
j].length;
1087 poly T0p = strat->
T[0].p;
1088 int T0ecart = strat->
T[0].ecart;
1089 int o =
H.SetpFDeg();
1093 unsigned long not_sev = ~ H.sev;
1094 if (strat->
T[0].GetpFDeg() == 0 && strat->
T[0].length <= 2)
1112 && (T0ecart <=
H.ecart))
1147 int ei = strat->
T[
j].ecart;
1148 int li = strat->
T[
j].length;
1159 if (
j > strat->
tl)
break;
1160 if (ei <=
H.ecart)
break;
1161 if (((strat->
T[
j].ecart < ei)
1162 || ((strat->
T[
j].ecart == ei)
1163 && (strat->
T[
j].length < li)))
1172 ei = strat->
T[
j].ecart;
1173 li = strat->
T[
j].length;
1227 for (
i=1;
i<=strat->
Ll;
i++)
1229 at = strat->
posInL(strat->
L,
i-1,&(strat->
L[
i]),strat);
1233 for (
j=
i-1;
j>=at;
j--) strat->
L[
j+1] = strat->
L[
j];
1249 for (
i=1;
i<=strat->
tl;
i++)
1251 if (strat->
T[
i-1].length > strat->
T[
i].length)
1254 sev = strat->
sevT[
i];
1260 if (strat->
T[
i].length > strat->
T[at].length)
break;
1262 for (
j =
i-1;
j>at;
j--)
1264 strat->
T[
j+1]=strat->
T[
j];
1266 strat->
R[strat->
T[
j+1].i_r] = &(strat->
T[
j+1]);
1269 strat->
sevT[at+1] = sev;
1270 strat->
R[
p.i_r] = &(strat->
T[at+1]);
1346 if (L->bucket !=
NULL)
1368 int op=
p->GetpFDeg() +
p->ecart;
1376 && (set[
j].GetpFDeg()+set[
j].ecart >= op))
1404 p=strat->
L[strat->
Ll];
1405 strat->
L[strat->
Ll]=strat->
L[
j];
1438 strat->
L[
j].SetLmCurrRing();
1451 p=strat->
L[strat->
Ll];
1452 strat->
L[strat->
Ll]=strat->
L[
j];
1504 if (! strat->
L[
i].IsNull())
1506 strat->
L[
i].SetLmCurrRing();
1507 strat->
L[
i].SetpFDeg();
1509 = strat->
L[
i].pLDeg(strat->
LDegLast) - strat->
L[
i].GetpFDeg();
1515 if (strat->
L[
i].IsNull())
1545 if (
p.p != strat->
T[
i].p)
1573 for (
i=strat->
Ll;
i>=0;
i--)
1575 strat->
L[
i].SetpFDeg();
1577 for (
i=strat->
tl;
i>=0;
i--)
1579 strat->
T[
i].SetpFDeg();
1627 Print(
"new s%d:",atS);
1885 int hilbeledeg=1,hilbcount=0;
1918#ifdef HAVE_TAIL_RING
1932 while (strat->
Ll >= 0)
1939 while (strat->
Ll >= 0)
1944 && (strat->
L[strat->
Ll].ecart+strat->
L[strat->
Ll].GetpFDeg()>
Kstd1_deg))
1951 while ((strat->
Ll >= 0)
1952 && (strat->
L[strat->
Ll].p1!=
NULL) && (strat->
L[strat->
Ll].p2!=
NULL)
1953 && (strat->
L[strat->
Ll].ecart+strat->
L[strat->
Ll].GetpFDeg()>
Kstd1_deg)
1962 if (strat->
Ll<0)
break;
1965 strat->
P = strat->
L[strat->
Ll];
1993 else if (strat->
P.p1 ==
NULL)
2001 if (!strat->
P.IsNull())
2005 message(strat->
P.ecart+strat->
P.GetpFDeg(),&olddeg,&reduc,strat, red_result);
2007 red_result = strat->
red(&strat->
P,strat);
2011 if (! strat->
P.IsNull())
2018 strat->
P.pCleardenom();
2022 strat->
P.p =
redtail(&(strat->
P),strat->
sl,strat);
2023 if (strat->
P.p==
NULL)
2025 WerrorS(
"exponent overflow - wrong ordering");
2034 if ((strat->
P.p->next==
NULL)
2036 strat->
P.pCleardenom();
2038 strat->
P.SetShortExpVector();
2047 posInS(strat,strat->
sl,strat->
P.p, strat->
P.ecart),
2053 khCheck(
Q,
w,hilb,hilbeledeg,hilbcount,strat);
2114 return (strat->
Shdl);
2191 for (
i=strat->
sl;
i>=0;
i--)
2195 for (
i=0;
i<=strat->
sl;
i++)
2331 for (
i=strat->
sl;
i>=0;
i--)
2345 for (
j=0;
j<=strat->
sl;
j++)
2416 return o+(*kModW)[
i-1];
2424 for (
i=r->N;
i>0;
i--)
2429 return j+(*kModW)[
i-1];
2446 ring Zp_ring=
rCopy0(save_ring);
2476 for(
int i=1;
i<save_ring->N;
i++)
2488 return idInit(1,F->rank);
2497 poly resetppNoether =
currRing->ppNoether;
2592 #if PRE_INTEGER_CHECK
2647 r=
mora(FCopy,
Q,*
w,hilb,strat);
2649 r=
bba(FCopy,
Q,*
w,hilb,strat);
2666 r=
mora(F,
Q,*
w,hilb,strat);
2668 r=
bba(F,
Q,*
w,hilb,strat);
2684 currRing->ppNoether=resetppNoether;
2689 int newIdeal,
intvec *vw)
2692 return idInit(1,F->rank);
2792 r=
mora(F,
Q,*
w,hilb,strat);
2800 r=
sba(F,
Q,*
w,hilb,strat);
2827 bool sigdrop =
TRUE;
2829 int totalsbaruns = 1,blockedreductions = 20,blockred = 0,loops = 0;
2830 while(sigdrop && (loops < totalsbaruns || totalsbaruns == -1)
2831 && (blockred <= blockedreductions))
2942 r=
mora(F,
Q,*
w,hilb,strat);
2949 r=
sba(r,
Q,*
w,hilb,strat);
2973 if(sigdrop || blockred > blockedreductions)
2975 r =
kStd(r,
Q,
h,
w, hilb, syzComp, newIdeal, vw);
2990 WerrorS(
"No local ordering possible for shift algebra");
3087 int syzComp,
int reduced)
3092 return idInit(1,F->rank);
3127 strat->
minim=(reduced % 2)+1;
3183 r=
bba(F,
Q,*
w,hilb,strat);
3200 if ((delete_w)&&(temp_w!=
NULL))
delete temp_w;
3208 else if (strat->
M==
NULL)
3211 WarnS(
"no minimal generating set computed");
3237poly
kNF(ideal F, ideal
Q, poly
p,
int syzComp,
int lazyReduce)
3276 WerrorS(
"No local ordering possible for shift algebra");
3335ideal
kNF(ideal F, ideal
Q, ideal
p,
int syzComp,
int lazyReduce)
3382 WerrorS(
"No local ordering possible for shift algebra");
3451poly
k_NF (ideal F, ideal
Q, poly
p,
int syzComp,
int lazyReduce,
const ring _currRing)
3455 poly ret =
kNF(F,
Q,
p, syzComp, lazyReduce);
3509 initS(tempF, tempQ, strat);
3540 ideal shdl=strat->
Shdl;
3615 withT = ! strat->
homog;
3620#ifdef HAVE_TAIL_RING
3625 while (strat->
Ll >= 0)
3632 strat->
P = strat->
L[strat->
Ll];
3635 if (strat->
P.p1 ==
NULL)
3641 if (strat->
P.p ==
NULL && strat->
P.t_p ==
NULL)
3649 &olddeg,&reduc,strat, red_result);
3652 red_result = strat->
red(&strat->
P,strat);
3656 if (red_result == 1)
3662 strat->
P.GetP(strat->
lmBin);
3664 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
3671 strat->
P.pCleardenom();
3687 strat->
enterS(strat->
P, pos, strat, strat->
tl);
3695 for(;ii<=strat->
sl;ii++)
3700 h.p=strat->
S[ii]; strat->
S[ii]=
NULL;
3702 h.sev=strat->
sevS[ii];
3706 if (strat->
T[jj].p==
h.p)
3708 strat->
T[jj].p=
NULL;
3711 memmove(&(strat->
T[jj]),&(strat->
T[jj+1]),
3712 (strat->
tl-jj)*
sizeof(strat->
T[jj]));
3713 memmove(&(strat->
sevT[jj]),&(strat->
sevT[jj+1]),
3714 (strat->
tl-jj)*
sizeof(strat->
sevT[jj]));
3721 int lpos=strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
3726 Print(
"move S[%d] -> L[%d]: ",ii,pos);
3734 for(ii=pos+1;ii<=strat->
sl;ii++) strat->
fromQ[ii]=0;
3772#ifdef HAVE_TAIL_RING
3855 while (need_retry && (counter>0))
3861 int new_elems=
idElem(res1);
3862 counter -= (new_elems >= elems);
3865 if (
idElem(res1)<=1) need_retry=0;
3887#ifdef MORA_USE_BUCKETS
static int si_max(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(* red2)(LObject *L, kStrategy strat)
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
int(* posInLOld)(const LSet Ls, const int Ll, LObject *Lo, const kStrategy strat)
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
char completeReduce_retry
void(* initEcart)(TObject *L)
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)
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
char posInLDependsOnLength
pLDegProc pOrigLDeg_TailRing
static FORCE_INLINE BOOLEAN nCoeff_is_Z(const coeffs r)
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_QuotRem(number a, number b, number *q, const coeffs 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
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
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:...
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
void WerrorS(const char *s)
long scMult0Int(ideal S, ideal Q)
ideal idMinBase(ideal h1, ideal *SB)
#define idDelete(H)
delete an ideal
#define idSimpleAdd(A, B)
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
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
static BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
static BOOLEAN length(leftv result, leftv arg)
KINLINE TObject ** initR()
KINLINE BOOLEAN arriRewDummy(poly, unsigned long, poly, kStrategy, int)
KINLINE unsigned long * initsevT()
int redLiftstd(LObject *h, kStrategy strat)
static ideal nc_GB(const ideal F, const ideal Q, const intvec *w, const intvec *hilb, kStrategy strat, const ring r)
void khCheckLocInhom(ideal Q, intvec *w, intvec *hilb, int &count, kStrategy strat)
void khCheck(ideal Q, intvec *w, intvec *hilb, int &eledeg, int &count, kStrategy strat)
int ksReducePolyLC(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, poly *mon, kStrategy strat, BOOLEAN reduce)
long kHomModDeg(poly p, const ring r)
void reorderT(kStrategy strat)
poly kNFBound(ideal F, ideal Q, poly p, int bound, int syzComp, int lazyReduce)
ideal mora(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
void initMora(ideal F, kStrategy strat)
int redFirst(LObject *h, kStrategy strat)
void firstUpdate(kStrategy strat)
long kModDeg(poly p, const ring r)
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 redEcart(LObject *h, kStrategy strat)
void enterSMoraNF(LObject &p, int atS, kStrategy strat, int atR=-1)
static int kFindLuckyPrime(ideal F, ideal Q)
static int doRed(LObject *h, TObject *with, BOOLEAN intoT, kStrategy strat, bool redMoraNF)
ideal kMin_std(ideal F, ideal Q, tHomog h, intvec **w, ideal &M, intvec *hilb, int syzComp, int reduced)
void updateLHC(kStrategy strat)
ideal kStdShift(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, BOOLEAN rightGB)
void missingAxis(int *last, kStrategy strat)
void reorderL(kStrategy strat)
int posInL10(const LSet set, const int length, LObject *p, const kStrategy strat)
ideal kInterRedBba(ideal F, ideal Q, int &need_retry)
static BOOLEAN kMoraUseBucket(kStrategy strat)
poly kNF1(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
ideal kInterRed(ideal F, const ideal Q)
static void kOptimizeLDeg(pLDegProc ldeg, kStrategy strat)
void initBba(kStrategy strat)
int redRiloc(LObject *h, kStrategy strat)
void initSba(ideal F, kStrategy strat)
static poly redMoraNFRing(poly h, kStrategy strat, int flag)
void kDebugPrint(kStrategy strat)
void enterSMora(LObject &p, int atS, kStrategy strat, int atR=-1)
ideal kInterRedOld(ideal F, const ideal Q)
void updateL(kStrategy strat)
void updateT(kStrategy strat)
BOOLEAN hasPurePower(const poly p, int last, int *length, kStrategy strat)
static poly kTryHC(ideal F, ideal Q)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
static poly redMoraNF(poly h, kStrategy strat, int flag)
int redRiloc_Z(LObject *h, kStrategy strat)
ideal kSba(ideal F, ideal Q, tHomog h, intvec **w, int sbaOrder, int arri, intvec *hilb, int syzComp, int newIdeal, intvec *vw)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
BOOLEAN(* s_poly_proc_t)(kStrategy strat)
int redRing_Z(LObject *h, kStrategy strat)
int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject *L)
return -1 if no divisor is found number of first divisor in S, otherwise
int kTestDivisibleByT0_Z(const kStrategy strat, const LObject *L)
tests if T[0] divides the leading monomial of L, returns -1 if not
poly kNF2(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
int redHoney(LObject *h, kStrategy strat)
int redHomog(LObject *h, kStrategy strat)
ideal sba(ideal F0, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
int redLazy(LObject *h, kStrategy strat)
int redSigRing(LObject *h, kStrategy strat)
int redSig(LObject *h, kStrategy strat)
poly kNF2Bound(ideal F, ideal Q, poly q, int bound, kStrategy strat, int lazyReduce)
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
ideal bbaShift(ideal F, ideal Q, intvec *w, intvec *hilb, 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 posInT17(const TSet set, const int length, LObject &p)
void initBuchMora(ideal F, ideal Q, kStrategy strat)
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int)
void enterT(LObject &p, kStrategy strat, int atT)
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)
BOOLEAN kTest_TS(kStrategy strat)
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR=-1)
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)
int posInT2(const TSet set, const int length, LObject &p)
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
void initHilbCrit(ideal, ideal, intvec **hilb, kStrategy strat)
void initEcartPairMora(LObject *Lp, poly, poly, int ecartF, int ecartG)
void initBuchMoraPos(kStrategy strat)
void initS(ideal F, ideal Q, kStrategy strat)
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject *T, unsigned long expbound)
int posInL0(const LSet set, const int length, LObject *p, const kStrategy)
void chainCritOpt_1(poly, int, kStrategy strat)
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...
void HEckeTest(poly pp, kStrategy strat)
BOOLEAN kTest_L(LObject *L, kStrategy strat, BOOLEAN testp, int lpos, TSet T, int tlength)
void exitBuchMora(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)
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
void cleanT(kStrategy strat)
BOOLEAN kTest_T(TObject *T, kStrategy strat, int i, char TN)
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)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
void kStratInitChangeTailRing(kStrategy strat)
void initBuchMoraCrit(kStrategy strat)
void completeReduce(kStrategy strat, BOOLEAN withT)
void initBuchMoraPosRing(kStrategy strat)
void messageSets(kStrategy strat)
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 chainCritNormal(poly p, int ecart, kStrategy strat)
void initEcartBBA(TObject *h)
void initEcartPairBba(LObject *Lp, poly, poly, int, int)
void messageStat(int hilbcount, kStrategy strat)
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)
BOOLEAN newHEdge(kStrategy strat)
void cancelunit(LObject *L, BOOLEAN inNF)
static void kDeleteLcm(LObject *P)
static bool rIsSCA(const ring r)
ideal id_KillSquares(const ideal id, const short iFirstAltVar, const short iLastAltVar, const ring r, const bool bSkipZeroes)
poly p_KillSquares(const poly p, const short iFirstAltVar, const short iLastAltVar, const ring r)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
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)
number ndQuotRem(number a, number b, number *r, const coeffs R)
#define omFreeSize(addr, size)
omError_t omTestMemory(int check_level)
#define TEST_OPT_INTSTRATEGY
#define SI_RESTORE_OPT1(A)
#define OPT_NOTREGULARITY
#define TEST_OPT_DEGBOUND
#define TEST_OPT_RETURN_SB
#define TEST_OPT_MULTBOUND
#define TEST_OPT_REDTHROUGH
#define TEST_OPT_REDTAIL_SYZ
#define TEST_OPT_STAIRCASEBOUND
#define TEST_OPT_NOT_BUCKETS
pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring, ring)
int p_IsPurePower(const poly p, const ring r)
return i, if head depends only on var(i)
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
long pLDeg0c(poly p, int *l, const ring r)
long pLDeg0(poly p, int *l, const ring r)
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
long p_WDegree(poly p, const ring r)
static int pLength(poly a)
static void p_LmDelete(poly p, const ring r)
static long p_FDeg(const poly p, const ring r)
static long p_MinComp(poly p, ring lmRing, ring tailRing)
#define pp_Test(p, lmRing, tailRing)
static long p_IncrExp(poly p, int v, ring r)
static void p_Setm(poly p, 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:
static void p_Delete(poly *p, 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)
static long pTotaldegree(poly p)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
#define pIsConstant(p)
like above, except that Comp must be 0
#define pGetComp(p)
Component.
#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 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....
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
#define pSetmComp(p)
TODO:
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
#define pCopy(p)
return a copy of the poly
void PrintS(const char *s)
void Werror(const char *fmt,...)
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...
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
void rDelete(ring r)
unconditionally deletes fields in r
BOOLEAN rOrd_is_ds(const ring r)
static BOOLEAN rField_is_Z(const ring r)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
long(* pLDegProc)(poly p, int *length, ring r)
static BOOLEAN rIsLPRing(const ring r)
static BOOLEAN rField_is_Q(const ring r)
static BOOLEAN rIsNCRing(const ring r)
static BOOLEAN rField_is_numeric(const ring r)
BOOLEAN rHasMixedOrdering(const ring r)
static short rVar(const ring r)
#define rVar(r) (r->N)
BOOLEAN rHasGlobalOrdering(const ring r)
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
static BOOLEAN rField_has_simple_inverse(const ring r)
#define rField_is_Ring(R)
ideal SCAQuotient(const ring r)
static short scaLastAltVar(ring r)
static short scaFirstAltVar(ring r)
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
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
ideal id_PermIdeal(ideal I, int R, int C, const int *perm, const ring src, const ring dst, nMapFunc nMap, const int *par_perm, int P, BOOLEAN use_mult)
mapping ideals/matrices to other rings
static int idElem(const ideal F)
number of non-zero polys in F
long totaldegreeWecart(poly p, ring r)
long maxdegreeWecart(poly p, int *l, ring r)
void kEcartWeights(poly *s, int sl, short *eweight, const ring R)
EXTERN_VAR short * ecartWeights