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 #define setmax 128
28 #define setmaxL ((4096-12)/sizeof(LObject))
29 #define setmaxLinc ((4096)/sizeof(LObject))
30 
31 #define setmaxT ((4096-12)/sizeof(TObject))
32 #define setmaxTinc ((4096)/sizeof(TObject))
33 
34 // if you want std computations as in Singular version < 2:
35 // This disables RedThrough, tailReductions against T (bba),
36 // sets posInT = posInT15 (bba, strat->honey), and enables redFirst with LDeg
37 // NOTE: can be achieved with option(oldStd)
38 
39 #undef NO_KINLINE
40 #if !defined(KDEBUG) && !defined(NO_INLINE)
41 #define KINLINE inline
42 #else
43 #define KINLINE
44 #define NO_KINLINE 1
45 #endif
46 
47 typedef int* intset;
48 typedef int64 wlen_type;
50 
51 typedef class sTObject TObject;
52 typedef class sLObject LObject;
53 typedef TObject * TSet;
54 typedef LObject * LSet;
55 
58 
61 
62 class sTObject
63 {
64 public:
65  unsigned long sevSig;
66  poly sig; // the signature of the element
67  poly p; // Lm(p) \in currRing Tail(p) \in tailRing
68  poly t_p; // t_p \in tailRing: as monomials Lm(t_p) == Lm(p)
69  poly max_exp; // p_GetMaxExpP(pNext(p))
70  ring tailRing;
71  long FDeg; // pFDeg(p)
72  int ecart,
73  length, // as of pLDeg
74  pLength, // either == 0, or == pLength(p)
75  i_r; // index of TObject in R set, or -1 if not in T
76  BOOLEAN is_normalized; // true, if pNorm was called on p, false otherwise
77  // used in incremental sba() with F5C:
78  // we know some of the redundant elements in
79  // strat->T beforehand, so we can just discard
80  // them and do not need to consider them in the
81  // interreduction process
83  // used in sba's sig-safe reduction:
84  // sometimes we already know that a reducer
85  // is sig-safe, so no need for a real
86  // sig-safeness check
88 
89 
90 #ifdef HAVE_PLURAL
91  BOOLEAN is_special; // true, it is a new special S-poly (e.g. for SCA)
92 #endif
93 
94  // initialization
95  KINLINE void Init(ring r = currRing);
98  KINLINE sTObject(poly p, ring c_r, ring tailRing);
100 
101  KINLINE void Set(ring r=currRing);
102  KINLINE void Set(poly p_in, ring r=currRing);
103  KINLINE void Set(poly p_in, ring c_r, ring t_r);
104 
105  // Frees the polys of T
106  KINLINE void Delete();
107  // Sets polys to NULL
108  KINLINE void Clear();
109  // makes a copy of the poly of T
110  KINLINE void Copy();
111 
112  // ring-dependent Lm access: these might result in allocation of monomials
115  KINLINE poly GetLm(ring r);
116  // this returns Lm and ring r (preferably from tailRing), but does not
117  // allocate a new poly
118  KINLINE void GetLm(poly &p, ring &r) const;
119 
120 #ifdef OLIVER_PRIVAT_LT
121  // routines for calc. with rings
122  KINLINE poly GetLtCurrRing();
123  KINLINE poly GetLtTailRing();
124  KINLINE poly GetLt(ring r);
125  KINLINE void GetLt(poly &p, ring &r) const;
126 #endif
127 
128  KINLINE BOOLEAN IsNull() const;
129 
130  KINLINE int GetpLength();
131 
132  // makes sure that T.p exists
133  KINLINE void SetLmCurrRing();
134 
135  // Iterations
136  // simply get the next monomial
137  KINLINE poly Next();
138  KINLINE void LmDeleteAndIter();
139 
140  // deg stuff
141  // compute pTotalDegree
142  KINLINE long pTotalDeg() const;
143  // computes pFDeg
144  KINLINE long pFDeg() const;
145  // computes and sets FDeg
146  KINLINE long SetpFDeg();
147  // gets stored FDeg
148  KINLINE long GetpFDeg() const;
149 
150  // computes pLDeg
151  KINLINE long pLDeg();
152  // sets length, FDeg, returns LDeg
154 
155  // arithmetic
156  KINLINE void Mult_nn(number n);
157  KINLINE void ShallowCopyDelete(ring new_tailRing, omBin new_tailBin,
158  pShallowCopyDeleteProc p_shallow_copy_delete,
159  BOOLEAN set_max = TRUE);
160  // manipulations
161  KINLINE void pNorm();
162  KINLINE void pCleardenom();
163 
164 #ifdef KDEBUG
165  void wrp();
166 #endif
167 };
168 
169 extern int strat_nr;
170 
171 class sLObject : public sTObject
172 {
173 
174 public:
175  unsigned long sev;
176  poly p1,p2; /*- the pair p comes from,
177  lm(pi) in currRing, tail(pi) in tailring -*/
178 
179  poly lcm; /*- the lcm of p1,p2 -*/
181  int i_r1, i_r2;
182  unsigned checked; // this is the index of S up to which
183  // the corresponding LObject was already checked in
184  // critical pair creation => when entering the
185  // reduction process it is enough to start a second
186  // rewritten criterion check from checked+1 onwards
188  // NOTE: If prod_crit = TRUE then the corresponding pair is
189  // detected by Buchberger's Product Criterion and can be
190  // deleted
191 
192  // initialization
193  KINLINE void Init(ring tailRing = currRing);
196  KINLINE sLObject(poly p, ring c_r, ring tailRing);
197 
198  // Frees the polys of L
199  KINLINE void Delete();
200  KINLINE void Clear();
201 
202  // Iterations
203  KINLINE void LmDeleteAndIter();
205 
206  // spoly related things
207  // preparation for reduction if not spoly
208  KINLINE void PrepareRed(BOOLEAN use_bucket);
209  KINLINE void SetLmTail(poly lm, poly new_p, int length,
210  int use_bucket, ring r);
211  KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether);
212  KINLINE void Tail_Mult_nn(number n);
213  // deletes bucket, makes sure that p and t_p exists
214  KINLINE poly GetP(omBin lmBin = NULL);
215  // similar, except that only t_p exists
216  KINLINE poly GetTP();
217 
218  // does not delete bucket, just canonicalizes it
219  // returned poly is such that Lm(p) \in currRing, Tail(p) \in tailRing
221 
222  // makes a copy of the poly of L
223  KINLINE void Copy();
224 
225  KINLINE int GetpLength();
226  KINLINE long pLDeg(BOOLEAN use_last);
227  KINLINE long pLDeg();
228  KINLINE int SetLength(BOOLEAN lengt_pLength = FALSE);
230  KINLINE long SetDegStuffReturnLDeg(BOOLEAN use_last);
231 
232  // returns minimal component of p
233  KINLINE long MinComp();
234  // returns component of p
235  KINLINE long Comp();
236 
237  KINLINE void ShallowCopyDelete(ring new_tailRing,
238  pShallowCopyDeleteProc p_shallow_copy_delete);
239 
240  // sets sev
241  KINLINE void SetShortExpVector();
242 
243  // enable assignment from TObject
245 
246  // get T's corresponding to p1, p2: they might return NULL
249  KINLINE void T_1_2(const skStrategy* strat,
250  TObject* &T_1, TObject* &T_2);
251 
252  // simplify coefficients
253  KINLINE void Normalize();
254  KINLINE void HeadNormalize();
255 };
256 
257 
258 extern int HCord;
259 
260 class skStrategy : public omallocClass
261 {
262 public:
266  void (*initEcart)(TObject * L);
267  int (*posInT)(const TSet T,const int tl,LObject &h);
268  int (*posInLSba)(const LSet set, const int length,
269  LObject* L,const kStrategy strat);
270  int (*posInL)(const LSet set, const int length,
271  LObject* L,const kStrategy strat);
272  void (*enterS)(LObject &h, int pos,kStrategy strat, int atR/* =-1*/ );
273  void (*initEcartPair)(LObject * h, poly f, poly g, int ecartF, int ecartG);
274  int (*posInLOld)(const LSet Ls,const int Ll,
275  LObject* Lo,const kStrategy strat);
276  void (*enterOnePair) (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR /*= -1*/);
277  void (*chainCrit) (poly p,int ecart,kStrategy strat);
278  BOOLEAN (*syzCrit) (poly sig, unsigned long not_sevSig, kStrategy strat);
279  BOOLEAN (*rewCrit1) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
280  BOOLEAN (*rewCrit2) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
281  BOOLEAN (*rewCrit3) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
287 
289  ideal Shdl;
290  ideal D; /*V(S) is in D(D)*/
291  ideal M; /*set of minimal generators*/
296  intset fromS; // from which S[i] S[j] comes from
297  // this is important for signature-based
298  // algorithms
299  intset syzIdx;// index in the syz array at which the first
300  // syzygy of component i comes up
301  // important for signature-based algorithms
302  unsigned sbaOrder;
303  int currIdx;
306  wlen_set lenSw; /* for tgb.ccc */
308  unsigned long* sevS;
309  unsigned long* sevSyz;
310  unsigned long* sevSig;
311  unsigned long* sevT;
317  poly t_kHEdge; // same polys in tailring
321  BOOLEAN * pairtest;/*used for enterOnePair*/
325  // procedure for ShalloCopy from tailRing to currRing
327  // pointers to Tobjects R[i] is ith Tobject which is generated
329  // S_2_R[i] yields Tobject which corresponds to S[i]
330  int* S_2_R;
331  ring tailRing;
334  int nr;
335  int cp,c3;
336  int sl,mu;
338  int tl,tmax;
339  int Ll,Lmax;
340  int Bl,Bmax;
342  int syzComp;
343  int HCord;
344  int lastAxis;
345  int newIdeal;
346  int minim;
347  #ifdef HAVE_RINGS
348  bool sigdrop; //This is used to check sigdrop in sba over Z
349  int nrsyzcrit; // counts how many pairs are deleted by SyzCrit
350  int nrrewcrit; // counts how many pairs are deleted by FaugereRewCrit
351  int sbaEnterS; // sba over Z strategy: if sigdrop element has _*gen(sbaEnterS+1), then
352  // add directly sbaEnterS elements into S
353  int blockred; // counter for blocked reductions in redSig
355  #endif
356  #ifdef HAVE_SHIFTBBA
357  int lV;
358  int cv; // in shift bases: counting V criterion
359  #endif
362 #ifdef HAVE_PLURAL
363  BOOLEAN z2homog; // Z_2 - homogeneous input allows product criterion in commutative and SCA cases!
364 #endif
373  // if set, pLDeg(p, l) == (pFDeg(pLast(p), pLength)
375  // if set, then L.length == L.pLength
377  // if set, then posInL does not depend on L.length
379  /*FALSE, if posInL == posInL10*/
380 #ifdef HAVE_PLURAL
381  // set this flag to 1 to stop the product criteria
382  // use ALLOW_PROD_CRIT(strat) to test
384 #define ALLOW_PROD_CRIT(A) (!(A)->no_prod_crit)
385 #else
386 #define ALLOW_PROD_CRIT(A) (1)
387 #endif
389  char news;
390  char newt;/*used for messageSets*/
391  char noClearS;
393  char overflow;
394 
395  skStrategy();
396  ~skStrategy();
397 
398  // return TObject corresponding to S[i]: assume that it exists
399  // i.e. no error checking is done
400  KINLINE TObject* S_2_T(int i);
401  // like S_2_T, except that NULL is returned if it can not be found
402  KINLINE TObject* s_2_t(int i);
403 };
404 
405 void deleteHC(poly *p, int *e, int *l, kStrategy strat);
406 void deleteHC(LObject* L, kStrategy strat, BOOLEAN fromNext = FALSE);
407 void deleteInS (int i,kStrategy strat);
408 void deleteInSSba (int i,kStrategy strat);
409 void cleanT (kStrategy strat);
410 static inline LSet initL (int nr=setmaxL)
411 { return (LSet)omAlloc(nr*sizeof(LObject)); }
412 void deleteInL(LSet set, int *length, int j,kStrategy strat);
413 void enterL (LSet *set,int *length, int *LSetmax, LObject p,int at);
414 void enterSBba (LObject &p,int atS,kStrategy strat, int atR = -1);
415 void enterSSba (LObject &p,int atS,kStrategy strat, int atR = -1);
416 void initEcartPairBba (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
417 void initEcartPairMora (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
418 int posInS (const kStrategy strat, const int length, const poly p,
419  const int ecart_p);
420 int posInSMonFirst (const kStrategy strat, const int length, const poly p);
421 int posInIdealMonFirst (const ideal F, const poly p,int start = 0,int end = -1);
422 int posInT0 (const TSet set,const int length,LObject &p);
423 int posInT1 (const TSet set,const int length,LObject &p);
424 int posInT2 (const TSet set,const int length,LObject &p);
425 int posInT11 (const TSet set,const int length,LObject &p);
426 int posInTSig (const TSet set,const int length,LObject &p);
427 int posInT110 (const TSet set,const int length,LObject &p);
428 int posInT13 (const TSet set,const int length,LObject &p);
429 int posInT15 (const TSet set,const int length,LObject &p);
430 int posInT17 (const TSet set,const int length,LObject &p);
431 int posInT17_c (const TSet set,const int length,LObject &p);
432 int posInT19 (const TSet set,const int length,LObject &p);
433 int posInT_EcartpLength(const TSet set,const int length,LObject &p);
434 int posInT_EcartFDegpLength(const TSet set,const int length,LObject &p);
435 int posInT_FDegpLength(const TSet set,const int length,LObject &p);
436 int posInT_pLength(const TSet set,const int length,LObject &p);
437 
438 #ifdef HAVE_MORE_POS_IN_T
439 int posInT_EcartFDegpLength(const TSet set,const int length,LObject &p);
440 int posInT_FDegpLength(const TSet set,const int length,LObject &p);
441 int posInT_pLength(const TSet set,const int length,LObject &p);
442 #endif
443 
444 
445 void reorderS (int* suc,kStrategy strat);
446 int posInLF5C (const LSet set, const int length,
447  LObject* L,const kStrategy strat);
448 int posInLSig (const LSet set, const int length,
449  LObject* L,const kStrategy strat);
450 int posInLSigRing (const LSet set, const int length,
451  LObject* L,const kStrategy strat);
452 int posInLRing (const LSet set, const int length,
453  LObject* L,const kStrategy strat);
454 int posInSyz (const kStrategy strat, const poly sig);
455 int posInL0 (const LSet set, const int length,
456  LObject* L,const kStrategy strat);
457 int posInL11 (const LSet set, const int length,
458  LObject* L,const kStrategy strat);
459 int posInL11Ring (const LSet set, const int length,
460  LObject* L,const kStrategy strat);
461 int posInLF5CRing (const LSet set, int start , const int length,
462  LObject* L,const kStrategy strat);
463 int posInL11Ringls (const LSet set, const int length,
464  LObject* L,const kStrategy strat);
465 int posInL13 (const LSet set, const int length,
466  LObject* L,const kStrategy strat);
467 int posInL15 (const LSet set, const int length,
468  LObject* L,const kStrategy strat);
469 int posInL15Ring (const LSet set, const int length,
470  LObject* L,const kStrategy strat);
471 int posInL17 (const LSet set, const int length,
472  LObject* L,const kStrategy strat);
473 int posInL10 (const LSet set, const int length,
474  LObject* L,const kStrategy strat);
475 int posInL10Ring (const LSet set, const int length,
476  LObject* L,const kStrategy strat);
477 int posInL110 (const LSet set, const int length,
478  LObject* L,const kStrategy strat);
481 #ifdef HAVE_RINGS
483 poly redtailBba_Z (LObject* L, int pos, kStrategy strat );
484 #endif
485 poly redtailBba (LObject *L, int pos,kStrategy strat,
489 poly redtailSba (LObject *L, int pos,kStrategy strat,
491 poly redtailBba (TObject *T, int pos,kStrategy strat);
492 poly redtail (poly p,int pos,kStrategy strat);
493 poly redtail (LObject *L,int pos,kStrategy strat);
496 poly redNFTail (poly h,const int sl,kStrategy strat);
498 #ifdef HAVE_RINGS
503 void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR = -1);
504 void superenterpairsSig (poly h,poly hSig,int hFrom,int k,int ecart,int pos,kStrategy strat, int atR = -1);
505 poly kCreateZeroPoly(long exp[], long cabsind, poly* t_p, ring leadRing, ring tailRing);
506 long ind2(long arg);
507 
508 long ind_fact_2(long arg);
509 long twoPow(long arg);
510 ideal createG0();
511 #endif
516 //adds hSig to be able to check with F5's criteria when entering pairs!
517 void enterpairsSig (poly h, poly hSig, int from, int k, int ec, int pos,kStrategy strat, int atR = -1);
518 void enterpairs (poly h, int k, int ec, int pos,kStrategy strat, int atR = -1);
519 void entersets (LObject h);
520 void pairs ();
522 void message (int i,int* reduc,int* olddeg,kStrategy strat,int red_result);
523 void messageStat (int hilbcount,kStrategy strat);
524 void messageStatSBA (int hilbcount,kStrategy strat);
525 #ifdef KDEBUG
527 #else
528 #define messageSets(s) do {} while (0)
529 #endif
530 
531 void initEcartNormal (TObject* h);
532 void initEcartBBA (TObject* h);
533 void initS (ideal F, ideal Q,kStrategy strat);
534 void initSL (ideal F, ideal Q,kStrategy strat);
535 void initSLSba (ideal F, ideal Q,kStrategy strat);
536 /*************************************************
537  * when initializing a new bunch of principal
538  * syzygies at the beginning of a new iteration
539  * step in a signature-based algorithm we
540  * compute ONLY the leading elements of those
541  * syzygies, NOT the whole syzygy
542  * NOTE: this needs to be adjusted for a more
543  * general approach on signature-based algorithms
544  ***********************************************/
546 void updateS(BOOLEAN toT,kStrategy strat);
547 void enterSyz (LObject &p,kStrategy strat, int atT);
548 void enterT (LObject &p,kStrategy strat, int atT = -1);
549 #ifdef HAVE_RINGS
550 void enterT_strong (LObject &p,kStrategy strat, int atT = -1);
551 #endif
552 void cancelunit (LObject* p,BOOLEAN inNF=FALSE);
556 void initHilbCrit(ideal F, ideal Q, intvec **hilb,kStrategy strat);
560 void initBuchMora (ideal F, ideal Q,kStrategy strat);
561 void initSbaBuchMora (ideal F, ideal Q,kStrategy strat);
563 void exitSba (kStrategy strat);
564 void updateResult(ideal r,ideal Q,kStrategy strat);
567 void enterOnePairNormal (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR);
568 void chainCritNormal (poly p,int ecart,kStrategy strat);
570 void chainCritSig (poly p,int ecart,kStrategy strat);
571 BOOLEAN homogTest(polyset F, int Fmax);
573 BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat);
574 BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat);
575 KINLINE BOOLEAN arriRewDummy(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
576 BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
577 BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
578 BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
579 BOOLEAN findMinLMPair(poly sig, unsigned long not_sevSig, kStrategy strat, int start);
580 
581 /// returns index of p in TSet, or -1 if not found
582 int kFindInT(poly p, TSet T, int tlength);
583 
584 /// return -1 if no divisor is found
585 /// number of first divisor in T, otherwise
586 int kFindDivisibleByInT(const kStrategy strat, const LObject* L, const int start=0);
587 
588 /// return -1 if no divisor is found
589 /// number of first divisor in S, otherwise
590 int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject* L);
591 
592 int kFindNextDivisibleByInS(const kStrategy strat, int start,int max_ind, LObject* L);
593 TObject*
595  long ecart = LONG_MAX);
596 
597 /***************************************************************
598  *
599  * stuff to be inlined
600  *
601  ***************************************************************/
602 
603 KINLINE TSet initT ();
604 KINLINE TObject** initR();
605 KINLINE unsigned long* initsevT();
610 
615 
616 // if exp bound is not violated, return TRUE and
617 // get m1 = LCM(LM(p1), LM(p2))/LM(p1)
618 // m2 = LCM(LM(p1), LM(p2))/LM(p2)
619 // return FALSE and m1 == NULL, m2 == NULL , otherwise
620 KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r,
621  poly &m1, poly &m2, const ring m_r);
622 #ifdef HAVE_RINGS
623 KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing,
624  poly &m1, poly &m2, poly &lcm, const ring taiRing);
625 #endif
626 #ifdef KDEBUG
627 // test strat
629 // test strat, and test that S is contained in T
631 // test LObject
632 BOOLEAN kTest_L(LObject* L, ring tailRing = NULL,
633  BOOLEAN testp = FALSE, int lpos = -1,
634  TSet T = NULL, int tlength = -1);
635 // test TObject
636 BOOLEAN kTest_T(TObject* T, ring tailRing = NULL, int tpos = -1, char TN = '?');
637 // test set strat->SevS
639 #else
640 #define kTest(A) (TRUE)
641 #define kTest_TS(A) (TRUE)
642 #define kTest_T(T) (TRUE)
643 #define kTest_S(T) (TRUE)
644 #define kTest_L(T) (TRUE)
645 #endif
646 
647 
648 /***************************************************************
649  *
650  * From kstd2.cc
651  *
652  ***************************************************************/
653 poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing);
654 ideal bba (ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat);
655 ideal sba (ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat);
656 poly kNF2 (ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce);
657 ideal kNF2 (ideal F,ideal Q,ideal q, kStrategy strat, int lazyReduce);
658 poly kNF2Bound (ideal F, ideal Q, poly q,int bound, kStrategy strat, int lazyReduce);
659 ideal kNF2Bound (ideal F,ideal Q,ideal q,int bound, kStrategy strat, int lazyReduce);
660 void initBba(kStrategy strat);
661 void initSba(ideal F,kStrategy strat);
662 void f5c (kStrategy strat, int& olddeg, int& minimcnt, int& hilbeledeg,
663  int& hilbcount, int& srmax, int& lrmax, int& reduc, ideal Q,
664  intvec *w,intvec *hilb );
665 
666 /***************************************************************
667  *
668  * From kspoly.cc
669  *
670  ***************************************************************/
671 // Reduces PR with PW
672 // Assumes PR != NULL, PW != NULL, Lm(PW) divides Lm(PR)
673 // Changes: PR
674 // Const: PW
675 // If coef != NULL, then *coef is a/gcd(a,b), where a = LC(PR), b = LC(PW)
676 // If strat != NULL, tailRing is changed if reduction would violate exp bound
677 // of tailRing
678 // Returns: 0 everything ok, no tailRing change
679 // 1 tailRing has successfully changed (strat != NULL)
680 // 2 no reduction performed, tailRing needs to be changed first
681 // (strat == NULL)
682 // -1 tailRing change could not be performed due to exceeding exp
683 // bound of currRing
684 int ksReducePoly(LObject* PR,
685  TObject* PW,
686  poly spNoether = NULL,
687  number *coef = NULL,
688  kStrategy strat = NULL);
689 
690 int ksReducePolyBound(LObject* PR,
691  TObject* PW,
692  int bound,
693  poly spNoether = NULL,
694  number *coef = NULL,
695  kStrategy strat = NULL);
696 
697 // Reduces PR with PW
698 // Assumes PR != NULL, PW != NULL, Lm(PW) divides Lm(PR)
699 // Changes: PR
700 // Const: PW
701 // If coef != NULL, then *coef is a/gcd(a,b), where a = LC(PR), b = LC(PW)
702 // If strat != NULL, tailRing is changed if reduction would violate exp bound
703 // of tailRing
704 // Returns: 0 everything ok, no tailRing change
705 // 1 tailRing has successfully changed (strat != NULL)
706 // 2 no reduction performed, tailRing needs to be changed first
707 // (strat == NULL)
708 // 3 no reduction performed, not sig-safe!!!
709 // -1 tailRing change could not be performed due to exceeding exp
710 // bound of currRing
711 int ksReducePolySig(LObject* PR,
712  TObject* PW,
713  long idx,
714  poly spNoether = NULL,
715  number *coef = NULL,
716  kStrategy strat = NULL);
717 
719  TObject* PW,
720  long idx,
721  poly spNoether = NULL,
722  number *coef = NULL,
723  kStrategy strat = NULL);
724 
725 // Reduces PR at Current->next with PW
726 // Assumes PR != NULL, Current contained in PR
727 // Current->next != NULL, LM(PW) devides LM(Current->next)
728 // Changes: PR
729 // Const: PW
730 // Return: see ksReducePoly
731 int ksReducePolyTail(LObject* PR,
732  TObject* PW,
733  poly Current,
734  poly spNoether = NULL);
735 
736 KINLINE int ksReducePolyTail(LObject* PR, TObject* PW, LObject* Red);
737 
738 // Creates S-Poly of Pair
739 // Const: Pair->p1, Pair->p2
740 // Changes: Pair->p == S-Poly of p1, p2
741 // Assume: Pair->p1 != NULL && Pair->p2
742 void ksCreateSpoly(LObject* Pair, poly spNoether = NULL,
743  int use_buckets=0, ring tailRing=currRing,
744  poly m1 = NULL, poly m2 = NULL, TObject** R = NULL);
745 
746 /*2
747 * creates the leading term of the S-polynomial of p1 and p2
748 * do not destroy p1 and p2
749 * remarks:
750 * 1. the coefficient is 0 (nNew)
751 * 2. pNext is undefined
752 */
754 
755 
756 // old stuff
757 KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether = NULL);
758 KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether = NULL);
759 KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether = NULL, ring r = currRing);
760 KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r = currRing);
761 
762 /***************************************************************
763  *
764  * Routines related for ring changes during std computations
765  *
766  ***************************************************************/
767 // return TRUE and set m1, m2 to k_GetLcmTerms,
768 // if spoly creation of strat->P does not violate
769 // exponent bound of strat->tailRing
770 // FALSE, otherwise
772 #ifdef HAVE_RINGS
773 // return TRUE if gcdpoly creation of R[atR] and S[atS] does not violate
774 // exponent bound of strat->tailRing
775 // FALSE, otherwise
776 BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat);
777 poly preIntegerCheck(ideal F, ideal Q);
781 #endif
782 // change strat->tailRing and adjust all data in strat, L, and T:
783 // new tailRing has larger exponent bound
784 // do nothing and return FALSE if exponent bound increase would result in
785 // larger exponent bound that that of currRing
787  LObject* L = NULL, TObject* T = NULL,
788  // take this as new_expbound: if 0
789  // new expbound is 2*expbound of tailRing
790  unsigned long new_expbound = 0);
791 // initiate a change of the tailRing of strat -- should be called
792 // right before main loop in bba
794 
795 /// Output some debug info about a given strategy
797 
798 // getting sb order for sba computations
799 ring sbaRing(kStrategy strat, const ring r=currRing, BOOLEAN complete=TRUE, int sgn=1);
800 
801 KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k,
802  kStrategy strat);
803 
804 #include <kernel/GBEngine/kInline.h>
805 
806 /* shiftgb stuff */
807 #include <kernel/GBEngine/shiftgb.h>
808 
810 
812 
814 
815 void enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV);
816 
817 void initBuchMoraShift (ideal F,ideal Q,kStrategy strat);
818 
819 void enterOnePairSelfShifts (poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV);
820 
821 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
822 
823 void enterpairsShift (poly h,int k,int ecart,int pos,kStrategy strat, int atR,int uptodeg, int lV);
824 
825 void updateSShift(kStrategy strat,int uptodeg,int lV);
826 
828 
830 
831 int redFirstShift (LObject* h,kStrategy strat); // ok
832 
833 ideal freegb(ideal I, int uptodeg, int lVblock);
834 
835 ideal bbaShift(ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat, int uptodeg, int lV);
836 // test syz strategy: // will be removed soon
837 extern int (*test_PosInT)(const TSet T,const int tl,LObject &h);
838 extern int (*test_PosInL)(const LSet set, const int length,
839  LObject* L,const kStrategy strat);
840 #endif
KINLINE TObject ** initR()
Definition: kInline.h:92
unsigned long * sevSig
Definition: kutil.h:310
int posInT_pLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:11766
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:11729
KINLINE void Init(ring tailRing=currRing)
Definition: kInline.h:496
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
KINLINE int GetpLength()
Definition: kInline.h:780
KINLINE poly GetP(omBin lmBin=NULL)
Definition: kInline.h:669
int posInLRing(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6277
denominator_list_s * denominator_list
Definition: kutil.h:57
polyset sig
Definition: kutil.h:294
int posInLSig(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6190
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.h:270
int nr
Definition: kutil.h:334
BOOLEAN honey
Definition: kutil.h:366
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:8380
#define setmaxL
Definition: kutil.h:28
KINLINE void SetShortExpVector()
Definition: kInline.h:707
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:6466
void initSbaCrit(kStrategy strat)
Definition: kutil.cc:9832
omBin_t * omBin
Definition: omStructs.h:12
static CanonicalForm bound(const CFMatrix &M)
Definition: cf_linsys.cc:460
int syzComp
Definition: kutil.h:342
void updateResult(ideal r, ideal Q, kStrategy strat)
Definition: kutil.cc:10401
BOOLEAN is_redundant
Definition: kutil.h:82
void initEcartNormal(TObject *h)
Definition: kutil.cc:1251
void enterOnePairSelfShifts(poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
Definition: kutil.cc:12243
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
Definition: kutil.cc:7915
KINLINE void Set(ring r=currRing)
Definition: kInline.h:103
BOOLEAN(* rewCrit1)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.h:279
int i_r1
Definition: kutil.h:181
int syzmax
Definition: kutil.h:337
void postReduceByMonSig(LObject *h, kStrategy strat)
Definition: kutil.cc:11099
BOOLEAN is_normalized
Definition: kutil.h:76
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether=NULL)
Definition: kInline.h:1053
kBucket_pt bucket
Definition: kutil.h:180
poly kHEdge
Definition: kutil.h:315
BOOLEAN sbaCheckGcdPair(LObject *h, kStrategy strat)
Definition: kutil.cc:1663
int posInT11(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5393
pLDegProc pOrigLDeg_TailRing
Definition: kutil.h:285
class sLObject LObject
Definition: kutil.h:52
BOOLEAN length_pLength
Definition: kutil.h:376
TObject * TSet
Definition: kutil.h:53
bool sigdrop
Definition: kutil.h:348
int posInSMonFirst(const kStrategy strat, const int length, const poly p)
Definition: kutil.cc:5203
int posInL15(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6811
wlen_set lenSw
Definition: kutil.h:306
int Ll
Definition: kutil.h:339
#define kTest_S(T)
Definition: kutil.h:643
int sgn(const Rational &a)
Definition: GMPrat.cc:437
KINLINE sLObject & operator=(const sTObject &)
Definition: kInline.h:821
KINLINE poly Next()
Definition: kInline.h:280
#define FALSE
Definition: auxiliary.h:94
BOOLEAN noTailReduction
Definition: kutil.h:367
unsigned checked
Definition: kutil.h:182
Compatiblity layer for legacy polynomial operations (over currRing)
int * S_2_R
Definition: kutil.h:330
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:11254
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:10288
int c3
Definition: kutil.h:335
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:3696
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:7112
poly redtailBbaShift(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
Definition: kutil.cc:12740
char news
Definition: kutil.h:389
int posInT15(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5703
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:10863
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1660
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:351
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR, int uptodeg, int lV)
Definition: kutil.cc:12666
char newt
Definition: kutil.h:390
void chainCritNormal(poly p, int ecart, kStrategy strat)
Definition: kutil.cc:3247
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
Definition: kspoly.cc:1017
BOOLEAN * NotUsedAxis
Definition: kutil.h:320
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
BOOLEAN posInLDependsOnLength
Definition: kutil.h:378
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
int(* posInLSba)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.h:268
KINLINE sLObject(ring tailRing=currRing)
Definition: kInline.h:504
KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
Definition: kInline.h:901
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.h:280
KINLINE void Init(ring r=currRing)
Definition: kInline.h:107
int length
Definition: kutil.h:72
BOOLEAN noetherSet
Definition: kutil.h:369
int cv
Definition: kutil.h:358
void messageStat(int hilbcount, kStrategy strat)
Definition: kutil.cc:7956
KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
Definition: kInline.h:885
BOOLEAN * pairtest
Definition: kutil.h:321
int & max_ind
Definition: myNF.cc:67
BOOLEAN z2homog
Definition: kutil.h:363
poly kNoether
Definition: kutil.h:316
int tl
Definition: kutil.h:338
KINLINE void HeadNormalize()
Definition: kInline.h:334
int Bl
Definition: kutil.h:340
void enterExtendedSpolySig(poly h, poly hSig, kStrategy strat)
Definition: kutil.cc:4733
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:1972
long int64
Definition: auxiliary.h:66
void initSbaPos(kStrategy strat)
Definition: kutil.cc:10186
char noClearS
Definition: kutil.h:391
#define TRUE
Definition: auxiliary.h:98
void messageStatSBA(int hilbcount, kStrategy strat)
Definition: kutil.cc:7968
int posInIdealMonFirst(const ideal F, const poly p, int start=0, int end=-1)
Definition: kutil.cc:5280
#define kTest(A)
Definition: kutil.h:640
poly kCreateZeroPoly(long exp[], long cabsind, poly *t_p, ring leadRing, ring tailRing)
Definition: kutil.cc:4406
pShallowCopyDeleteProc p_shallow_copy_delete
Definition: kutil.h:326
unsigned long * sevT
Definition: kutil.h:311
BOOLEAN(* rewCrit3)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.h:281
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
Definition: kutil.h:273
void enterpairsSig(poly h, poly hSig, int from, int k, int ec, int pos, kStrategy strat, int atR=-1)
Definition: kutil.cc:4952
poly pMove2CurrTail(poly p, kStrategy strat)
Definition: kutil.cc:11936
BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat)
Definition: kutil.cc:10840
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR=-1)
Definition: kutil.cc:4889
KINLINE poly redtailBbaBound(poly p, int pos, kStrategy strat, int bound, BOOLEAN normalize=FALSE)
Definition: kInline.h:1097
int ak
Definition: kutil.h:341
void initS(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:8033
g
Definition: cfModGcd.cc:4031
poly max_exp
Definition: kutil.h:69
ideal bbaShift(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat, int uptodeg, int lV)
Definition: kstd2.cc:4017
void initHilbCrit(ideal F, ideal Q, intvec **hilb, kStrategy strat)
Definition: kutil.cc:9750
int k
Definition: cfEzgcd.cc:93
KINLINE void pNorm()
Definition: kInline.h:463
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:10092
void enterT(LObject &p, kStrategy strat, int atT=-1)
Definition: kutil.cc:9469
#define Q
Definition: sirandom.c:25
long twoPow(long arg)
Definition: kutil.cc:4217
KINLINE unsigned long * initsevT()
Definition: kInline.h:97
void chainCritOpt_1(poly, int, kStrategy strat)
Definition: kutil.cc:3460
void initBbaShift(kStrategy strat)
Definition: kstd2.cc:4532
int redHomog(LObject *h, kStrategy strat)
Definition: kstd2.cc:542
void enterExtendedSpoly(poly h, kStrategy strat)
Definition: kutil.cc:4650
void initEcartBBA(TObject *h)
Definition: kutil.cc:1259
KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether)
Definition: kInline.h:570
int(* red)(LObject *L, kStrategy strat)
Definition: kutil.h:264
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define KINLINE
Definition: kutil.h:43
void HEckeTest(poly pp, kStrategy strat)
Definition: kutil.cc:482
int(* posInT)(const TSet T, const int tl, LObject &h)
Definition: kutil.h:267
int currIdx
Definition: kutil.h:303
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:10168
void postReduceByMon(LObject *h, kStrategy strat)
used for GB over ZZ: intermediate reduction by monomial elements background: any known constant eleme...
Definition: kutil.cc:11031
int minim
Definition: kutil.h:346
int posInLF5C(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6378
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:9768
int Bmax
Definition: kutil.h:340
KINLINE void PrepareRed(BOOLEAN use_bucket)
Definition: kInline.h:520
ideal createG0()
Definition: kutil.cc:4535
poly pp
Definition: myNF.cc:296
int lastAxis
Definition: kutil.h:344
void initSLSba(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:8228
BOOLEAN(* syzCrit)(poly sig, unsigned long not_sevSig, kStrategy strat)
Definition: kutil.h:278
KINLINE void Tail_Mult_nn(number n)
Definition: kInline.h:556
KINLINE void LmDeleteAndIter()
Definition: kInline.h:288
KINLINE void Copy()
Definition: kInline.h:719
KINLINE void SetLmTail(poly lm, poly new_p, int length, int use_bucket, ring r)
Definition: kInline.h:538
skStrategy()
Definition: kutil.cc:11602
char completeReduce_retry
Definition: kutil.h:392
void chainCritSig(poly p, int ecart, kStrategy strat)
Definition: kutil.cc:3476
int i_r
Definition: kutil.h:72
KINLINE sTObject(ring tailRing=currRing)
Definition: kInline.h:113
poly kNF2Bound(ideal F, ideal Q, poly q, int bound, kStrategy strat, int lazyReduce)
Definition: kstd2.cc:3468
int HCord
Definition: kutil.h:343
void updateS(BOOLEAN toT, kStrategy strat)
Definition: kutil.cc:9000
poly t_p
Definition: kutil.h:68
KINLINE int GetpLength()
Definition: kInline.h:268
pFDegProc pOrigFDeg
Definition: kutil.h:282
KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r=currRing)
Definition: kInline.h:1083
BOOLEAN interpt
Definition: kutil.h:360
int posInT2(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5363
void(* initEcart)(TObject *L)
Definition: kutil.h:266
void kStratInitChangeTailRing(kStrategy strat)
Definition: kutil.cc:11353
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:354
long ind2(long arg)
Definition: kutil.cc:4190
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
void(* enterOnePair)(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
Definition: kutil.h:276
long ind_fact_2(long arg)
Definition: kutil.cc:4202
KINLINE void Copy()
Definition: kInline.h:200
int lV
Definition: kutil.h:357
int nrsyzcrit
Definition: kutil.h:349
BOOLEAN fromT
Definition: kutil.h:368
int nrrewcrit
Definition: kutil.h:350
const ring r
Definition: syzextra.cc:208
int posInT13(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5635
pLDegProc pOrigLDeg
Definition: kutil.h:283
int posInT0(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5324
BOOLEAN homog
Definition: kutil.h:361
void initEcartPairMora(LObject *Lp, poly f, poly g, int ecartF, int ecartG)
Definition: kutil.cc:1273
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:9919
KINLINE TObject * S_2_T(int i)
Definition: kInline.h:35
int posInL10Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
KINLINE long pLDeg()
Definition: kInline.h:735
Definition: intvec.h:14
long FDeg
Definition: kutil.h:71
int posInL17(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6887
#define kTest_TS(A)
Definition: kutil.h:641
int posInL110(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6688
int max_lower_index
Definition: kutil.h:304
int j
Definition: myNF.cc:70
poly p1
Definition: kutil.h:176
void pairs()
KINLINE void Clear()
Definition: kInline.h:189
KINLINE void LmDeleteAndIter()
Definition: kInline.h:592
BOOLEAN Gebauer
Definition: kutil.h:367
intset fromQ
Definition: kutil.h:307
#define messageSets(s)
Definition: kutil.h:528
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
Definition: kutil.cc:1952
KINLINE BOOLEAN IsNull() const
Definition: kInline.h:263
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:54
KINLINE TObject * T_2(const skStrategy *strat)
Definition: kInline.h:838
KINLINE poly CanonicalizeP()
Definition: kInline.h:638
KINLINE TSet initT()
Definition: kInline.h:81
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
Definition: kutil.h:272
int posInL0(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6132
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:9331
KINLINE void ShallowCopyDelete(ring new_tailRing, omBin new_tailBin, pShallowCopyDeleteProc p_shallow_copy_delete, BOOLEAN set_max=TRUE)
Definition: kInline.h:348
ideal sba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:2355
void superenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR=-1)
Definition: kutil.cc:4899
#define kTest_L(T)
Definition: kutil.h:644
int redSigRing(LObject *h, kStrategy strat)
Definition: kstd2.cc:871
void kDebugPrint(kStrategy strat)
Output some debug info about a given strategy.
Definition: kutil.cc:11800
ideal freegb(ideal I, int uptodeg, int lVblock)
Definition: kstd2.cc:4371
void deleteInSSba(int i, kStrategy strat)
Definition: kutil.cc:1110
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
Definition: kutil.cc:5102
int posInLSigRing(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6214
int redRing(LObject *h, kStrategy strat)
Definition: kstd2.cc:432
KINLINE void SetLmCurrRing()
Definition: kInline.h:274
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:288
int HCord
Definition: kutil.cc:235
ideal M
Definition: kutil.h:291
unsigned sbaOrder
Definition: kutil.h:302
BOOLEAN update
Definition: kutil.h:370
FILE * f
Definition: checklibs.c:9
int i
Definition: cfEzgcd.cc:123
poly tail
Definition: kutil.h:322
KINLINE void Normalize()
Definition: kInline.h:321
poly redtailSba(LObject *L, int pos, kStrategy strat, BOOLEAN withT=FALSE, BOOLEAN normalize=FALSE)
Definition: kstd2.cc:1168
int(* posInLOld)(const LSet Ls, const int Ll, LObject *Lo, const kStrategy strat)
Definition: kutil.h:274
TObject ** R
Definition: kutil.h:328
poly lcm
Definition: kutil.h:179
KINLINE long Comp()
Definition: kInline.h:812
polyset S
Definition: kutil.h:292
int posInSyz(const kStrategy strat, const poly sig)
Definition: kutil.cc:6350
BOOLEAN sugarCrit
Definition: kutil.h:366
intset lenS
Definition: kutil.h:305
int redFirstShift(LObject *h, kStrategy strat)
Definition: kstd2.cc:4405
int posInT110(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5546
int tmax
Definition: kutil.h:338
void initBuchMoraShift(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:12088
void cleanT(kStrategy strat)
Definition: kutil.cc:552
int cp
Definition: kutil.h:335
void enterT_strong(LObject &p, kStrategy strat, int atT=-1)
Definition: kutil.cc:9554
int posInT17(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5798
KINLINE void pCleardenom()
Definition: kInline.h:425
int posInL11Ringls(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6502
int pLength
Definition: kutil.h:72
BOOLEAN newHEdge(kStrategy strat)
Definition: kutil.cc:10736
void initEcartPairBba(LObject *Lp, poly f, poly g, int ecartF, int ecartG)
Definition: kutil.cc:1266
poly sig
Definition: kutil.h:66
int int kStrategy strat
Definition: myNF.cc:68
void cancelunit(LObject *p, BOOLEAN inNF=FALSE)
Definition: kutil.cc:332
Definition: kutil.h:62
BOOLEAN kHEdgeFound
Definition: kutil.h:365
intset ecartS
Definition: kutil.h:295
void exitSba(kStrategy strat)
Definition: kutil.cc:10361
poly pMoveCurrTail2poly(poly p, kStrategy strat)
Definition: kutil.cc:11950
poly t_kHEdge
Definition: kutil.h:317
void reorderS(int *suc, kStrategy strat)
Definition: kutil.cc:5049
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
KINLINE poly GetLmCurrRing()
Definition: kInline.h:217
s_poly_proc_t s_poly
Definition: kutil.h:286
void initBba(kStrategy strat)
Definition: kstd1.cc:1426
KINLINE long pTotalDeg() const
Definition: kInline.h:394
void(* chainCrit)(poly p, int ecart, kStrategy strat)
Definition: kutil.h:277
poly p2
Definition: kutil.h:176
int ksReducePolyTail(LObject *PR, TObject *PW, poly Current, poly spNoether=NULL)
Definition: kspoly.cc:889
LSet L
Definition: kutil.h:313
BOOLEAN LDegLast
Definition: kutil.h:374
#define NULL
Definition: omList.c:10
intvec * kHomW
Definition: kutil.h:324
poly * polyset
Definition: hutil.h:15
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:11675
LSet B
Definition: kutil.h:314
int Lmax
Definition: kutil.h:339
KINLINE void Mult_nn(number n)
Definition: kInline.h:309
int64 wlen_type
Definition: kutil.h:48
int mu
Definition: kutil.h:336
void enterSyz(LObject &p, kStrategy strat, int atT)
Definition: kutil.cc:9666
void enterpairs(poly h, int k, int ec, int pos, kStrategy strat, int atR=-1)
Definition: kutil.cc:4926
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:12306
ring tailRing
Definition: kutil.h:331
void updateSShift(kStrategy strat, int uptodeg, int lV)
Definition: kutil.cc:12060
BOOLEAN homogTest(polyset F, int Fmax)
long(* pFDegProc)(poly p, ring r)
Definition: ring.h:46
KINLINE poly GetLmTailRing()
Definition: kInline.h:224
void completeReduce(kStrategy strat, BOOLEAN withT=FALSE)
Definition: kutil.cc:10613
KINLINE long pLDeg()
Definition: kInline.h:409
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
Definition: kutil.cc:1227
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
Definition: kInline.h:1122
KINLINE poly GetTP()
Definition: kInline.h:653
denominator_list next
Definition: kutil.h:59
int blockred
Definition: kutil.h:353
BOOLEAN is_special
Definition: kutil.h:91
poly t_kNoether
Definition: kutil.h:319
omBin tailBin
Definition: kutil.h:333
BOOLEAN(* s_poly_proc_t)(kStrategy strat)
Definition: kstd1.h:14
ideal D
Definition: kutil.h:290
const CanonicalForm & w
Definition: facAbsFact.cc:55
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.cc:7295
int posInT17_c(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5905
char overflow
Definition: kutil.h:393
KINLINE int SetLength(BOOLEAN lengt_pLength=FALSE)
Definition: kInline.h:787
int syzidxmax
Definition: kutil.h:337
intvec * kModW
Definition: kutil.h:323
BOOLEAN no_prod_crit
Definition: kutil.h:383
~skStrategy()
Definition: kutil.cc:11622
unsigned long * sevS
Definition: kutil.h:308
KINLINE long SetDegStuffReturnLDeg()
Definition: kInline.h:413
void deleteInS(int i, kStrategy strat)
Definition: kutil.cc:1058
BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.cc:7264
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.cc:7202
void enterSBba(LObject &p, int atS, kStrategy strat, int atR=-1)
Definition: kutil.cc:9229
BOOLEAN posInLOldFlag
Definition: kutil.h:371
intset fromS
Definition: kutil.h:296
unsigned long * sevSyz
Definition: kutil.h:309
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
Definition: kutil.cc:11188
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:47
KINLINE void Delete()
Definition: kInline.h:489
KINLINE TObject * s_2_t(int i)
Definition: kInline.h:44
int posInT_EcartpLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5664
int kFindNextDivisibleByInS(const kStrategy strat, int start, int max_ind, LObject *L)
Definition: kstd2.cc:259
polyset syz
Definition: kutil.h:293
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition: kutil.cc:1165
int sl
Definition: kutil.h:336
int posInL13(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6776
BOOLEAN findMinLMPair(poly sig, unsigned long not_sevSig, kStrategy strat, int start)
TSet T
Definition: kutil.h:312
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
Definition: kutil.cc:10802
p exp[i]
Definition: DebugPrint.cc:39
int i_r2
Definition: kutil.h:181
wlen_type * wlen_set
Definition: kutil.h:49
omBin lmBin
Definition: kutil.h:332
void enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV)
Definition: kutil.cc:12697
KINLINE poly LmExtractAndIter()
Definition: kInline.h:612
poly redtail(poly p, int pos, kStrategy strat)
Definition: kutil.cc:7566
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:7150
unsigned long sevSig
Definition: kutil.h:65
BOOLEAN use_buckets
Definition: kutil.h:372
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:3399
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether=NULL)
Definition: kInline.h:1063
KINLINE poly GetLm(ring r)
Definition: kInline.h:237
void wrp(poly p)
Definition: polys.h:292
int posInT19(const TSet set, const int length, LObject &p)
Definition: kutil.cc:6032
#define kTest_T(T)
Definition: kutil.h:642
int strat_nr
Definition: kstdfac.cc:27
kBucketDestroy & P
Definition: myNF.cc:191
int LazyPass
Definition: kutil.h:341
KINLINE void Clear()
Definition: kInline.h:483
static jList * T
Definition: janet.cc:37
polyrec * poly
Definition: hilb.h:10
static LSet initL(int nr=setmaxL)
Definition: kutil.h:410
void initBuchMoraPosRing(kStrategy strat)
Definition: kutil.cc:10005
int newIdeal
Definition: kutil.h:345
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:289
BOOLEAN prod_crit
Definition: kutil.h:187
int(* red2)(LObject *L, kStrategy strat)
Definition: kutil.h:265
int posInT1(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5335
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:6432
KINLINE long SetpFDeg()
Definition: kInline.h:399
int redLazy(LObject *h, kStrategy strat)
Definition: kstd2.cc:1296
kStrategy next
Definition: kutil.h:263
KINLINE poly kNoetherTail()
Definition: kInline.h:63
unsigned long sev
Definition: kutil.h:175
int redHoney(LObject *h, kStrategy strat)
Definition: kstd2.cc:1456
int ecart
Definition: kutil.h:72
KINLINE void T_1_2(const skStrategy *strat, TObject *&T_1, TObject *&T_2)
Definition: kInline.h:849
char redTailChange
Definition: kutil.h:388
pFDegProc pOrigFDeg_TailRing
Definition: kutil.h:284
int posInL11(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6390
int syzl
Definition: kutil.h:337
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:87
int LazyDegree
Definition: kutil.h:341
int l
Definition: cfEzgcd.cc:94
int redSig(LObject *h, kStrategy strat)
Definition: kstd2.cc:703
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int int lazyReduce
Definition: myNF.cc:292
KINLINE long SetDegStuffReturnLDeg()
Definition: kInline.h:766
poly pCopyL2p(LObject h, kStrategy strat)
Definition: kutil.cc:11967
class sTObject TObject
Definition: kutil.h:51
ring tailRing
Definition: kutil.h:70
KINLINE void Delete()
Definition: kInline.h:175
void initSL(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:8129
poly p
Definition: kutil.h:67
intset syzIdx
Definition: kutil.h:299
KINLINE long MinComp()
Definition: kInline.h:797
KINLINE long pFDeg() const
Definition: kInline.h:389
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
KINLINE TObject * T_1(const skStrategy *strat)
Definition: kInline.h:828
KINLINE void ShallowCopyDelete(ring new_tailRing, pShallowCopyDeleteProc p_shallow_copy_delete)
Definition: kInline.h:696
ring sbaRing(kStrategy strat, const ring r=currRing, BOOLEAN complete=TRUE, int sgn=1)
Definition: kutil.cc:11380
int posInL15Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:6846
KINLINE long GetpFDeg() const
Definition: kInline.h:404