kutil.h
Go to the documentation of this file.
1 #ifndef KUTIL_H
2 #define KUTIL_H
3 /****************************************
4 * Computer Algebra System SINGULAR *
5 ****************************************/
6 /*
7 * ABSTRACT: kernel: utils for kStd
8 */
9 
10 
11 #include <string.h>
12 
13 #include <omalloc/omalloc.h>
14 #include <omalloc/omallocClass.h>
15 #include <misc/mylimits.h>
16 
17 
18 #include <kernel/polys.h>
20 
21 #include <kernel/structs.h>
22 #include <kernel/GBEngine/kstd1.h> /* for s_poly_proc_t */
23 
24 // define if tailrings should be used
25 #define HAVE_TAIL_RING
26 
27 #if 1
28 #define setmax 16
29 #define setmaxL ((4096-12)/sizeof(LObject))
30 #define setmaxLinc ((4096)/sizeof(LObject))
31 
32 #define setmaxT 64
33 #define setmaxTinc 32
34 #else
35 #define setmax 16
36 #define setmaxL 16
37 #define setmaxLinc 16
38 #define setmaxT 16
39 #define setmaxTinc 16
40 #endif
41 
42 // if you want std computations as in Singular version < 2:
43 // This disables RedThrough, tailReductions against T (bba),
44 // sets posInT = posInT15 (bba, strat->honey), and enables redFirst with LDeg
45 // NOTE: can be achieved with option(oldStd)
46 
47 #undef NO_KINLINE
48 #if !defined(KDEBUG) && !defined(NO_INLINE)
49 #define KINLINE inline
50 #else
51 #define KINLINE
52 #define NO_KINLINE 1
53 #endif
54 
55 typedef int* intset;
56 typedef int64 wlen_type;
58 
59 typedef class sTObject TObject;
60 typedef class sLObject LObject;
61 typedef TObject * TSet;
62 typedef LObject * LSet;
63 
66 
69 
70 class sTObject
71 {
72 public:
73  unsigned long sevSig;
74  poly sig; // the signature of the element
75  poly p; // Lm(p) \in currRing Tail(p) \in tailRing
76  poly t_p; // t_p \in tailRing: as monomials Lm(t_p) == Lm(p)
77  poly max_exp; // p_GetMaxExpP(pNext(p))
78  ring tailRing;
79  long FDeg; // pFDeg(p)
80  int ecart,
81  length, // as of pLDeg
82  pLength, // either == 0, or == pLength(p)
83  i_r; // index of TObject in R set, or -1 if not in T
84  BOOLEAN is_normalized; // true, if pNorm was called on p, false otherwise
85  // used in incremental sba() with F5C:
86  // we know some of the redundant elements in
87  // strat->T beforehand, so we can just discard
88  // them and do not need to consider them in the
89  // interreduction process
91  // used in sba's sig-safe reduction:
92  // sometimes we already know that a reducer
93  // is sig-safe, so no need for a real
94  // sig-safeness check
96 
97 
98 #ifdef HAVE_PLURAL
99  BOOLEAN is_special; // true, it is a new special S-poly (e.g. for SCA)
100 #endif
101 
102  // initialization
103  KINLINE void Init(ring r = currRing);
104  KINLINE sTObject(ring tailRing = currRing);
105  KINLINE sTObject(poly p, ring tailRing = currRing);
106  KINLINE sTObject(poly p, ring c_r, ring tailRing);
107  KINLINE sTObject(sTObject* T, int copy);
108 
109  KINLINE void Set(ring r=currRing);
110  KINLINE void Set(poly p_in, ring r=currRing);
111  KINLINE void Set(poly p_in, ring c_r, ring t_r);
112 
113  // Frees the polys of T
114  KINLINE void Delete();
115  // Sets polys to NULL
116  KINLINE void Clear();
117  // makes a copy of the poly of T
118  KINLINE void Copy();
119 
120  // ring-dependent Lm access: these might result in allocation of monomials
121  KINLINE poly GetLmCurrRing();
122  KINLINE poly GetLmTailRing();
123  KINLINE poly GetLm(ring r);
124  // this returns Lm and ring r (preferably from tailRing), but does not
125  // allocate a new poly
126  KINLINE void GetLm(poly &p, ring &r) const;
127 
128 #ifdef OLIVER_PRIVAT_LT
129  // routines for calc. with rings
130  KINLINE poly GetLtCurrRing();
131  KINLINE poly GetLtTailRing();
132  KINLINE poly GetLt(ring r);
133  KINLINE void GetLt(poly &p, ring &r) const;
134 #endif
135 
136  KINLINE BOOLEAN IsNull() const;
137 
138  KINLINE int GetpLength();
139 
140  // makes sure that T.p exists
141  KINLINE void SetLmCurrRing();
142 
143  // Iterations
144  // simply get the next monomial
145  KINLINE poly Next();
146  KINLINE void LmDeleteAndIter();
147 
148  // deg stuff
149  // compute pTotalDegree
150  KINLINE long pTotalDeg() const;
151  // computes pFDeg
152  KINLINE long pFDeg() const;
153  // computes and sets FDeg
154  KINLINE long SetpFDeg();
155  // gets stored FDeg
156  KINLINE long GetpFDeg() const;
157 
158  // computes pLDeg
159  KINLINE long pLDeg();
160  // sets length, FDeg, returns LDeg
161  KINLINE long SetDegStuffReturnLDeg();
162 
163  // arithmetic
164  KINLINE void Mult_nn(number n);
165  KINLINE void ShallowCopyDelete(ring new_tailRing, omBin new_tailBin,
166  pShallowCopyDeleteProc p_shallow_copy_delete,
167  BOOLEAN set_max = TRUE);
168  // manipulations
169  KINLINE void pNorm();
170  KINLINE void pCleardenom();
171 
172 #ifdef KDEBUG
173  void wrp();
174 #endif
175 };
176 
177 extern int strat_nr;
178 
179 class sLObject : public sTObject
180 {
181 
182 public:
183  unsigned long sev;
184  poly p1,p2; /*- the pair p comes from,
185  lm(pi) in currRing, tail(pi) in tailring -*/
186 
187  poly lcm; /*- the lcm of p1,p2 -*/
189  int i_r1, i_r2;
190  unsigned checked; // this is the index of S up to which
191  // the corresponding LObject was already checked in
192  // critical pair creation => when entering the
193  // reduction process it is enough to start a second
194  // rewritten criterion check from checked+1 onwards
196  // NOTE: If prod_crit = TRUE then the corresponding pair is
197  // detected by Buchberger's Product Criterion and can be
198  // deleted
199 
200  // initialization
201  KINLINE void Init(ring tailRing = currRing);
204  KINLINE sLObject(poly p, ring c_r, ring tailRing);
205 
206  // Frees the polys of L
207  KINLINE void Delete();
208  KINLINE void Clear();
209 
210  // Iterations
211  KINLINE void LmDeleteAndIter();
212  KINLINE poly LmExtractAndIter();
213 
214  // spoly related things
215  // preparation for reduction if not spoly
216  KINLINE void PrepareRed(BOOLEAN use_bucket);
217  KINLINE void SetLmTail(poly lm, poly new_p, int length,
218  int use_bucket, ring r);
219  KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether);
220  KINLINE void Tail_Mult_nn(number n);
221  // deletes bucket, makes sure that p and t_p exists
222  KINLINE poly GetP(omBin lmBin = NULL);
223  // similar, except that only t_p exists
224  KINLINE poly GetTP();
225 
226  // does not delete bucket, just canonicalizes it
227  // returned poly is such that Lm(p) \in currRing, Tail(p) \in tailRing
228  KINLINE poly CanonicalizeP();
229 
230  // makes a copy of the poly of L
231  KINLINE void Copy();
232 
233  KINLINE int GetpLength();
234  KINLINE long pLDeg(BOOLEAN use_last);
235  KINLINE long pLDeg();
236  KINLINE int SetLength(BOOLEAN lengt_pLength = FALSE);
237  KINLINE long SetDegStuffReturnLDeg();
238  KINLINE long SetDegStuffReturnLDeg(BOOLEAN use_last);
239 
240  // returns minimal component of p
241  KINLINE long MinComp();
242  // returns component of p
243  KINLINE long Comp();
244 
245  KINLINE void ShallowCopyDelete(ring new_tailRing,
246  pShallowCopyDeleteProc p_shallow_copy_delete);
247 
248  // sets sev
249  KINLINE void SetShortExpVector();
250 
251  // enable assignment from TObject
252  KINLINE sLObject& operator=(const sTObject&);
253 
254  // get T's corresponding to p1, p2: they might return NULL
255  KINLINE TObject* T_1(const skStrategy* strat);
256  KINLINE TObject* T_2(const skStrategy* strat);
257  KINLINE void T_1_2(const skStrategy* strat,
258  TObject* &T_1, TObject* &T_2);
259 
260  // simplify coefficients
261  KINLINE void Normalize();
262  KINLINE void HeadNormalize();
263 };
264 
265 
266 extern int HCord;
267 
268 class skStrategy : public omallocClass
269 {
270 public:
272  int (*red)(LObject * L,kStrategy strat);
273  int (*red2)(LObject * L,kStrategy strat);
274  void (*initEcart)(TObject * L);
275  int (*posInT)(const TSet T,const int tl,LObject &h);
276  int (*posInLSba)(const LSet set, const int length,
277  LObject* L,const kStrategy strat);
278  int (*posInL)(const LSet set, const int length,
279  LObject* L,const kStrategy strat);
280  void (*enterS)(LObject &h, int pos,kStrategy strat, int atR/* =-1*/ );
281  void (*initEcartPair)(LObject * h, poly f, poly g, int ecartF, int ecartG);
282  int (*posInLOld)(const LSet Ls,const int Ll,
283  LObject* Lo,const kStrategy strat);
284  void (*enterOnePair) (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR /*= -1*/);
285  void (*chainCrit) (poly p,int ecart,kStrategy strat);
286  BOOLEAN (*syzCrit) (poly sig, unsigned long not_sevSig, kStrategy strat);
287  BOOLEAN (*rewCrit1) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
288  BOOLEAN (*rewCrit2) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
289  BOOLEAN (*rewCrit3) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
295 
297  ideal Shdl;
298  ideal D; /*V(S) is in D(D)*/
299  ideal M; /*set of minimal generators*/
304  intset fromS; // from which S[i] S[j] comes from
305  // this is important for signature-based
306  // algorithms
307  intset syzIdx;// index in the syz array at which the first
308  // syzygy of component i comes up
309  // important for signature-based algorithms
310  unsigned sbaOrder;
311  int currIdx;
314  wlen_set lenSw; /* for tgb.ccc */
316  unsigned long* sevS;
317  unsigned long* sevSyz;
318  unsigned long* sevSig;
319  unsigned long* sevT;
325  poly t_kHEdge; // same polys in tailring
326  KINLINE poly kNoetherTail();
329  BOOLEAN * pairtest;/*used for enterOnePair*/
333  // procedure for ShalloCopy from tailRing to currRing
335  // pointers to Tobjects R[i] is ith Tobject which is generated
337  // S_2_R[i] yields Tobject which corresponds to S[i]
338  int* S_2_R;
339  ring tailRing;
342  int nr;
343  int cp,c3;
344  int sl,mu;
345  int syzl,syzmax,syzidxmax;
346  int tl,tmax;
347  int Ll,Lmax;
348  int Bl,Bmax;
350  int syzComp;
351  int HCord;
352  int lastAxis;
353  int newIdeal;
354  int minim;
355  #ifdef HAVE_RINGS
356  bool sigdrop; //This is used to check sigdrop in sba over Z
357  int nrsyzcrit; // counts how many pairs are deleted by SyzCrit
358  int nrrewcrit; // counts how many pairs are deleted by FaugereRewCrit
359  int sbaEnterS; // sba over Z strategy: if sigdrop element has _*gen(sbaEnterS+1), then
360  // add directly sbaEnterS elements into S
361  int blockred; // counter for blocked reductions in redSig
363  #endif
364  #ifdef HAVE_SHIFTBBA
365  int lV;
366  int cv; // in shift bases: counting V criterion
367  #endif
370 #ifdef HAVE_PLURAL
371  BOOLEAN z2homog; // Z_2 - homogeneous input allows product criterion in commutative and SCA cases!
372 #endif
381  // if set, pLDeg(p, l) == (pFDeg(pLast(p), pLength)
383  // if set, then L.length == L.pLength
385  // if set, then posInL does not depend on L.length
387  /*FALSE, if posInL == posInL10*/
388 #ifdef HAVE_PLURAL
389  // set this flag to 1 to stop the product criteria
390  // use ALLOW_PROD_CRIT(strat) to test
392 #define ALLOW_PROD_CRIT(A) (!(A)->no_prod_crit)
393 #else
394 #define ALLOW_PROD_CRIT(A) (1)
395 #endif
397  char news;
398  char newt;/*used for messageSets*/
399  char noClearS;
401  char overflow;
402 
403  skStrategy();
404  ~skStrategy();
405 
406  // return TObject corresponding to S[i]: assume that it exists
407  // i.e. no error checking is done
408  KINLINE TObject* S_2_T(int i);
409  // like S_2_T, except that NULL is returned if it can not be found
410  KINLINE TObject* s_2_t(int i);
411 };
412 
413 void deleteHC(poly *p, int *e, int *l, kStrategy strat);
414 void deleteHC(LObject* L, kStrategy strat, BOOLEAN fromNext = FALSE);
415 void deleteInS (int i,kStrategy strat);
416 void deleteInSSba (int i,kStrategy strat);
417 void cleanT (kStrategy strat);
418 static inline LSet initL (int nr=setmaxL)
419 { return (LSet)omAlloc(nr*sizeof(LObject)); }
420 void deleteInL(LSet set, int *length, int j,kStrategy strat);
421 void enterL (LSet *set,int *length, int *LSetmax, LObject p,int at);
422 void enterSBba (LObject &p,int atS,kStrategy strat, int atR = -1);
423 void enterSSba (LObject &p,int atS,kStrategy strat, int atR = -1);
424 void initEcartPairBba (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
425 void initEcartPairMora (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
426 int posInS (const kStrategy strat, const int length, const poly p,
427  const int ecart_p);
428 int posInSMonFirst (const kStrategy strat, const int length, const poly p);
429 int posInIdealMonFirst (const ideal F, const poly p,int start = 0,int end = -1);
430 int posInT0 (const TSet set,const int length,LObject &p);
431 int posInT1 (const TSet set,const int length,LObject &p);
432 int posInT2 (const TSet set,const int length,LObject &p);
433 int posInT11 (const TSet set,const int length,LObject &p);
434 int posInTSig (const TSet set,const int length,LObject &p);
435 int posInT110 (const TSet set,const int length,LObject &p);
436 int posInT13 (const TSet set,const int length,LObject &p);
437 int posInT15 (const TSet set,const int length,LObject &p);
438 int posInT17 (const TSet set,const int length,LObject &p);
439 int posInT17_c (const TSet set,const int length,LObject &p);
440 int posInT19 (const TSet set,const int length,LObject &p);
441 int posInT_EcartpLength(const TSet set,const int length,LObject &p);
442 int posInT_EcartFDegpLength(const TSet set,const int length,LObject &p);
443 int posInT_FDegpLength(const TSet set,const int length,LObject &p);
444 int posInT_pLength(const TSet set,const int length,LObject &p);
445 
446 #ifdef HAVE_MORE_POS_IN_T
447 int posInT_EcartFDegpLength(const TSet set,const int length,LObject &p);
448 int posInT_FDegpLength(const TSet set,const int length,LObject &p);
449 int posInT_pLength(const TSet set,const int length,LObject &p);
450 #endif
451 
452 
453 void reorderS (int* suc,kStrategy strat);
454 int posInLF5C (const LSet set, const int length,
455  LObject* L,const kStrategy strat);
456 int posInLSig (const LSet set, const int length,
457  LObject* L,const kStrategy strat);
458 int posInLSigRing (const LSet set, const int length,
459  LObject* L,const kStrategy strat);
460 int posInLRing (const LSet set, const int length,
461  LObject* L,const kStrategy strat);
462 int posInSyz (const kStrategy strat, const poly sig);
463 int posInL0 (const LSet set, const int length,
464  LObject* L,const kStrategy strat);
465 int posInL11 (const LSet set, const int length,
466  LObject* L,const kStrategy strat);
467 int posInL11Ring (const LSet set, const int length,
468  LObject* L,const kStrategy strat);
469 int posInLF5CRing (const LSet set, int start , const int length,
470  LObject* L,const kStrategy strat);
471 int posInL11Ringls (const LSet set, const int length,
472  LObject* L,const kStrategy strat);
473 int posInL13 (const LSet set, const int length,
474  LObject* L,const kStrategy strat);
475 int posInL15 (const LSet set, const int length,
476  LObject* L,const kStrategy strat);
477 int posInL15Ring (const LSet set, const int length,
478  LObject* L,const kStrategy strat);
479 int posInL17 (const LSet set, const int length,
480  LObject* L,const kStrategy strat);
481 int posInL10 (const LSet set, const int length,
482  LObject* L,const kStrategy strat);
483 int posInL10Ring (const LSet set, const int length,
484  LObject* L,const kStrategy strat);
485 int posInL110 (const LSet set, const int length,
486  LObject* L,const kStrategy strat);
489 #ifdef HAVE_RINGS
490 KINLINE poly redtailBba_Z (poly p,int pos,kStrategy strat);
491 poly redtailBba_Z (LObject* L, int pos, kStrategy strat );
492 #endif
493 poly redtailBba (LObject *L, int pos,kStrategy strat,
495 poly redtailBbaBound (LObject *L, int pos,kStrategy strat,int bound,
497 poly redtailSba (LObject *L, int pos,kStrategy strat,
499 poly redtailBba (TObject *T, int pos,kStrategy strat);
500 poly redtail (poly p,int pos,kStrategy strat);
501 poly redtail (LObject *L,int pos,kStrategy strat);
502 poly redNF (poly h,int & max_ind,int nonorm,kStrategy strat);
503 int redNF0 (LObject *P,kStrategy strat);
504 poly redNFTail (poly h,const int sl,kStrategy strat);
505 int redHoney (LObject* h, kStrategy strat);
506 #ifdef HAVE_RINGS
507 int redRing (LObject* h,kStrategy strat);
508 int redRiloc (LObject* h,kStrategy strat);
509 void enterExtendedSpoly(poly h,kStrategy strat);
510 void enterExtendedSpolySig(poly h,poly hSig,kStrategy strat);
511 void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR = -1);
512 void superenterpairsSig (poly h,poly hSig,int hFrom,int k,int ecart,int pos,kStrategy strat, int atR = -1);
513 poly kCreateZeroPoly(long exp[], long cabsind, poly* t_p, ring leadRing, ring tailRing);
514 long ind2(long arg);
515 
516 long ind_fact_2(long arg);
517 long twoPow(long arg);
518 ideal createG0();
519 #endif
520 int redLazy (LObject* h,kStrategy strat);
521 int redHomog (LObject* h,kStrategy strat);
522 int redSig (LObject* h,kStrategy strat);
523 int redSigRing (LObject* h,kStrategy strat);
524 //adds hSig to be able to check with F5's criteria when entering pairs!
525 void enterpairsSig (poly h, poly hSig, int from, int k, int ec, int pos,kStrategy strat, int atR = -1);
526 void enterpairs (poly h, int k, int ec, int pos,kStrategy strat, int atR = -1);
527 void entersets (LObject h);
528 void pairs ();
529 BOOLEAN enterOneStrongPoly (int i,poly p,int /*ecart*/, int /*isFromQ*/,kStrategy strat, int atR = -1, bool enterTstrong = FALSE);
531 BOOLEAN enterOneStrongPolySig (int i,poly p,poly sig,int /*ecart*/, int /*isFromQ*/,kStrategy strat, int atR = -1);
532 void message (int i,int* reduc,int* olddeg,kStrategy strat,int red_result);
533 void messageStat (int hilbcount,kStrategy strat);
534 void messageStatSBA (int hilbcount,kStrategy strat);
535 #ifdef KDEBUG
536 void messageSets (kStrategy strat);
537 #else
538 #define messageSets(s) do {} while (0)
539 #endif
540 
541 void initEcartNormal (TObject* h);
542 void initEcartBBA (TObject* h);
543 void initS (ideal F, ideal Q,kStrategy strat);
544 void initSL (ideal F, ideal Q,kStrategy strat);
545 void initSLSba (ideal F, ideal Q,kStrategy strat);
546 /*************************************************
547  * when initializing a new bunch of principal
548  * syzygies at the beginning of a new iteration
549  * step in a signature-based algorithm we
550  * compute ONLY the leading elements of those
551  * syzygies, NOT the whole syzygy
552  * NOTE: this needs to be adjusted for a more
553  * general approach on signature-based algorithms
554  ***********************************************/
555 void initSyzRules (kStrategy strat);
556 void updateS(BOOLEAN toT,kStrategy strat);
557 void enterSyz (LObject &p,kStrategy strat, int atT);
558 void enterT (LObject &p,kStrategy strat, int atT = -1);
559 #ifdef HAVE_RINGS
560 void enterT_strong (LObject &p,kStrategy strat, int atT = -1);
561 #endif
562 void cancelunit (LObject* p,BOOLEAN inNF=FALSE);
563 void HEckeTest (poly pp,kStrategy strat);
564 void initBuchMoraCrit(kStrategy strat);
565 void initSbaCrit(kStrategy strat);
566 void initHilbCrit(ideal F, ideal Q, intvec **hilb,kStrategy strat);
567 void initBuchMoraPos(kStrategy strat);
568 void initBuchMoraPosRing(kStrategy strat);
569 void initSbaPos(kStrategy strat);
570 void initBuchMora (ideal F, ideal Q,kStrategy strat);
571 void initSbaBuchMora (ideal F, ideal Q,kStrategy strat);
572 void exitBuchMora (kStrategy strat);
573 void exitSba (kStrategy strat);
574 void updateResult(ideal r,ideal Q,kStrategy strat);
575 void completeReduce (kStrategy strat, BOOLEAN withT=FALSE);
576 void kFreeStrat(kStrategy strat);
577 void enterOnePairNormal (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR);
578 void enterOnePairLift (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR);
579 void enterOnePairSig (int i,poly p,poly pSig,int ecart, int isFromQ,kStrategy strat, int atR);
580 void enterOnePairSigRing (int i,poly p,poly pSig,int ecart, int isFromQ,kStrategy strat, int atR);
581 void chainCritNormal (poly p,int ecart,kStrategy strat);
582 void chainCritOpt_1 (poly,int,kStrategy strat);
583 void chainCritSig (poly p,int ecart,kStrategy strat);
584 BOOLEAN homogTest(polyset F, int Fmax);
585 BOOLEAN newHEdge(kStrategy strat);
586 BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat);
587 BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat);
588 KINLINE BOOLEAN arriRewDummy(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
589 BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
590 BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
591 BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
592 BOOLEAN findMinLMPair(poly sig, unsigned long not_sevSig, kStrategy strat, int start);
593 
594 /// returns index of p in TSet, or -1 if not found
595 int kFindInT(poly p, TSet T, int tlength);
596 
597 /// return -1 if no divisor is found
598 /// number of first divisor in T, otherwise
599 int kFindDivisibleByInT(const kStrategy strat, const LObject* L, const int start=0);
600 
601 /// return -1 if no divisor is found
602 /// number of first divisor in S, otherwise
603 int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject* L);
604 
605 int kFindNextDivisibleByInS(const kStrategy strat, int start,int max_ind, LObject* L);
606 TObject*
607 kFindDivisibleByInS(kStrategy strat, int pos, LObject* L, TObject *T,
608  long ecart = LONG_MAX);
609 
610 /***************************************************************
611  *
612  * stuff to be inlined
613  *
614  ***************************************************************/
615 
616 KINLINE TSet initT ();
617 KINLINE TObject** initR();
618 KINLINE unsigned long* initsevT();
623 
628 
629 // if exp bound is not violated, return TRUE and
630 // get m1 = LCM(LM(p1), LM(p2))/LM(p1)
631 // m2 = LCM(LM(p1), LM(p2))/LM(p2)
632 // return FALSE and m1 == NULL, m2 == NULL , otherwise
633 KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r,
634  poly &m1, poly &m2, const ring m_r);
635 #ifdef HAVE_RINGS
636 KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing,
637  poly &m1, poly &m2, poly &lcm, const ring taiRing);
638 #endif
639 #ifdef KDEBUG
640 // test strat
641 BOOLEAN kTest(kStrategy strat);
642 // test strat, and test that S is contained in T
643 BOOLEAN kTest_TS(kStrategy strat);
644 // test LObject
645 BOOLEAN kTest_L(LObject* L, ring tailRing = NULL,
646  BOOLEAN testp = FALSE, int lpos = -1,
647  TSet T = NULL, int tlength = -1);
648 // test TObject
649 BOOLEAN kTest_T(TObject* T, ring tailRing = NULL, int tpos = -1, char TN = '?');
650 // test set strat->SevS
651 BOOLEAN kTest_S(kStrategy strat);
652 #else
653 #define kTest(A) (TRUE)
654 #define kTest_TS(A) (TRUE)
655 #define kTest_T(T) (TRUE)
656 #define kTest_S(T) (TRUE)
657 #define kTest_L(T) (TRUE)
658 #endif
659 
660 
661 /***************************************************************
662  *
663  * From kstd2.cc
664  *
665  ***************************************************************/
666 poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing);
667 ideal bba (ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat);
668 ideal sba (ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat);
669 poly kNF2 (ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce);
670 ideal kNF2 (ideal F,ideal Q,ideal q, kStrategy strat, int lazyReduce);
671 poly kNF2Bound (ideal F, ideal Q, poly q,int bound, kStrategy strat, int lazyReduce);
672 ideal kNF2Bound (ideal F,ideal Q,ideal q,int bound, kStrategy strat, int lazyReduce);
673 void initBba(kStrategy strat);
674 void initSba(ideal F,kStrategy strat);
675 void f5c (kStrategy strat, int& olddeg, int& minimcnt, int& hilbeledeg,
676  int& hilbcount, int& srmax, int& lrmax, int& reduc, ideal Q,
677  intvec *w,intvec *hilb );
678 
679 /***************************************************************
680  *
681  * From kspoly.cc
682  *
683  ***************************************************************/
684 // Reduces PR with PW
685 // Assumes PR != NULL, PW != NULL, Lm(PW) divides Lm(PR)
686 // Changes: PR
687 // Const: PW
688 // If coef != NULL, then *coef is a/gcd(a,b), where a = LC(PR), b = LC(PW)
689 // If strat != NULL, tailRing is changed if reduction would violate exp bound
690 // of tailRing
691 // Returns: 0 everything ok, no tailRing change
692 // 1 tailRing has successfully changed (strat != NULL)
693 // 2 no reduction performed, tailRing needs to be changed first
694 // (strat == NULL)
695 // -1 tailRing change could not be performed due to exceeding exp
696 // bound of currRing
697 int ksReducePoly(LObject* PR,
698  TObject* PW,
699  poly spNoether = NULL,
700  number *coef = NULL,
701  kStrategy strat = NULL);
702 
703 int ksReducePolyBound(LObject* PR,
704  TObject* PW,
705  int bound,
706  poly spNoether = NULL,
707  number *coef = NULL,
708  kStrategy strat = NULL);
709 
710 // Reduces PR with PW
711 // Assumes PR != NULL, PW != NULL, Lm(PW) divides Lm(PR)
712 // Changes: PR
713 // Const: PW
714 // If coef != NULL, then *coef is a/gcd(a,b), where a = LC(PR), b = LC(PW)
715 // If strat != NULL, tailRing is changed if reduction would violate exp bound
716 // of tailRing
717 // Returns: 0 everything ok, no tailRing change
718 // 1 tailRing has successfully changed (strat != NULL)
719 // 2 no reduction performed, tailRing needs to be changed first
720 // (strat == NULL)
721 // 3 no reduction performed, not sig-safe!!!
722 // -1 tailRing change could not be performed due to exceeding exp
723 // bound of currRing
724 int ksReducePolySig(LObject* PR,
725  TObject* PW,
726  long idx,
727  poly spNoether = NULL,
728  number *coef = NULL,
729  kStrategy strat = NULL);
730 
732  TObject* PW,
733  long idx,
734  poly spNoether = NULL,
735  number *coef = NULL,
736  kStrategy strat = NULL);
737 
738 // Reduces PR at Current->next with PW
739 // Assumes PR != NULL, Current contained in PR
740 // Current->next != NULL, LM(PW) devides LM(Current->next)
741 // Changes: PR
742 // Const: PW
743 // Return: see ksReducePoly
744 int ksReducePolyTail(LObject* PR,
745  TObject* PW,
746  poly Current,
747  poly spNoether = NULL);
748 
749 KINLINE int ksReducePolyTail(LObject* PR, TObject* PW, LObject* Red);
750 
751 // Creates S-Poly of Pair
752 // Const: Pair->p1, Pair->p2
753 // Changes: Pair->p == S-Poly of p1, p2
754 // Assume: Pair->p1 != NULL && Pair->p2
755 void ksCreateSpoly(LObject* Pair, poly spNoether = NULL,
756  int use_buckets=0, ring tailRing=currRing,
757  poly m1 = NULL, poly m2 = NULL, TObject** R = NULL);
758 
759 /*2
760 * creates the leading term of the S-polynomial of p1 and p2
761 * do not destroy p1 and p2
762 * remarks:
763 * 1. the coefficient is 0 (nNew)
764 * 2. pNext is undefined
765 */
767 
768 
769 // old stuff
770 KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether = NULL);
771 KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether = NULL);
772 KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether = NULL, ring r = currRing);
773 KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r = currRing);
774 
775 /***************************************************************
776  *
777  * Routines related for ring changes during std computations
778  *
779  ***************************************************************/
780 // return TRUE and set m1, m2 to k_GetLcmTerms,
781 // if spoly creation of strat->P does not violate
782 // exponent bound of strat->tailRing
783 // FALSE, otherwise
785 #ifdef HAVE_RINGS
786 // return TRUE if gcdpoly creation of R[atR] and S[atS] does not violate
787 // exponent bound of strat->tailRing
788 // FALSE, otherwise
789 BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat);
790 poly preIntegerCheck(ideal F, ideal Q);
791 void postReduceByMon(LObject* h, kStrategy strat);
792 void postReduceByMonSig(LObject* h, kStrategy strat);
793 void finalReduceByMon(kStrategy strat);
794 #endif
795 // change strat->tailRing and adjust all data in strat, L, and T:
796 // new tailRing has larger exponent bound
797 // do nothing and return FALSE if exponent bound increase would result in
798 // larger exponent bound that that of currRing
800  LObject* L = NULL, TObject* T = NULL,
801  // take this as new_expbound: if 0
802  // new expbound is 2*expbound of tailRing
803  unsigned long new_expbound = 0);
804 // initiate a change of the tailRing of strat -- should be called
805 // right before main loop in bba
807 
808 /// Output some debug info about a given strategy
809 void kDebugPrint(kStrategy strat);
810 
811 // getting sb order for sba computations
812 ring sbaRing(kStrategy strat, const ring r=currRing, BOOLEAN complete=TRUE, int sgn=1);
813 
814 KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k,
815  kStrategy strat);
816 
817 #include <kernel/GBEngine/kInline.h>
818 
819 /* shiftgb stuff */
820 #include <kernel/GBEngine/shiftgb.h>
821 
823 
825 
827 
828 void enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV);
829 
830 void initBuchMoraShift (ideal F,ideal Q,kStrategy strat);
831 
832 void enterOnePairManyShifts (int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV); // ok
833 
834 void enterOnePairSelfShifts (poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV);
835 
836 void enterOnePairShift (poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS, int uptodeg, int lV); // ok
837 
838 void enterpairsShift (poly h,int k,int ecart,int pos,kStrategy strat, int atR,int uptodeg, int lV);
839 
840 void initenterpairsShift (poly h,int k,int ecart,int isFromQ,kStrategy strat, int atR,int uptodeg, int lV);
841 
842 void updateSShift(kStrategy strat,int uptodeg,int lV);
843 
844 void initBbaShift(kStrategy strat);
845 
846 poly redtailBbaShift (LObject* L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize);
847 
848 int redFirstShift (LObject* h,kStrategy strat); // ok
849 
850 ideal freegb(ideal I, int uptodeg, int lVblock);
851 
852 ideal bbaShift(ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat, int uptodeg, int lV);
853 // test syz strategy: // will be removed soon
854 extern int (*test_PosInT)(const TSet T,const int tl,LObject &h);
855 extern int (*test_PosInL)(const LSet set, const int length,
856  LObject* L,const kStrategy strat);
857 #endif
KINLINE TObject ** initR()
Definition: kInline.h:92
unsigned long * sevSig
Definition: kutil.h:318
int posInT_pLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:11772
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:11735
BOOLEAN enterOneStrongPolySig(int i, poly p, poly sig, int, int, kStrategy strat, int atR=-1)
Definition: kutil.cc:1711
int kFindInT(poly p, TSet T, int tlength)
returns index of p in TSet, or -1 if not found
Definition: kutil.cc:717
void deleteHC(poly *p, int *e, int *l, kStrategy strat)
Definition: kutil.cc:318
int posInLRing(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6286
denominator_list_s * denominator_list
Definition: kutil.h:65
polyset sig
Definition: kutil.h:302
int posInLSig(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6199
static number Copy(number a, const coeffs r)
Definition: flintcf_Q.cc:229
int nr
Definition: kutil.h:342
CFArray copy(const CFList &list)
write elements of list into an array
void initSba(ideal F, kStrategy strat)
Definition: kstd1.cc:1479
void entersets(LObject h)
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
Definition: syz3.cc:1027
void initSyzRules(kStrategy strat)
Definition: kutil.cc:8389
#define setmaxL
Definition: kutil.h:29
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:711
int posInLF5CRing(const LSet set, int start, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6475
void initSbaCrit(kStrategy strat)
Definition: kutil.cc:9841
omBin_t * omBin
Definition: omStructs.h:12
static CanonicalForm bound(const CFMatrix &M)
Definition: cf_linsys.cc:460
int syzComp
Definition: kutil.h:350
void updateResult(ideal r, ideal Q, kStrategy strat)
Definition: kutil.cc:10410
void mu(int **points, int sizePoints)
BOOLEAN is_redundant
Definition: kutil.h:90
void initEcartNormal(TObject *h)
Definition: kutil.cc:1234
void enterOnePairSelfShifts(poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
Definition: kutil.cc:12248
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
Definition: kutil.cc:7924
int syzmax
Definition: kutil.h:345
void postReduceByMonSig(LObject *h, kStrategy strat)
Definition: kutil.cc:11105
BOOLEAN is_normalized
Definition: kutil.h:84
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether=NULL)
Definition: kInline.h:1053
kBucket_pt bucket
Definition: kutil.h:188
poly kHEdge
Definition: kutil.h:323
BOOLEAN sbaCheckGcdPair(LObject *h, kStrategy strat)
Definition: kutil.cc:1648
int posInT11(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5402
pLDegProc pOrigLDeg_TailRing
Definition: kutil.h:293
class sLObject LObject
Definition: kutil.h:60
BOOLEAN length_pLength
Definition: kutil.h:384
TObject * TSet
Definition: kutil.h:61
bool sigdrop
Definition: kutil.h:356
int posInSMonFirst(const kStrategy strat, const int length, const poly p)
Definition: kutil.cc:5212
int posInL15(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6820
wlen_set lenSw
Definition: kutil.h:314
#define kTest_S(T)
Definition: kutil.h:656
int sgn(const Rational &a)
Definition: GMPrat.cc:437
#define FALSE
Definition: auxiliary.h:94
BOOLEAN noTailReduction
Definition: kutil.h:375
unsigned checked
Definition: kutil.h:190
Compatiblity layer for legacy polynomial operations (over currRing)
int * S_2_R
Definition: kutil.h:338
return P p
Definition: myNF.cc:203
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L=NULL, TObject *T=NULL, unsigned long new_expbound=0)
Definition: kutil.cc:11260
f
Definition: cfModGcd.cc:4022
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:10297
void f5c(kStrategy strat, int &olddeg, int &minimcnt, int &hilbeledeg, int &hilbcount, int &srmax, int &lrmax, int &reduc, ideal Q, intvec *w, intvec *hilb)
Definition: kstd2.cc:3674
int ksReducePolySig(LObject *PR, TObject *PW, long idx, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
Definition: kspoly.cc:315
BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat)
Definition: kutil.cc:7121
poly redtailBbaShift(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
Definition: kutil.cc:12753
char news
Definition: kutil.h:397
int posInT15(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5712
poly preIntegerCheck(ideal F, ideal Q)
used for GB over ZZ: look for constant and monomial elements in the ideal background: any known const...
Definition: kutil.cc:10872
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1654
int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject *L)
return -1 if no divisor is found number of first divisor in S, otherwise
Definition: kstd2.cc:197
int sbaEnterS
Definition: kutil.h:359
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR, int uptodeg, int lV)
Definition: kutil.cc:12605
char newt
Definition: kutil.h:398
void chainCritNormal(poly p, int ecart, kStrategy strat)
Definition: kutil.cc:3253
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
Definition: kspoly.cc:1017
BOOLEAN * NotUsedAxis
Definition: kutil.h:328
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
BOOLEAN posInLDependsOnLength
Definition: kutil.h:386
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
Definition: kInline.h:935
KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
Definition: kInline.h:901
BOOLEAN noetherSet
Definition: kutil.h:377
void enterOnePairManyShifts(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
Definition: kutil.cc:12173
int cv
Definition: kutil.h:366
void messageStat(int hilbcount, kStrategy strat)
Definition: kutil.cc:7965
KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
Definition: kInline.h:885
BOOLEAN * pairtest
Definition: kutil.h:329
int & max_ind
Definition: myNF.cc:67
BOOLEAN z2homog
Definition: kutil.h:371
poly kNoether
Definition: kutil.h:324
void enterExtendedSpolySig(poly h, poly hSig, kStrategy strat)
Definition: kutil.cc:4742
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:1958
long int64
Definition: auxiliary.h:66
void initSbaPos(kStrategy strat)
Definition: kutil.cc:10195
void enterOnePairSig(int i, poly p, poly pSig, int ecart, int isFromQ, kStrategy strat, int atR)
char noClearS
Definition: kutil.h:399
#define TRUE
Definition: auxiliary.h:98
void messageStatSBA(int hilbcount, kStrategy strat)
Definition: kutil.cc:7977
int posInIdealMonFirst(const ideal F, const poly p, int start=0, int end=-1)
Definition: kutil.cc:5289
#define kTest(A)
Definition: kutil.h:653
poly kCreateZeroPoly(long exp[], long cabsind, poly *t_p, ring leadRing, ring tailRing)
Definition: kutil.cc:4415
pShallowCopyDeleteProc p_shallow_copy_delete
Definition: kutil.h:334
unsigned long * sevT
Definition: kutil.h:319
void enterpairsSig(poly h, poly hSig, int from, int k, int ec, int pos, kStrategy strat, int atR=-1)
Definition: kutil.cc:4961
poly pMove2CurrTail(poly p, kStrategy strat)
Definition: kutil.cc:11942
BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat)
Definition: kutil.cc:10849
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR=-1)
Definition: kutil.cc:4898
KINLINE poly redtailBbaBound(poly p, int pos, kStrategy strat, int bound, BOOLEAN normalize=FALSE)
Definition: kInline.h:1097
void initS(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:8042
g
Definition: cfModGcd.cc:4031
poly max_exp
Definition: kutil.h:77
ideal bbaShift(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat, int uptodeg, int lV)
Definition: kstd2.cc:3995
void initHilbCrit(ideal F, ideal Q, intvec **hilb, kStrategy strat)
Definition: kutil.cc:9759
int k
Definition: cfEzgcd.cc:93
P SetShortExpVector()
int(* test_PosInT)(const TSet T, const int tl, LObject &h)
Definition: kstd2.cc:82
void initBuchMora(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:10101
void enterT(LObject &p, kStrategy strat, int atT=-1)
Definition: kutil.cc:9478
#define Q
Definition: sirandom.c:25
long twoPow(long arg)
Definition: kutil.cc:4223
KINLINE unsigned long * initsevT()
Definition: kInline.h:97
void chainCritOpt_1(poly, int, kStrategy strat)
Definition: kutil.cc:3466
void initBbaShift(kStrategy strat)
Definition: kstd2.cc:4508
int redHomog(LObject *h, kStrategy strat)
Definition: kstd2.cc:536
void enterExtendedSpoly(poly h, kStrategy strat)
Definition: kutil.cc:4659
void initEcartBBA(TObject *h)
Definition: kutil.cc:1242
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define KINLINE
Definition: kutil.h:51
void HEckeTest(poly pp, kStrategy strat)
Definition: kutil.cc:482
int currIdx
Definition: kutil.h:311
long(* pLDegProc)(poly p, int *length, ring r)
Definition: ring.h:45
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
Definition: kstd2.cc:88
void exitBuchMora(kStrategy strat)
Definition: kutil.cc:10177
void postReduceByMon(LObject *h, kStrategy strat)
used for GB over ZZ: intermediate reduction by monomial elements background: any known constant eleme...
Definition: kutil.cc:11040
int minim
Definition: kutil.h:354
int posInLF5C(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6387
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:9777
int Bmax
Definition: kutil.h:348
ideal createG0()
Definition: kutil.cc:4544
poly pp
Definition: myNF.cc:296
int lastAxis
Definition: kutil.h:352
void initSLSba(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:8237
char completeReduce_retry
Definition: kutil.h:400
void chainCritSig(poly p, int ecart, kStrategy strat)
Definition: kutil.cc:3482
poly kNF2Bound(ideal F, ideal Q, poly q, int bound, kStrategy strat, int lazyReduce)
Definition: kstd2.cc:3446
int HCord
Definition: kutil.h:351
void updateS(BOOLEAN toT, kStrategy strat)
Definition: kutil.cc:9009
poly t_p
Definition: kutil.h:76
pFDegProc pOrigFDeg
Definition: kutil.h:290
KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r=currRing)
Definition: kInline.h:1083
BOOLEAN interpt
Definition: kutil.h:368
int posInT2(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5372
void kStratInitChangeTailRing(kStrategy strat)
Definition: kutil.cc:11359
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int blockredmax
Definition: kutil.h:362
long ind2(long arg)
Definition: kutil.cc:4196
int redRiloc(LObject *h, kStrategy strat)
Definition: kstd1.cc:348
poly redNFTail(poly h, const int sl, kStrategy strat)
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether=NULL, ring r=currRing)
Definition: kInline.h:1073
long ind_fact_2(long arg)
Definition: kutil.cc:4208
int lV
Definition: kutil.h:365
int LazyDegree
int nrsyzcrit
Definition: kutil.h:357
BOOLEAN fromT
Definition: kutil.h:376
int nrrewcrit
Definition: kutil.h:358
const ring r
Definition: syzextra.cc:208
int posInT13(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5644
pLDegProc pOrigLDeg
Definition: kutil.h:291
int posInT0(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5333
BOOLEAN homog
Definition: kutil.h:369
void initEcartPairMora(LObject *Lp, poly f, poly g, int ecartF, int ecartG)
Definition: kutil.cc:1256
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:9928
int posInL10Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: intvec.h:14
long FDeg
Definition: kutil.h:79
int posInL17(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6896
#define kTest_TS(A)
Definition: kutil.h:654
int posInL110(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6697
static void Normalize(number &a, const coeffs r)
Definition: flintcf_Q.cc:343
int max_lower_index
Definition: kutil.h:312
int j
Definition: myNF.cc:70
void pairs()
intset fromQ
Definition: kutil.h:315
#define messageSets(s)
Definition: kutil.h:538
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
Definition: kutil.cc:1937
KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin bin)
Definition: kInline.h:894
int posInTSig(const TSet set, const int length, LObject &p)
void ksCreateSpoly(LObject *Pair, poly spNoether=NULL, int use_buckets=0, ring tailRing=currRing, poly m1=NULL, poly m2=NULL, TObject **R=NULL)
Definition: kspoly.cc:774
LObject * LSet
Definition: kutil.h:62
KINLINE TSet initT()
Definition: kInline.h:81
BOOLEAN enterOneStrongPoly(int i, poly p, int, int, kStrategy strat, int atR=-1, bool enterTstrong=FALSE)
Definition: kutil.cc:1516
int posInL0(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6141
const ring R
Definition: DebugPrint.cc:36
int ksReducePolySigRing(LObject *PR, TObject *PW, long idx, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
Definition: kspoly.cc:513
void enterSSba(LObject &p, int atS, kStrategy strat, int atR=-1)
Definition: kutil.cc:9340
ideal sba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:2333
void superenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR=-1)
Definition: kutil.cc:4908
#define kTest_L(T)
Definition: kutil.h:657
int redSigRing(LObject *h, kStrategy strat)
Definition: kstd2.cc:865
void kDebugPrint(kStrategy strat)
Output some debug info about a given strategy.
Definition: kutil.cc:11806
ideal freegb(ideal I, int uptodeg, int lVblock)
Definition: kstd2.cc:4347
void deleteInSSba(int i, kStrategy strat)
Definition: kutil.cc:1093
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
Definition: kutil.cc:5111
int posInLSigRing(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6223
int redRing(LObject *h, kStrategy strat)
Definition: kstd2.cc:432
int m
Definition: cfEzgcd.cc:119
KINLINE BOOLEAN arriRewDummy(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kInline.h:1147
LObject P
Definition: kutil.h:296
int HCord
Definition: kutil.cc:235
ideal M
Definition: kutil.h:299
unsigned sbaOrder
Definition: kutil.h:310
BOOLEAN update
Definition: kutil.h:378
int i
Definition: cfEzgcd.cc:123
poly tail
Definition: kutil.h:330
void initenterpairsShift(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
Definition: kutil.cc:12637
poly redtailSba(LObject *L, int pos, kStrategy strat, BOOLEAN withT=FALSE, BOOLEAN normalize=FALSE)
Definition: kstd2.cc:1162
void enterOnePairLift(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
Definition: kutil.cc:2220
TObject ** R
Definition: kutil.h:336
poly lcm
Definition: kutil.h:187
polyset S
Definition: kutil.h:300
int posInSyz(const kStrategy strat, const poly sig)
Definition: kutil.cc:6359
BOOLEAN sugarCrit
Definition: kutil.h:374
intset lenS
Definition: kutil.h:313
int redFirstShift(LObject *h, kStrategy strat)
Definition: kstd2.cc:4381
static void Delete(number *a, const coeffs r)
Definition: flintcf_Q.cc:437
int posInT110(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5555
int tmax
Definition: kutil.h:346
void initBuchMoraShift(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:12094
void cleanT(kStrategy strat)
Definition: kutil.cc:552
int cp
Definition: kutil.h:343
void enterT_strong(LObject &p, kStrategy strat, int atT=-1)
Definition: kutil.cc:9563
int posInT17(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5807
int posInL11Ringls(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6511
int pLength
Definition: kutil.h:80
BOOLEAN newHEdge(kStrategy strat)
Definition: kutil.cc:10745
void initEcartPairBba(LObject *Lp, poly f, poly g, int ecartF, int ecartG)
Definition: kutil.cc:1249
poly sig
Definition: kutil.h:74
int int kStrategy strat
Definition: myNF.cc:68
void cancelunit(LObject *p, BOOLEAN inNF=FALSE)
Definition: kutil.cc:332
Definition: kutil.h:70
static number Init(long i, const coeffs r)
Definition: flintcf_Q.cc:145
BOOLEAN kHEdgeFound
Definition: kutil.h:373
intset ecartS
Definition: kutil.h:303
void exitSba(kStrategy strat)
Definition: kutil.cc:10370
poly pMoveCurrTail2poly(poly p, kStrategy strat)
Definition: kutil.cc:11956
poly t_kHEdge
Definition: kutil.h:325
void reorderS(int *suc, kStrategy strat)
Definition: kutil.cc:5058
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...
Definition: ring.h:52
s_poly_proc_t s_poly
Definition: kutil.h:294
void initBba(kStrategy strat)
Definition: kstd1.cc:1426
poly p2
Definition: kutil.h:184
int ksReducePolyTail(LObject *PR, TObject *PW, poly Current, poly spNoether=NULL)
Definition: kspoly.cc:889
LSet L
Definition: kutil.h:321
BOOLEAN LDegLast
Definition: kutil.h:382
#define NULL
Definition: omList.c:10
intvec * kHomW
Definition: kutil.h:332
poly * polyset
Definition: hutil.h:15
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:11681
LSet B
Definition: kutil.h:322
int Lmax
Definition: kutil.h:347
int64 wlen_type
Definition: kutil.h:56
void enterOnePairSigRing(int i, poly p, poly pSig, int ecart, int isFromQ, kStrategy strat, int atR)
void enterSyz(LObject &p, kStrategy strat, int atT)
Definition: kutil.cc:9675
void enterpairs(poly h, int k, int ec, int pos, kStrategy strat, int atR=-1)
Definition: kutil.cc:4935
KINLINE poly redtailBba_Z(poly p, int pos, kStrategy strat)
Definition: kInline.h:1104
void enterOnePairShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS, int uptodeg, int lV)
Definition: kutil.cc:12311
ring tailRing
Definition: kutil.h:339
void updateSShift(kStrategy strat, int uptodeg, int lV)
Definition: kutil.cc:12066
BOOLEAN homogTest(polyset F, int Fmax)
long(* pFDegProc)(poly p, ring r)
Definition: ring.h:46
void completeReduce(kStrategy strat, BOOLEAN withT=FALSE)
Definition: kutil.cc:10622
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
Definition: kutil.cc:1210
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
Definition: kInline.h:1122
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:345
denominator_list next
Definition: kutil.h:67
int blockred
Definition: kutil.h:361
BOOLEAN is_special
Definition: kutil.h:99
poly t_kNoether
Definition: kutil.h:327
omBin tailBin
Definition: kutil.h:341
BOOLEAN(* s_poly_proc_t)(kStrategy strat)
Definition: kstd1.h:14
ideal D
Definition: kutil.h:298
const CanonicalForm & w
Definition: facAbsFact.cc:55
strat ak
Definition: myNF.cc:321
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.cc:7304
int posInT17_c(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5914
char overflow
Definition: kutil.h:401
intvec * kModW
Definition: kutil.h:331
BOOLEAN no_prod_crit
Definition: kutil.h:391
unsigned long * sevS
Definition: kutil.h:316
void deleteInS(int i, kStrategy strat)
Definition: kutil.cc:1041
BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.cc:7273
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.cc:7211
void enterSBba(LObject &p, int atS, kStrategy strat, int atR=-1)
Definition: kutil.cc:9238
BOOLEAN posInLOldFlag
Definition: kutil.h:379
intset fromS
Definition: kutil.h:304
unsigned long * sevSyz
Definition: kutil.h:317
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
Definition: kutil.cc:11194
int posInL10(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kstd1.cc:1098
denominator_list DENOMINATOR_LIST
Definition: kutil.cc:89
poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing)
Definition: kstd2.cc:318
int * intset
Definition: kutil.h:55
int posInT_EcartpLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5673
int kFindNextDivisibleByInS(const kStrategy strat, int start, int max_ind, LObject *L)
Definition: kstd2.cc:259
polyset syz
Definition: kutil.h:301
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition: kutil.cc:1148
int sl
Definition: kutil.h:344
int posInL13(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6785
BOOLEAN findMinLMPair(poly sig, unsigned long not_sevSig, kStrategy strat, int start)
TSet T
Definition: kutil.h:320
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
Definition: kutil.cc:10811
p exp[i]
Definition: DebugPrint.cc:39
int i_r2
Definition: kutil.h:189
wlen_type * wlen_set
Definition: kutil.h:57
omBin lmBin
Definition: kutil.h:340
void enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV)
Definition: kutil.cc:12710
poly redtail(poly p, int pos, kStrategy strat)
Definition: kutil.cc:7575
int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kstd2.cc:83
BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat)
Definition: kutil.cc:7159
unsigned long sevSig
Definition: kutil.h:73
BOOLEAN use_buckets
Definition: kutil.h:380
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
void kFreeStrat(kStrategy strat)
KINLINE poly redtailBba(poly p, int pos, kStrategy strat, BOOLEAN normalize=FALSE)
Definition: kInline.h:1091
poly kNF2(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
Definition: kstd2.cc:3377
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether=NULL)
Definition: kInline.h:1063
void wrp(poly p)
Definition: polys.h:292
int posInT19(const TSet set, const int length, LObject &p)
Definition: kutil.cc:6041
#define kTest_T(T)
Definition: kutil.h:655
int strat_nr
Definition: kstdfac.cc:27
kBucketDestroy & P
Definition: myNF.cc:191
int LazyPass
Definition: kutil.h:349
static jList * T
Definition: janet.cc:37
polyrec * poly
Definition: hilb.h:10
static LSet initL(int nr=setmaxL)
Definition: kutil.h:418
void initBuchMoraPosRing(kStrategy strat)
Definition: kutil.cc:10014
int newIdeal
Definition: kutil.h:353
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin bin)
Definition: kInline.h:876
int redNF0(LObject *P, kStrategy strat)
ideal Shdl
Definition: kutil.h:297
BOOLEAN prod_crit
Definition: kutil.h:195
int posInT1(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5344
static Poly * h
Definition: janet.cc:978
int int nonorm
Definition: myNF.cc:67
int BOOLEAN
Definition: auxiliary.h:85
int posInL11Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6441
int redLazy(LObject *h, kStrategy strat)
Definition: kstd2.cc:1290
kStrategy next
Definition: kutil.h:271
unsigned long sev
Definition: kutil.h:183
int redHoney(LObject *h, kStrategy strat)
Definition: kstd2.cc:1450
char redTailChange
Definition: kutil.h:396
pFDegProc pOrigFDeg_TailRing
Definition: kutil.h:292
int posInL11(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6399
int ksReducePolyBound(LObject *PR, TObject *PW, int bound, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
Definition: kspoly.cc:176
BOOLEAN is_sigsafe
Definition: kutil.h:95
int l
Definition: cfEzgcd.cc:94
int redSig(LObject *h, kStrategy strat)
Definition: kstd2.cc:697
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int int lazyReduce
Definition: myNF.cc:292
poly pCopyL2p(LObject h, kStrategy strat)
Definition: kutil.cc:11973
class sTObject TObject
Definition: kutil.h:59
ring tailRing
Definition: kutil.h:78
void initSL(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:8138
poly p
Definition: kutil.h:75
intset syzIdx
Definition: kutil.h:307
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring taiRing)
Definition: kInline.h:978
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
Definition: kspoly.cc:45
ring sbaRing(kStrategy strat, const ring r=currRing, BOOLEAN complete=TRUE, int sgn=1)
Definition: kutil.cc:11386
int posInL15Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6855