30#define setmaxL ((4096-12)/sizeof(LObject))
31#define setmaxLinc ((4096)/sizeof(LObject))
33#define setmaxT ((4096-12)/sizeof(TObject))
34#define setmaxTinc ((4096)/sizeof(TObject))
36#define RED_CANONICALIZE 200
37#define REDNF_CANONICALIZE 60
38#define REDTAIL_CANONICALIZE 100
46#if !defined(KDEBUG) && !defined(NO_INLINE)
114 KINLINE void Set(poly p_in, ring c_r, ring t_r);
131#ifdef OLIVER_PRIVAT_LT
136 KINLINE void GetLt(poly &
p, ring &r)
const;
222 int use_bucket, ring r);
395#define ALLOW_PROD_CRIT(A) (!(A)->no_prod_crit)
397#define ALLOW_PROD_CRIT(A) (1)
449#ifdef HAVE_MORE_POS_IN_T
538#define messageSets(s) do {} while (0)
637 poly &m1, poly &m2,
const ring m_r);
640 poly &m1, poly &m2, poly &
lcm,
const ring taiRing);
656#define kTest(A) (TRUE)
657#define kTest_TS(A) (TRUE)
658#define kTest_T(T,S) (TRUE)
659#define kTest_S(T) (TRUE)
660#define kTest_L(T,R) (TRUE)
669poly
kFindZeroPoly(poly input_p, ring leadRing, ring tailRing);
672poly
kNF2 (ideal F, ideal
Q, poly q,
kStrategy strat,
int lazyReduce);
673ideal
kNF2 (ideal F,ideal
Q,ideal q,
kStrategy strat,
int lazyReduce);
678void f5c (
kStrategy strat,
int& olddeg,
int& minimcnt,
int& hilbeledeg,
679 int& hilbcount,
int& srmax,
int& lrmax,
int& reduc, ideal
Q,
703 poly spNoether =
NULL,
714 poly spNoether =
NULL,
720 poly spNoether =
NULL,
727 poly spNoether =
NULL,
734 poly spNoether =
NULL,
755 poly spNoether =
NULL,
762 poly spNoether =
NULL,
775 poly spNoether =
NULL);
784 int use_buckets=0, ring tailRing=
currRing,
831 unsigned long new_expbound = 0);
853 for(
int i=strat->
Ll;
i>=0;
i--)
855 if (
p==strat->
L[
i].p1)
return i;
int sgn(const Rational &a)
static CanonicalForm bound(const CFMatrix &M)
KINLINE long SetDegStuffReturnLDeg()
KINLINE void Tail_Mult_nn(number n)
KINLINE void LmDeleteAndIter()
KINLINE TObject * T_2(const skStrategy *strat)
KINLINE void PrepareRed(BOOLEAN use_bucket)
KINLINE void CanonicalizeP()
KINLINE void SetLmTail(poly lm, poly new_p, int length, int use_bucket, ring r)
KINLINE void T_1_2(const skStrategy *strat, TObject *&T_1, TObject *&T_2)
KINLINE void Init(ring tailRing=currRing)
KINLINE TObject * T_1(const skStrategy *strat)
KINLINE int SetLength(BOOLEAN lengt_pLength=FALSE)
KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether)
KINLINE void ShallowCopyDelete(ring new_tailRing, pShallowCopyDeleteProc p_shallow_copy_delete)
KINLINE sLObject & operator=(const sTObject &)
KINLINE void SetShortExpVector()
KINLINE void HeadNormalize()
KINLINE poly GetP(omBin lmBin=(omBin) NULL)
KINLINE poly LmExtractAndIter()
KINLINE poly GetLm(ring r)
KINLINE poly GetLmCurrRing()
KINLINE void Init(ring r=currRing)
KINLINE void Mult_nn(number n)
KINLINE long SetDegStuffReturnLDeg()
KINLINE poly GetLmTailRing()
KINLINE void pCleardenom()
KINLINE long GetpFDeg() const
KINLINE void ShallowCopyDelete(ring new_tailRing, omBin new_tailBin, pShallowCopyDeleteProc p_shallow_copy_delete, BOOLEAN set_max=TRUE)
KINLINE void SetLmCurrRing()
KINLINE void LmDeleteAndIter()
KINLINE long pFDeg() const
KINLINE BOOLEAN IsNull() const
KINLINE void Set(ring r=currRing)
KINLINE long pTotalDeg() const
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)
KINLINE TObject * s_2_t(int i)
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)
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)
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
char posInLDependsOnLength
int(* posInLSba)(const LSet set, const int length, LObject *L, const kStrategy strat)
pLDegProc pOrigLDeg_TailRing
CFArray copy(const CFList &list)
write elements of list into an array
static BOOLEAN length(leftv result, leftv arg)
BOOLEAN(* s_poly_proc_t)(kStrategy strat)
int posInLF5C(const LSet set, const int length, LObject *L, const kStrategy strat)
KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r=currRing)
void initSbaPos(kStrategy strat)
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
BOOLEAN findMinLMPair(poly sig, unsigned long not_sevSig, kStrategy strat, int start)
int ksReducePolyGCD(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
int ksReducePolyLC(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
void initenterpairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
int posInSyz(const kStrategy strat, const poly sig)
int redLiftstd(LObject *h, kStrategy strat)
int ksReducePolyBound(LObject *PR, TObject *PW, int bound, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
int kFindDivisibleByInT(const kStrategy strat, const LObject *L, const int start=0)
return -1 if no divisor is found number of first divisor in T, otherwise
int redRing_Z(LObject *h, kStrategy strat)
int posInT17(const TSet set, const int length, LObject &p)
int posInL13(const LSet set, const int length, LObject *L, const kStrategy strat)
void initBuchMora(ideal F, ideal Q, kStrategy strat)
void initEcartPairBba(LObject *Lp, poly f, poly g, int ecartF, int ecartG)
denominator_list_s * denominator_list
poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing)
int redFirstShift(LObject *h, kStrategy strat)
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
void enterSyz(LObject &p, kStrategy strat, int atT)
int posInL15(const LSet set, const int length, LObject *L, const kStrategy strat)
int redNF0(LObject *P, kStrategy strat)
int posInT11(const TSet set, const int length, LObject &p)
int posInLSigRing(const LSet set, const int length, LObject *L, const kStrategy strat)
int ksReducePolySigRing(LObject *PR, TObject *PW, long idx, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
int posInTSig(const TSet set, const int length, LObject &p)
int posInT1(const TSet set, const int length, LObject &p)
EXTERN_VAR int(* test_PosInT)(const TSet T, const int tl, LObject &h)
int ksReducePolySig(LObject *PR, TObject *PW, long idx, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
void enterT_strong(LObject &p, kStrategy strat, int atT=-1)
BOOLEAN kTest(kStrategy strat)
void chainCritSig(poly p, int ecart, kStrategy strat)
int posInT_EcartpLength(const TSet set, const int length, LObject &p)
BOOLEAN kTest_TS(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 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)
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, poly *mon=NULL, kStrategy strat=NULL, BOOLEAN redtail=FALSE)
int kTestDivisibleByT0_Z(const kStrategy strat, const LObject *L)
tests if T[0] divides the leading monomial of L, returns -1 if not
BOOLEAN kTest_L(LObject *L, kStrategy strat, BOOLEAN testp=FALSE, int lpos=-1, TSet T=NULL, int tlength=-1)
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
int posInL17(const LSet set, const int length, LObject *L, const kStrategy strat)
void enterT(LObject &p, kStrategy strat, int atT=-1)
int kFindSameLMInT_Z(const kStrategy strat, const LObject *L, const int start=0)
void enterTShift(LObject p, kStrategy strat, int atT=-1)
int posInT2(const TSet set, const int length, LObject &p)
int posInL15Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
void superenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR=-1)
int posInT_pLength(const TSet set, const int length, LObject &p)
void completeReduce(kStrategy strat, BOOLEAN withT=FALSE)
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
static int kFindInL1(const poly p, const kStrategy strat)
int posInT13(const TSet set, const int length, LObject &p)
void redtailBbaAlsoLC_Z(LObject *L, int end_pos, kStrategy strat)
poly kNF2(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat)
void deleteHC(poly *p, int *e, int *l, kStrategy strat)
int posInSMonFirst(const kStrategy strat, const int length, const poly p)
KINLINE BOOLEAN arriRewDummy(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
ideal sba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
EXTERN_VAR denominator_list DENOMINATOR_LIST
void initBuchMoraPos(kStrategy strat)
void initS(ideal F, ideal Q, kStrategy strat)
int posInIdealMonFirst(const ideal F, const poly p, int start=0, int end=-1)
KINLINE poly redtailBbaBound(poly p, int end_pos, kStrategy strat, int bound, BOOLEAN normalize=FALSE)
int redHoney(LObject *h, kStrategy strat)
poly preIntegerCheck(ideal F, ideal Q)
used for GB over ZZ: look for constant and monomial elements in the ideal background: any known const...
KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin bin)
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L=NULL, TObject *T=NULL, unsigned long new_expbound=0)
int posInLSig(const LSet set, const int length, LObject *L, const kStrategy strat)
KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
int posInL11(const LSet set, const int length, LObject *L, const kStrategy strat)
void chainCritOpt_1(poly, int, kStrategy strat)
int kFindNextDivisibleByInS(const kStrategy strat, int start, int max_ind, LObject *L)
static LSet initL(int nr=setmaxL)
void cancelunit(LObject *p, BOOLEAN inNF=FALSE)
EXTERN_VAR int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
int posInL11Ringls(const LSet set, const int length, LObject *L, const kStrategy strat)
KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
KINLINE poly redtailBba_Ring(poly p, int end_pos, kStrategy strat)
int kFindDivisibleByInT_Z(const kStrategy strat, const LObject *L, const int start=0)
int redHomog(LObject *h, kStrategy strat)
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 kFreeStrat(kStrategy strat)
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)
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
int redLazy(LObject *h, kStrategy strat)
void enterExtendedSpolySig(poly h, poly hSig, kStrategy strat)
void enterpairsSig(poly h, poly hSig, int from, int k, int ec, int pos, kStrategy strat, int atR=-1)
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin bin)
void initBba(kStrategy strat)
void exitBuchMora(kStrategy strat)
void messageStatSBA(int hilbcount, kStrategy strat)
int redRiloc(LObject *h, kStrategy strat)
void initEcartNormal(TObject *h)
static void kDeleteLcm(LObject *P)
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
void updateS(BOOLEAN toT, kStrategy strat)
int posInL0(const LSet set, const int length, LObject *L, const kStrategy strat)
int redSigRing(LObject *h, kStrategy strat)
void initSLSba(ideal F, ideal Q, kStrategy strat)
TObject * kFindDivisibleByInS_T(kStrategy strat, int end_pos, LObject *L, TObject *T, long ecart=LONG_MAX)
void enterSBbaShift(LObject &p, int atS, kStrategy strat, int atR=-1)
void initSba(ideal F, kStrategy strat)
int ksReducePolyTail(LObject *PR, TObject *PW, poly Current, poly spNoether=NULL)
void initSyzRules(kStrategy strat)
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
void cleanT(kStrategy strat)
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring taiRing)
int posInT110(const TSet set, const int length, LObject &p)
BOOLEAN kTest_S(kStrategy strat)
KINLINE TObject ** initR()
void replaceInLAndSAndT(LObject &p, int tj, kStrategy strat)
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
void reorderS(int *suc, kStrategy strat)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether=NULL)
void enterExtendedSpoly(poly h, kStrategy strat)
void enterpairs(poly h, int k, int ec, int pos, kStrategy strat, int atR=-1)
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR=-1)
int redSig(LObject *h, kStrategy strat)
KINLINE poly redtailBba_Z(poly p, int end_pos, kStrategy strat)
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether=NULL)
int posInL10(const LSet set, const int length, LObject *L, const kStrategy strat)
KINLINE poly redtailBba(poly p, int end_pos, kStrategy strat, BOOLEAN normalize=FALSE)
void updateResult(ideal r, ideal Q, kStrategy strat)
int posInT0(const TSet set, const int length, LObject &p)
int posInT19(const TSet set, const int length, LObject &p)
poly redtailBba_NF(poly p, kStrategy strat)
void exitSba(kStrategy strat)
ring sbaRing(kStrategy strat, const ring r=currRing, BOOLEAN complete=TRUE, int sgn=1)
BOOLEAN enterOnePairShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS)
void enterSSba(LObject &p, int atS, kStrategy strat, int atR=-1)
void kDebugPrint(kStrategy strat)
Output some debug info about a given strategy.
void f5c(kStrategy strat, int &olddeg, int &minimcnt, int &hilbeledeg, int &hilbcount, int &srmax, int &lrmax, int &reduc, ideal Q, intvec *w, intvec *hilb)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
void initHilbCrit(ideal F, ideal Q, intvec **hilb, kStrategy strat)
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether=NULL, ring r=currRing)
void kStratInitChangeTailRing(kStrategy strat)
BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
void initBuchMoraCrit(kStrategy strat)
void initBuchMoraPosRing(kStrategy strat)
poly kNF2Bound(ideal F, ideal Q, poly q, int bound, kStrategy strat, int lazyReduce)
int kFindInTShift(poly p, TSet T, int tlength)
void postReduceByMonSig(LObject *h, kStrategy strat)
void ksCreateSpoly(LObject *Pair, poly spNoether=NULL, int use_buckets=0, ring tailRing=currRing, poly m1=NULL, poly m2=NULL, TObject **R=NULL)
int posInL11Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
void enterSBba(LObject &p, int atS, kStrategy strat, int atR=-1)
void messageSets(kStrategy strat)
int redRing(LObject *h, kStrategy strat)
void deleteInS(int i, kStrategy strat)
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
BOOLEAN sbaCheckGcdPair(LObject *h, kStrategy strat)
int posInL110(const LSet set, const int length, LObject *L, const kStrategy strat)
poly redtail(poly p, int end_pos, kStrategy strat)
int posInL10Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
void initEcartPairMora(LObject *Lp, poly f, poly g, int ecartF, int ecartG)
void superenterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
void entersets(LObject h)
void chainCritNormal(poly p, int ecart, kStrategy strat)
void initEcartBBA(TObject *h)
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
ideal bbaShift(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
int posInLF5CRing(const LSet set, int start, const int length, LObject *L, const kStrategy strat)
int ksReducePolyZ(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
poly redNFTail(poly h, const int sl, kStrategy strat)
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
void messageStat(int hilbcount, kStrategy strat)
int redHoneyM(LObject *h, kStrategy strat)
void initSL(ideal F, ideal Q, kStrategy strat)
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
BOOLEAN kTest_T(TObject *T, kStrategy strat, int tpos=-1, char TN='?')
void initSbaCrit(kStrategy strat)
BOOLEAN newHEdge(kStrategy strat)
BOOLEAN homogTest(polyset F, int Fmax)
poly redtailSba(LObject *L, int end_pos, kStrategy strat, BOOLEAN withT=FALSE, BOOLEAN normalize=FALSE)
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
KINLINE unsigned long * initsevT()
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
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 pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
long(* pFDegProc)(poly p, ring r)
long(* pLDegProc)(poly p, int *length, 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...
#define rField_is_Ring(R)
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)