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 <misc/mylimits.h>
15 
16 
17 #include <kernel/polys.h>
19 
20 #include <kernel/structs.h>
21 
22 // define if tailrings should be used
23 #define HAVE_TAIL_RING
24 
25 #if 1
26 #define setmax 16
27 #define setmaxL ((4096-12)/sizeof(LObject))
28 #define setmaxLinc ((4096)/sizeof(LObject))
29 
30 #define setmaxT 64
31 #define setmaxTinc 32
32 #else
33 #define setmax 16
34 #define setmaxL 16
35 #define setmaxLinc 16
36 #define setmaxT 16
37 #define setmaxTinc 16
38 #endif
39 
40 // if you want std computations as in Singular version < 2:
41 // This disables RedThrough, tailReductions against T (bba),
42 // sets posInT = posInT15 (bba, strat->honey), and enables redFirst with LDeg
43 // NOTE: can be achieved with option(oldStd)
44 
45 #undef NO_KINLINE
46 #if !defined(KDEBUG) && !defined(NO_INLINE)
47 #define KINLINE inline
48 #else
49 #define KINLINE
50 #define NO_KINLINE 1
51 #endif
52 
53 typedef int* intset;
54 typedef int64 wlen_type;
56 
57 typedef class sTObject TObject;
58 typedef class sLObject LObject;
59 typedef TObject * TSet;
60 typedef LObject * LSet;
61 
64 
67 
68 class sTObject
69 {
70 public:
71  unsigned long sevSig;
72  poly sig; // the signature of the element
73  poly p; // Lm(p) \in currRing Tail(p) \in tailRing
74  poly t_p; // t_p \in tailRing: as monomials Lm(t_p) == Lm(p)
75  poly max; // p_GetMaxExpP(pNext(p))
76  ring tailRing;
77  long FDeg; // pFDeg(p)
78  int ecart,
79  length, // as of pLDeg
80  pLength, // either == 0, or == pLength(p)
81  i_r; // index of TObject in R set, or -1 if not in T
82  BOOLEAN is_normalized; // true, if pNorm was called on p, false otherwise
83  // used in incremental sba() with F5C:
84  // we know some of the redundant elements in
85  // strat->T beforehand, so we can just discard
86  // them and do not need to consider them in the
87  // interreduction process
89  // used in sba's sig-safe reduction:
90  // sometimes we already know that a reducer
91  // is sig-safe, so no need for a real
92  // sig-safeness check
94 
95 
96 #ifdef HAVE_PLURAL
97  BOOLEAN is_special; // true, it is a new special S-poly (e.g. for SCA)
98 #endif
99 
100  // initialization
101  KINLINE void Init(ring r = currRing);
102  KINLINE sTObject(ring tailRing = currRing);
103  KINLINE sTObject(poly p, ring tailRing = currRing);
104  KINLINE sTObject(poly p, ring c_r, ring tailRing);
105  KINLINE sTObject(sTObject* T, int copy);
106 
107  KINLINE void Set(ring r=currRing);
108  KINLINE void Set(poly p_in, ring r=currRing);
109  KINLINE void Set(poly p_in, ring c_r, ring t_r);
110 
111  // Frees the polys of T
112  KINLINE void Delete();
113  // Sets polys to NULL
114  KINLINE void Clear();
115  // makes a copy of the poly of T
116  KINLINE void Copy();
117 
118  // ring-dependent Lm access: these might result in allocation of monomials
121  KINLINE poly GetLm(ring r);
122  // this returns Lm and ring r (preferably from tailRing), but does not
123  // allocate a new poly
124  KINLINE void GetLm(poly &p, ring &r) const;
125 
126 #ifdef OLIVER_PRIVAT_LT
127  // routines for calc. with rings
128  KINLINE poly GetLtCurrRing();
129  KINLINE poly GetLtTailRing();
130  KINLINE poly GetLt(ring r);
131  KINLINE void GetLt(poly &p, ring &r) const;
132 #endif
133 
134  KINLINE BOOLEAN IsNull() const;
135 
136  KINLINE int GetpLength();
137 
138  // makes sure that T.p exists
139  KINLINE void SetLmCurrRing();
140 
141  // Iterations
142  // simply get the next monomial
143  KINLINE poly Next();
144  KINLINE void LmDeleteAndIter();
145 
146  // deg stuff
147  // compute pTotalDegree
148  KINLINE long pTotalDeg() const;
149  // computes pFDeg
150  KINLINE long pFDeg() const;
151  // computes and sets FDeg
152  KINLINE long SetpFDeg();
153  // gets stored FDeg
154  KINLINE long GetpFDeg() const;
155 
156  // computes pLDeg
157  KINLINE long pLDeg();
158  // sets length, FDeg, returns LDeg
160 
161  // arithmetic
162  KINLINE void Mult_nn(number n);
163  KINLINE void ShallowCopyDelete(ring new_tailRing, omBin new_tailBin,
164  pShallowCopyDeleteProc p_shallow_copy_delete,
165  BOOLEAN set_max = TRUE);
166  // manipulations
167  KINLINE void pNorm();
168  KINLINE void pCleardenom();
169 
170 #ifdef KDEBUG
171  void wrp();
172 #endif
173 };
174 
175 #ifndef SING_NDEBUG
176 extern int strat_nr;
177 extern int strat_fac_debug;
178 #endif
179 
180 class sLObject : public sTObject
181 {
182 
183 public:
184  unsigned long sev;
185  unsigned long checked; // this is the index of S up to which
186  // the corresponding LObject was already checked in
187  // critical pair creation => when entering the
188  // reduction process it is enough to start a second
189  // rewritten criterion check from checked+1 onwards
191  // NOTE: If prod_crit = TRUE then the corresponding pair is
192  // detected by Buchberger's Product Criterion and can be
193  // deleted
194  poly p1,p2; /*- the pair p comes from,
195  lm(pi) in currRing, tail(pi) in tailring -*/
196 
197  poly lcm; /*- the lcm of p1,p2 -*/
199  int i_r1, i_r2;
200 
201  // initialization
202  KINLINE void Init(ring tailRing = currRing);
205  KINLINE sLObject(poly p, ring c_r, ring tailRing);
206 
207  // Frees the polys of L
208  KINLINE void Delete();
209  KINLINE void Clear();
210 
211  // Iterations
212  KINLINE void LmDeleteAndIter();
214 
215  // spoly related things
216  // preparation for reduction if not spoly
217  KINLINE void PrepareRed(BOOLEAN use_bucket);
218  KINLINE void SetLmTail(poly lm, poly new_p, int length,
219  int use_bucket, ring r);
220  KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether);
221  KINLINE void Tail_Mult_nn(number n);
222  // deletes bucket, makes sure that p and t_p exists
223  KINLINE poly GetP(omBin lmBin = NULL);
224  // similar, except that only t_p exists
225  KINLINE poly GetTP();
226 
227  // does not delete bucket, just canonicalizes it
228  // returned poly is such that Lm(p) \in currRing, Tail(p) \in tailRing
230 
231  // makes a copy of the poly of L
232  KINLINE void Copy();
233  // gets the poly and makes a copy of it
235 
236  KINLINE int GetpLength();
237  KINLINE long pLDeg(BOOLEAN use_last);
238  KINLINE long pLDeg();
239  KINLINE int SetLength(BOOLEAN lengt_pLength = FALSE);
241  KINLINE long SetDegStuffReturnLDeg(BOOLEAN use_last);
242 
243  // returns minimal component of p
244  KINLINE long MinComp();
245  // returns component of p
246  KINLINE long Comp();
247 
248  KINLINE void ShallowCopyDelete(ring new_tailRing,
249  pShallowCopyDeleteProc p_shallow_copy_delete);
250 
251  // sets sev
252  KINLINE void SetShortExpVector();
253 
254  // enable assignment from TObject
256 
257  // get T's corresponding to p1, p2: they might return NULL
260  KINLINE void T_1_2(const skStrategy* strat,
261  TObject* &T_1, TObject* &T_2);
262 
263  // simplify coefficients
264  KINLINE void Normalize();
265  KINLINE void HeadNormalize();
266 };
267 
268 
269 extern int HCord;
270 
272 typedef skStrategy * kStrategy;
274 {
275 public:
279  void (*initEcart)(TObject * L);
280  int (*posInT)(const TSet T,const int tl,LObject &h);
281  int (*posInLSba)(const LSet set, const int length,
282  LObject* L,const kStrategy strat);
283  int (*posInL)(const LSet set, const int length,
284  LObject* L,const kStrategy strat);
285  void (*enterS)(LObject h, int pos,kStrategy strat, int atR/* =-1*/ );
286  void (*initEcartPair)(LObject * h, poly f, poly g, int ecartF, int ecartG);
287  int (*posInLOld)(const LSet Ls,const int Ll,
288  LObject* Lo,const kStrategy strat);
289  void (*enterOnePair) (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR /*= -1*/);
290  void (*chainCrit) (poly p,int ecart,kStrategy strat);
291  BOOLEAN (*syzCrit) (poly sig, unsigned long not_sevSig, kStrategy strat);
292  BOOLEAN (*rewCrit1) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
293  BOOLEAN (*rewCrit2) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
294  BOOLEAN (*rewCrit3) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
299 
302  ideal D; /*V(S) is in D(D)*/
303  ideal M; /*set of minimal generators*/
308  intset fromS; // from which S[i] S[j] comes from
309  // this is important for signature-based
310  // algorithms
311  intset syzIdx;// index in the syz array at which the first
312  // syzygy of component i comes up
313  // important for signature-based algorithms
314  unsigned sbaOrder;
315  unsigned long currIdx;
318  wlen_set lenSw; /* for tgb.ccc */
320  unsigned long* sevS;
321  unsigned long* sevSyz;
322  unsigned long* sevSig;
323  unsigned long* sevT;
329  poly t_kHEdge; // same polys in tailring
333  BOOLEAN * pairtest;/*used for enterOnePair*/
337  // procedure for ShalloCopy from tailRing to currRing
339  // pointers to Tobjects R[i] is ith Tobject which is generated
341  // S_2_R[i] yields Tobject which corresponds to S[i]
342  int* S_2_R;
343  ring tailRing;
346 #ifndef SING_NDEBUG
347  int nr;
348 #endif
349  int cp,c3;
350  int cv; // in shift bases: counting V criterion
351  int sl,mu;
353  int tl,tmax;
354  int Ll,Lmax;
355  int Bl,Bmax;
357  int syzComp;
358  int HCord;
359  int lastAxis;
360  int newIdeal;
361  int minim;
362  #ifdef HAVE_SHIFTBBA
363  int lV;
364  #endif
367 #ifdef HAVE_PLURAL
368  BOOLEAN z2homog; // Z_2 - homogeneous input allows product criterion in commutative and SCA cases!
369 #endif
379  // if set, pLDeg(p, l) == (pFDeg(pLast(p), pLength)
381  // if set, then L.length == L.pLength
383  // if set, then posInL does not depend on L.length
385  /*FALSE, if posInL == posInL10*/
386 #ifdef HAVE_PLURAL
387  // set this flag to 1 to stop the product criteria
388  // use ALLOW_PROD_CRIT(strat) to test
390 #define ALLOW_PROD_CRIT(A) (!(A)->no_prod_crit)
391 #else
392 #define ALLOW_PROD_CRIT(A) (1)
393 #endif
395  char news;
396  char newt;/*used for messageSets*/
397  char noClearS;
399  char overflow;
400 
401  skStrategy();
402  ~skStrategy();
403 
404  // return TObject corresponding to S[i]: assume that it exists
405  // i.e. no error checking is done
406  KINLINE TObject* S_2_T(int i);
407  // like S_2_T, except that NULL is returned if it can not be found
408  KINLINE TObject* s_2_t(int i);
409 };
410 
411 void deleteHC(poly *p, int *e, int *l, kStrategy strat);
412 void deleteHC(LObject* L, kStrategy strat, BOOLEAN fromNext = FALSE);
413 void deleteInS (int i,kStrategy strat);
414 void deleteInSSba (int i,kStrategy strat);
415 void cleanT (kStrategy strat);
416 static inline LSet initL (int nr=setmaxL)
417 { return (LSet)omAlloc(nr*sizeof(LObject)); }
418 void deleteInL(LSet set, int *length, int j,kStrategy strat);
419 void enterL (LSet *set,int *length, int *LSetmax, LObject p,int at);
420 void enterSBba (LObject p,int atS,kStrategy strat, int atR = -1);
421 void enterSSba (LObject p,int atS,kStrategy strat, int atR = -1);
422 void initEcartPairBba (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
423 void initEcartPairMora (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
424 int posInS (const kStrategy strat, const int length, const poly p,
425  const int ecart_p);
426 int posInT0 (const TSet set,const int length,LObject &p);
427 int posInT1 (const TSet set,const int length,LObject &p);
428 int posInT2 (const TSet set,const int length,LObject &p);
429 int posInT11 (const TSet set,const int length,LObject &p);
430 int posInTSig (const TSet set,const int length,LObject &p);
431 int posInT110 (const TSet set,const int length,LObject &p);
432 int posInT13 (const TSet set,const int length,LObject &p);
433 int posInT15 (const TSet set,const int length,LObject &p);
434 int posInT17 (const TSet set,const int length,LObject &p);
435 int posInT19 (const TSet set,const int length,LObject &p);
436 int posInT_EcartpLength(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 posInSyz (const kStrategy strat, const poly sig);
451 int posInL0 (const LSet set, const int length,
452  LObject* L,const kStrategy strat);
453 int posInL11 (const LSet set, const int length,
454  LObject* L,const kStrategy strat);
455 int posInL13 (const LSet set, const int length,
456  LObject* L,const kStrategy strat);
457 int posInL15 (const LSet set, const int length,
458  LObject* L,const kStrategy strat);
459 int posInL17 (const LSet set, const int length,
460  LObject* L,const kStrategy strat);
461 int posInL10 (const LSet set, const int length,
462  LObject* L,const kStrategy strat);
463 int posInL110 (const LSet set, const int length,
464  LObject* L,const kStrategy strat);
466 #ifdef HAVE_RINGS
468 poly redtailBba_Z (LObject* L, int pos, kStrategy strat );
469 #endif
470 poly redtailBba (LObject *L, int pos,kStrategy strat,
472 poly redtailSba (LObject *L, int pos,kStrategy strat,
474 poly redtailBba (TObject *T, int pos,kStrategy strat);
475 poly redtail (poly p,int pos,kStrategy strat);
476 poly redtail (LObject *L,int pos,kStrategy strat);
479 poly redNFTail (poly h,const int sl,kStrategy strat);
481 #ifdef HAVE_RINGS
485 void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR = -1);
486 poly kCreateZeroPoly(long exp[], long cabsind, poly* t_p, ring leadRing, ring tailRing);
487 long ind2(long arg);
488 
489 long ind_fact_2(long arg);
490 long twoPow(long arg);
491 ideal createG0();
492 #endif
496 //adds hSig to be able to check with F5's criteria when entering pairs!
497 void enterpairsSig (poly h, poly hSig, int from, int k, int ec, int pos,kStrategy strat, int atR = -1);
498 void enterpairs (poly h, int k, int ec, int pos,kStrategy strat, int atR = -1);
499 void entersets (LObject h);
500 void pairs ();
501 void message (int i,int* reduc,int* olddeg,kStrategy strat,int red_result);
502 void messageStat (int hilbcount,kStrategy strat);
503 #ifdef KDEBUG
505 #else
506 #define messageSets(s) do {} while (0)
507 #endif
508 
509 void initEcartNormal (TObject* h);
510 void initEcartBBA (TObject* h);
511 void initS (ideal F, ideal Q,kStrategy strat);
512 void initSL (ideal F, ideal Q,kStrategy strat);
514 /*************************************************
515  * when initializing a new bunch of principal
516  * syzygies at the beginning of a new iteration
517  * step in a signature-based algorithm we
518  * compute ONLY the leading elements of those
519  * syzygies, NOT the whole syzygy
520  * NOTE: this needs to be adjusted for a more
521  * general approach on signature-based algorithms
522  ***********************************************/
524 void updateS(BOOLEAN toT,kStrategy strat);
525 void enterSyz (LObject p,kStrategy strat, int atT);
526 void enterT (LObject p,kStrategy strat, int atT = -1);
527 void cancelunit (LObject* p,BOOLEAN inNF=FALSE);
531 void initHilbCrit(ideal F, ideal Q, intvec **hilb,kStrategy strat);
537 void exitSba (kStrategy strat);
541 void enterOnePairNormal (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR);
542 void enterOnePairSig (int i,poly p,poly pSig,int ecart, int isFromQ,kStrategy strat, int atR);
543 void chainCritNormal (poly p,int ecart,kStrategy strat);
544 void chainCritSig (poly p,int ecart,kStrategy strat);
545 BOOLEAN homogTest(polyset F, int Fmax);
547 BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat);
548 BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat);
549 KINLINE BOOLEAN arriRewDummy(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
550 BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
551 BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
552 BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
553 BOOLEAN findMinLMPair(poly sig, unsigned long not_sevSig, kStrategy strat, int start);
554 
555 /// returns index of p in TSet, or -1 if not found
556 int kFindInT(poly p, TSet T, int tlength);
557 
558 /// return -1 if no divisor is found
559 /// number of first divisor in T, otherwise
560 int kFindDivisibleByInT(const TSet &T, const unsigned long* sevT,
561  const int tl, const LObject* L, const int start=0);
562 
563 /// return -1 if no divisor is found
564 /// number of first divisor in S, otherwise
565 int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject* L);
566 
567 int kFindNextDivisibleByInS(const kStrategy strat, int start,int max_ind, LObject* L);
568 TObject*
570  long ecart = LONG_MAX);
571 
572 /***************************************************************
573  *
574  * stuff to be inlined
575  *
576  ***************************************************************/
577 
578 KINLINE TSet initT ();
579 KINLINE TObject** initR();
580 KINLINE unsigned long* initsevT();
585 
590 
591 // if exp bound is not violated, return TRUE and
592 // get m1 = LCM(LM(p1), LM(p2))/LM(p1)
593 // m2 = LCM(LM(p1), LM(p2))/LM(p2)
594 // return FALSE and m1 == NULL, m2 == NULL , otherwise
595 KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r,
596  poly &m1, poly &m2, const ring m_r);
597 #ifdef HAVE_RINGS
598 KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing,
599  poly &m1, poly &m2, poly &lcm, const ring taiRing);
600 #endif
601 #ifdef KDEBUG
602 // test strat
604 // test strat, and test that S is contained in T
606 // test LObject
607 BOOLEAN kTest_L(LObject* L, ring tailRing = NULL,
608  BOOLEAN testp = FALSE, int lpos = -1,
609  TSet T = NULL, int tlength = -1);
610 // test TObject
611 BOOLEAN kTest_T(TObject* T, ring tailRing = NULL, int tpos = -1, char TN = '?');
612 // test set strat->SevS
614 #else
615 #define kTest(A) (TRUE)
616 #define kTest_TS(A) (TRUE)
617 #define kTest_T(T) (TRUE)
618 #define kTest_S(T) (TRUE)
619 #define kTest_L(T) (TRUE)
620 #endif
621 
622 
623 /***************************************************************
624  *
625  * From kstd2.cc
626  *
627  ***************************************************************/
628 poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing);
633 void initBba(ideal F,kStrategy strat);
634 void initSba(ideal F,kStrategy strat);
635 void f5c (kStrategy strat, int& olddeg, int& minimcnt, int& hilbeledeg,
636  int& hilbcount, int& srmax, int& lrmax, int& reduc, ideal Q,
637  intvec *w,intvec *hilb );
638 
639 /***************************************************************
640  *
641  * From kspoly.cc
642  *
643  ***************************************************************/
644 // Reduces PR with PW
645 // Assumes PR != NULL, PW != NULL, Lm(PW) divides Lm(PR)
646 // Changes: PR
647 // Const: PW
648 // If coef != NULL, then *coef is a/gcd(a,b), where a = LC(PR), b = LC(PW)
649 // If strat != NULL, tailRing is changed if reduction would violate exp bound
650 // of tailRing
651 // Returns: 0 everything ok, no tailRing change
652 // 1 tailRing has successfully changed (strat != NULL)
653 // 2 no reduction performed, tailRing needs to be changed first
654 // (strat == NULL)
655 // -1 tailRing change could not be performed due to exceeding exp
656 // bound of currRing
657 int ksReducePoly(LObject* PR,
658  TObject* PW,
659  poly spNoether = NULL,
660  number *coef = NULL,
661  kStrategy strat = NULL);
662 
663 // Reduces PR with PW
664 // Assumes PR != NULL, PW != NULL, Lm(PW) divides Lm(PR)
665 // Changes: PR
666 // Const: PW
667 // If coef != NULL, then *coef is a/gcd(a,b), where a = LC(PR), b = LC(PW)
668 // If strat != NULL, tailRing is changed if reduction would violate exp bound
669 // of tailRing
670 // Returns: 0 everything ok, no tailRing change
671 // 1 tailRing has successfully changed (strat != NULL)
672 // 2 no reduction performed, tailRing needs to be changed first
673 // (strat == NULL)
674 // 3 no reduction performed, not sig-safe!!!
675 // -1 tailRing change could not be performed due to exceeding exp
676 // bound of currRing
677 int ksReducePolySig(LObject* PR,
678  TObject* PW,
679  long idx,
680  poly spNoether = NULL,
681  number *coef = NULL,
682  kStrategy strat = NULL);
683 
684 // Reduces PR at Current->next with PW
685 // Assumes PR != NULL, Current contained in PR
686 // Current->next != NULL, LM(PW) devides LM(Current->next)
687 // Changes: PR
688 // Const: PW
689 // Return: see ksReducePoly
690 int ksReducePolyTail(LObject* PR,
691  TObject* PW,
692  poly Current,
693  poly spNoether = NULL);
694 
695 KINLINE int ksReducePolyTail(LObject* PR, TObject* PW, LObject* Red);
696 
697 // Creates S-Poly of Pair
698 // Const: Pair->p1, Pair->p2
699 // Changes: Pair->p == S-Poly of p1, p2
700 // Assume: Pair->p1 != NULL && Pair->p2
701 void ksCreateSpoly(LObject* Pair, poly spNoether = NULL,
702  int use_buckets=0, ring tailRing=currRing,
703  poly m1 = NULL, poly m2 = NULL, TObject** R = NULL);
704 
705 /*2
706 * creates the leading term of the S-polynomial of p1 and p2
707 * do not destroy p1 and p2
708 * remarks:
709 * 1. the coefficient is 0 (nNew)
710 * 2. pNext is undefined
711 */
713 
714 
715 // old stuff
716 KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether = NULL);
717 KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether = NULL);
718 KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether = NULL, ring r = currRing);
719 KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r = currRing);
720 
721 /***************************************************************
722  *
723  * Routines related for ring changes during std computations
724  *
725  ***************************************************************/
726 // return TRUE and set m1, m2 to k_GetLcmTerms,
727 // if spoly creation of strat->P does not violate
728 // exponent bound of strat->tailRing
729 // FALSE, otherwise
731 #ifdef HAVE_RINGS
732 // return TRUE if gcdpoly creation of R[atR] and S[atS] does not violate
733 // exponent bound of strat->tailRing
734 // FALSE, otherwise
735 BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat);
736 #endif
737 // change strat->tailRing and adjust all data in strat, L, and T:
738 // new tailRing has larger exponent bound
739 // do nothing and return FALSE if exponent bound increase would result in
740 // larger exponent bound that that of currRing
742  LObject* L = NULL, TObject* T = NULL,
743  // take this as new_expbound: if 0
744  // new expbound is 2*expbound of tailRing
745  unsigned long new_expbound = 0);
746 // initiate a change of the tailRing of strat -- should be called
747 // right before main loop in bba
749 
750 /// Output some debug info about a given strategy
752 
753 // getting sb order for sba computations
754 ring sbaRing(kStrategy strat, const ring r=currRing, BOOLEAN complete=TRUE, int sgn=1);
755 
756 KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k,
757  kStrategy strat);
758 
759 #include <kernel/GBEngine/kInline.h>
760 
761 /* shiftgb stuff */
762 #include <kernel/GBEngine/shiftgb.h>
763 
765 
767 
769 
770 void enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV);
771 
773 
774 void enterOnePairManyShifts (int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV); // ok
775 
776 void enterOnePairSelfShifts (poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV);
777 
778 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
779 
780 void enterpairsShift (poly h,int k,int ecart,int pos,kStrategy strat, int atR,int uptodeg, int lV);
781 
782 void initenterpairsShift (poly h,int k,int ecart,int isFromQ,kStrategy strat, int atR,int uptodeg, int lV);
783 
784 void updateSShift(kStrategy strat,int uptodeg,int lV);
785 
787 
789 
790 int redFirstShift (LObject* h,kStrategy strat); // ok
791 
792 ideal freegb(ideal I, int uptodeg, int lVblock);
793 
794 ideal bbaShift(ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat, int uptodeg, int lV);
795 // test syz strategy: // will be removed soon
796 extern int (*test_PosInT)(const TSet T,const int tl,LObject &h);
797 extern int (*test_PosInL)(const LSet set, const int length,
798  LObject* L,const kStrategy strat);
799 #endif
KINLINE TObject ** initR()
Definition: kInline.h:92
unsigned long * sevSig
Definition: kutil.h:322
KINLINE void Init(ring tailRing=currRing)
Definition: kInline.h:506
int kFindInT(poly p, TSet T, int tlength)
returns index of p in TSet, or -1 if not found
Definition: kutil.cc:603
skStrategy * kStrategy
Definition: kutil.h:271
void deleteHC(poly *p, int *e, int *l, kStrategy strat)
Definition: kutil.cc:310
KINLINE int GetpLength()
Definition: kInline.h:809
KINLINE poly GetP(omBin lmBin=NULL)
Definition: kInline.h:679
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
denominator_list_s * denominator_list
Definition: kutil.h:63
polyset sig
Definition: kutil.h:306
int posInT_pLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:8746
int posInLSig(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:4599
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.h:283
int nr
Definition: kutil.h:347
BOOLEAN honey
Definition: kutil.h:371
CFArray copy(const CFList &list)
write elements of list into an array
void initSba(ideal F, kStrategy strat)
Definition: kstd1.cc:1334
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:1028
void initSyzRules(kStrategy strat)
Definition: kutil.cc:6087
#define setmaxL
Definition: kutil.h:27
KINLINE void SetShortExpVector()
Definition: kInline.h:717
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:711
void initSbaCrit(kStrategy strat)
Definition: kutil.cc:7382
omBin_t * omBin
Definition: omStructs.h:12
int syzComp
Definition: kutil.h:357
void updateResult(ideal r, ideal Q, kStrategy strat)
Definition: kutil.cc:7864
BOOLEAN is_redundant
Definition: kutil.h:88
void initEcartNormal(TObject *h)
Definition: kutil.cc:1125
void enterOnePairSelfShifts(poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
Definition: kutil.cc:9210
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
Definition: kutil.cc:5628
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:292
int i_r1
Definition: kutil.h:199
int syzmax
Definition: kutil.h:352
BOOLEAN is_normalized
Definition: kutil.h:82
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether=NULL)
Definition: kInline.h:1082
kBucket_pt bucket
Definition: kutil.h:198
poly kHEdge
Definition: kutil.h:327
int posInT11(const TSet set, const int length, LObject &p)
Definition: kutil.cc:4034
pLDegProc pOrigLDeg_TailRing
Definition: kutil.h:298
class sLObject LObject
Definition: kutil.h:58
BOOLEAN length_pLength
Definition: kutil.h:382
TObject * TSet
Definition: kutil.h:59
int posInL15(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:4899
wlen_set lenSw
Definition: kutil.h:318
int Ll
Definition: kutil.h:354
#define kTest_S(T)
Definition: kutil.h:618
int sgn(const Rational &a)
Definition: GMPrat.cc:437
KINLINE sLObject & operator=(const sTObject &)
Definition: kInline.h:850
KINLINE poly Next()
Definition: kInline.h:280
#define FALSE
Definition: auxiliary.h:140
BOOLEAN noTailReduction
Definition: kutil.h:372
Compatiblity layer for legacy polynomial operations (over currRing)
int * S_2_R
Definition: kutil.h:342
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:8231
f
Definition: cfModGcd.cc:4022
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:7751
int c3
Definition: kutil.h:349
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:2551
int ksReducePolySig(LObject *PR, TObject *PW, long idx, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
Definition: kspoly.cc:172
BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat)
Definition: kutil.cc:5071
poly redtailBbaShift(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
Definition: kutil.cc:9721
char news
Definition: kutil.h:395
int posInT15(const TSet set, const int length, LObject &p)
Definition: kutil.cc:4281
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition: kstd2.cc:1189
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:149
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR, int uptodeg, int lV)
Definition: kutil.cc:9571
char newt
Definition: kutil.h:396
void chainCritNormal(poly p, int ecart, kStrategy strat)
Definition: kutil.cc:2186
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
Definition: kspoly.cc:563
BOOLEAN * NotUsedAxis
Definition: kutil.h:332
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
Definition: DebugPrint.h:30
BOOLEAN posInLDependsOnLength
Definition: kutil.h:384
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:964
int(* posInLSba)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.h:281
KINLINE sLObject(ring tailRing=currRing)
Definition: kInline.h:514
KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
Definition: kInline.h:930
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.h:293
KINLINE void Init(ring r=currRing)
Definition: kInline.h:107
const ideal
Definition: gb_hack.h:42
int length
Definition: kutil.h:78
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
BOOLEAN noetherSet
Definition: kutil.h:374
void enterOnePairManyShifts(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
Definition: kutil.cc:9134
int cv
Definition: kutil.h:350
void messageStat(int hilbcount, kStrategy strat)
Definition: kutil.cc:5669
KINLINE BOOLEAN IsNull() const
Definition: kInline.h:263
KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
Definition: kInline.h:914
BOOLEAN * pairtest
Definition: kutil.h:333
int & max_ind
Definition: myNF.cc:67
BOOLEAN z2homog
Definition: kutil.h:368
poly kNoether
Definition: kutil.h:328
int tl
Definition: kutil.h:353
KINLINE void HeadNormalize()
Definition: kInline.h:334
int Bl
Definition: kutil.h:355
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition: kstd2.cc:1338
long int64
Definition: auxiliary.h:112
void initSbaPos(kStrategy strat)
Definition: kutil.cc:7655
void enterOnePairSig(int i, poly p, poly pSig, int ecart, int isFromQ, kStrategy strat, int atR)
char noClearS
Definition: kutil.h:397
#define TRUE
Definition: auxiliary.h:144
#define kTest(A)
Definition: kutil.h:615
poly kCreateZeroPoly(long exp[], long cabsind, poly *t_p, ring leadRing, ring tailRing)
Definition: kutil.cc:3256
pShallowCopyDeleteProc p_shallow_copy_delete
Definition: kutil.h:338
unsigned long * sevT
Definition: kutil.h:323
BOOLEAN(* rewCrit3)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.h:294
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
Definition: kutil.h:286
void enterpairsSig(poly h, poly hSig, int from, int k, int ec, int pos, kStrategy strat, int atR=-1)
Definition: kutil.cc:3703
poly pMove2CurrTail(poly p, kStrategy strat)
Definition: kutil.cc:8897
BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat)
Definition: kutil.cc:8214
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR=-1)
Definition: kutil.cc:3597
int ak
Definition: kutil.h:356
void initS(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:5733
g
Definition: cfModGcd.cc:4031
ideal bbaShift(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat, int uptodeg, int lV)
Definition: kstd2.cc:2868
void initHilbCrit(ideal F, ideal Q, intvec **hilb, kStrategy strat)
Definition: kutil.cc:7305
int k
Definition: cfEzgcd.cc:93
KINLINE void pNorm()
Definition: kInline.h:473
int(* test_PosInT)(const TSet T, const int tl, LObject &h)
Definition: kstd2.cc:95
void initBuchMora(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:7558
#define Q
Definition: sirandom.c:25
long twoPow(long arg)
Definition: kutil.cc:3063
KINLINE unsigned long * initsevT()
Definition: kInline.h:97
int redHomog(LObject *h, kStrategy strat)
Definition: kstd2.cc:406
void enterExtendedSpoly(poly h, kStrategy strat)
Definition: kutil.cc:3481
void initEcartBBA(TObject *h)
Definition: kutil.cc:1133
KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether)
Definition: kInline.h:580
int(* red)(LObject *L, kStrategy strat)
Definition: kutil.h:277
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define KINLINE
Definition: kutil.h:49
void HEckeTest(poly pp, kStrategy strat)
Definition: kutil.cc:422
int(* posInT)(const TSet T, const int tl, LObject &h)
Definition: kutil.h:280
unsigned long currIdx
Definition: kutil.h:315
long(* pLDegProc)(poly p, int *length, ring r)
Definition: ring.h:45
void exitBuchMora(kStrategy strat)
Definition: kutil.cc:7637
int minim
Definition: kutil.h:361
int posInLF5C(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:4652
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:7325
int Bmax
Definition: kutil.h:355
KINLINE void PrepareRed(BOOLEAN use_bucket)
Definition: kInline.h:530
ideal createG0()
Definition: kutil.cc:3385
poly pp
Definition: myNF.cc:296
int lastAxis
Definition: kutil.h:359
void initSLSba(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:5935
BOOLEAN(* syzCrit)(poly sig, unsigned long not_sevSig, kStrategy strat)
Definition: kutil.h:291
KINLINE void Tail_Mult_nn(number n)
Definition: kInline.h:566
KINLINE void LmDeleteAndIter()
Definition: kInline.h:288
KINLINE void Copy()
Definition: kInline.h:729
KINLINE void SetLmTail(poly lm, poly new_p, int length, int use_bucket, ring r)
Definition: kInline.h:548
skStrategy()
Definition: kutil.cc:8579
char completeReduce_retry
Definition: kutil.h:398
void chainCritSig(poly p, int ecart, kStrategy strat)
Definition: kutil.cc:2401
int i_r
Definition: kutil.h:78
KINLINE sTObject(ring tailRing=currRing)
Definition: kInline.h:113
int strat_fac_debug
Definition: kstdfac.cc:29
int HCord
Definition: kutil.h:358
void updateS(BOOLEAN toT, kStrategy strat)
Definition: kutil.cc:6695
poly t_p
Definition: kutil.h:74
KINLINE int GetpLength()
Definition: kInline.h:268
pFDegProc pOrigFDeg
Definition: kutil.h:295
KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r=currRing)
Definition: kInline.h:1112
BOOLEAN interpt
Definition: kutil.h:365
int posInT2(const TSet set, const int length, LObject &p)
Definition: kutil.cc:4004
void(* initEcart)(TObject *L)
Definition: kutil.h:279
void kStratInitChangeTailRing(kStrategy strat)
Definition: kutil.cc:8334
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
long ind2(long arg)
Definition: kutil.cc:3036
int redRiloc(LObject *h, kStrategy strat)
Definition: kstd1.cc:351
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:1102
void(* enterOnePair)(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
Definition: kutil.h:289
long ind_fact_2(long arg)
Definition: kutil.cc:3048
KINLINE void Copy()
Definition: kInline.h:200
int lV
Definition: kutil.h:363
poly max
Definition: kutil.h:75
BOOLEAN fromT
Definition: kutil.h:373
const ring r
Definition: syzextra.cc:208
int posInT13(const TSet set, const int length, LObject &p)
Definition: kutil.cc:4213
pLDegProc pOrigLDeg
Definition: kutil.h:296
int posInT0(const TSet set, const int length, LObject &p)
Definition: kutil.cc:3965
BOOLEAN homog
Definition: kutil.h:366
void initEcartPairMora(LObject *Lp, poly f, poly g, int ecartF, int ecartG)
Definition: kutil.cc:1147
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:7466
KINLINE TObject * S_2_T(int i)
Definition: kInline.h:35
KINLINE long pLDeg()
Definition: kInline.h:764
Definition: intvec.h:16
long FDeg
Definition: kutil.h:77
int posInL17(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:4957
#define kTest_TS(A)
Definition: kutil.h:616
int posInL110(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:4818
int max_lower_index
Definition: kutil.h:316
int j
Definition: myNF.cc:70
poly p1
Definition: kutil.h:194
KINLINE long pTotalDeg() const
Definition: kInline.h:400
void pairs()
KINLINE void Clear()
Definition: kInline.h:189
KINLINE void LmDeleteAndIter()
Definition: kInline.h:602
BOOLEAN Gebauer
Definition: kutil.h:372
polyrec * poly
Definition: hilb.h:10
intset fromQ
Definition: kutil.h:319
#define messageSets(s)
Definition: kutil.h:506
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
Definition: kutil.cc:1490
KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin bin)
Definition: kInline.h:923
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:376
LObject * LSet
Definition: kutil.h:60
KINLINE TObject * T_2(const skStrategy *strat)
Definition: kInline.h:867
KINLINE poly CanonicalizeP()
Definition: kInline.h:648
void initBbaShift(ideal F, kStrategy strat)
Definition: kstd2.cc:3374
KINLINE TSet initT()
Definition: kInline.h:81
int posInL0(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:4568
void enterSSba(LObject p, int atS, kStrategy strat, int atR=-1)
Definition: kutil.cc:7030
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:1670
#define kTest_L(T)
Definition: kutil.h:619
void kDebugPrint(kStrategy strat)
Output some debug info about a given strategy.
Definition: kutil.cc:8780
ideal freegb(ideal I, int uptodeg, int lVblock)
Definition: kstd2.cc:3214
void deleteInSSba(int i, kStrategy strat)
Definition: kutil.cc:984
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
Definition: kutil.cc:3860
int redRing(LObject *h, kStrategy strat)
Definition: kstd2.cc:324
void initBba(ideal F, kStrategy strat)
Definition: kstd1.cc:1279
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:1158
LObject P
Definition: kutil.h:300
int HCord
Definition: kutil.cc:227
ideal M
Definition: kutil.h:303
unsigned sbaOrder
Definition: kutil.h:314
BOOLEAN update
Definition: kutil.h:375
int i
Definition: cfEzgcd.cc:123
poly tail
Definition: kutil.h:334
KINLINE void Normalize()
Definition: kInline.h:321
void initenterpairsShift(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV)
Definition: kutil.cc:9605
poly redtailSba(LObject *L, int pos, kStrategy strat, BOOLEAN withT=FALSE, BOOLEAN normalize=FALSE)
Definition: kstd2.cc:733
int(* posInLOld)(const LSet Ls, const int Ll, LObject *Lo, const kStrategy strat)
Definition: kutil.h:287
TObject ** R
Definition: kutil.h:340
poly lcm
Definition: kutil.h:197
KINLINE long Comp()
Definition: kInline.h:841
polyset S
Definition: kutil.h:304
int posInSyz(const kStrategy strat, const poly sig)
Definition: kutil.cc:4624
BOOLEAN sugarCrit
Definition: kutil.h:371
intset lenS
Definition: kutil.h:317
int redFirstShift(LObject *h, kStrategy strat)
Definition: kstd2.cc:3248
int posInT110(const TSet set, const int length, LObject &p)
Definition: kutil.cc:4167
int tmax
Definition: kutil.h:353
void initBuchMoraShift(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:9049
void cleanT(kStrategy strat)
Definition: kutil.cc:491
int cp
Definition: kutil.h:349
unsigned long checked
Definition: kutil.h:185
int posInT17(const TSet set, const int length, LObject &p)
Definition: kutil.cc:4339
KINLINE void pCleardenom()
Definition: kInline.h:431
int pLength
Definition: kutil.h:78
BOOLEAN newHEdge(kStrategy strat)
Definition: kutil.cc:8113
void initEcartPairBba(LObject *Lp, poly f, poly g, int ecartF, int ecartG)
Definition: kutil.cc:1140
poly sig
Definition: kutil.h:72
kStrategy strat
Definition: myNF.cc:319
void cancelunit(LObject *p, BOOLEAN inNF=FALSE)
Definition: kutil.cc:324
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:8655
Definition: kutil.h:68
BOOLEAN kHEdgeFound
Definition: kutil.h:370
intset ecartS
Definition: kutil.h:307
void exitSba(kStrategy strat)
Definition: kutil.cc:7830
poly pMoveCurrTail2poly(poly p, kStrategy strat)
Definition: kutil.cc:8911
poly t_kHEdge
Definition: kutil.h:329
BOOLEAN interred_flag
Definition: kutil.h:378
void reorderS(int *suc, kStrategy strat)
Definition: kutil.cc:3807
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
void(* chainCrit)(poly p, int ecart, kStrategy strat)
Definition: kutil.h:290
poly p2
Definition: kutil.h:194
int ksReducePolyTail(LObject *PR, TObject *PW, poly Current, poly spNoether=NULL)
Definition: kspoly.cc:491
LSet L
Definition: kutil.h:325
BOOLEAN LDegLast
Definition: kutil.h:380
#define NULL
Definition: omList.c:10
intvec * kHomW
Definition: kutil.h:336
poly * polyset
Definition: hutil.h:17
LSet B
Definition: kutil.h:326
int Lmax
Definition: kutil.h:354
KINLINE void Mult_nn(number n)
Definition: kInline.h:309
int64 wlen_type
Definition: kutil.h:54
int mu
Definition: kutil.h:351
void enterpairs(poly h, int k, int ec, int pos, kStrategy strat, int atR=-1)
Definition: kutil.cc:3671
KINLINE poly redtailBba_Z(poly p, int pos, kStrategy strat)
Definition: kInline.h:1127
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:9275
ring tailRing
Definition: kutil.h:343
void updateSShift(kStrategy strat, int uptodeg, int lV)
Definition: kutil.cc:9021
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:7991
KINLINE long pLDeg()
Definition: kInline.h:415
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
Definition: kutil.cc:1101
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
Definition: kInline.h:1145
KINLINE poly GetTP()
Definition: kInline.h:663
#define R
Definition: sirandom.c:26
denominator_list next
Definition: kutil.h:65
BOOLEAN is_special
Definition: kutil.h:97
poly t_kNoether
Definition: kutil.h:331
omBin tailBin
Definition: kutil.h:345
ideal D
Definition: kutil.h:302
const CanonicalForm & w
Definition: facAbsFact.cc:55
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.cc:5224
char overflow
Definition: kutil.h:399
KINLINE int SetLength(BOOLEAN lengt_pLength=FALSE)
Definition: kInline.h:816
int syzidxmax
Definition: kutil.h:352
intvec * kModW
Definition: kutil.h:335
BOOLEAN no_prod_crit
Definition: kutil.h:389
~skStrategy()
Definition: kutil.cc:8602
unsigned long * sevS
Definition: kutil.h:320
KINLINE long SetDegStuffReturnLDeg()
Definition: kInline.h:419
void deleteInS(int i, kStrategy strat)
Definition: kutil.cc:932
BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.cc:5201
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition: kutil.cc:5145
BOOLEAN posInLOldFlag
Definition: kutil.h:376
intset fromS
Definition: kutil.h:308
unsigned long * sevSyz
Definition: kutil.h:321
void enterSyz(LObject p, kStrategy strat, int atT)
Definition: kutil.cc:7240
int posInL10(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kstd1.cc:947
denominator_list DENOMINATOR_LIST
Definition: kutil.cc:81
poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing)
Definition: kstd2.cc:210
int * intset
Definition: kutil.h:53
KINLINE void Delete()
Definition: kInline.h:499
int kFindDivisibleByInT(const TSet &T, const unsigned long *sevT, const int tl, const LObject *L, const int start=0)
return -1 if no divisor is found number of first divisor in T, otherwise
Definition: kstd2.cc:101
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:4242
int kFindNextDivisibleByInS(const kStrategy strat, int start, int max_ind, LObject *L)
Definition: kstd2.cc:181
polyset syz
Definition: kutil.h:305
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition: kutil.cc:1039
int sl
Definition: kutil.h:351
int posInL13(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:4864
void enterT(LObject p, kStrategy strat, int atT=-1)
Definition: kutil.cc:7161
KINLINE long pFDeg() const
Definition: kInline.h:395
BOOLEAN findMinLMPair(poly sig, unsigned long not_sevSig, kStrategy strat, int start)
TSet T
Definition: kutil.h:324
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
Definition: kutil.cc:8176
p exp[i]
Definition: DebugPrint.cc:39
KINLINE long GetpFDeg() const
Definition: kInline.h:410
int i_r2
Definition: kutil.h:199
wlen_type * wlen_set
Definition: kutil.h:55
omBin lmBin
Definition: kutil.h:344
void enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV)
Definition: kutil.cc:9678
KINLINE poly LmExtractAndIter()
Definition: kInline.h:622
poly redtail(poly p, int pos, kStrategy strat)
Definition: kutil.cc:5406
int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kstd2.cc:96
BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat)
Definition: kutil.cc:5103
unsigned long sevSig
Definition: kutil.h:71
BOOLEAN use_buckets
Definition: kutil.h:377
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:1120
poly kNF2(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
Definition: kstd2.cc:2395
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether=NULL)
Definition: kInline.h:1092
KINLINE poly GetLm(ring r)
Definition: kInline.h:237
void wrp(poly p)
Definition: polys.h:281
int posInT19(const TSet set, const int length, LObject &p)
Definition: kutil.cc:4468
#define kTest_T(T)
Definition: kutil.h:617
int strat_nr
Definition: kstdfac.cc:28
kBucketDestroy & P
Definition: myNF.cc:191
int LazyPass
Definition: kutil.h:356
KINLINE void Clear()
Definition: kInline.h:493
static jList * T
Definition: janet.cc:37
static LSet initL(int nr=setmaxL)
Definition: kutil.h:416
int newIdeal
Definition: kutil.h:360
KINLINE poly CopyGetP()
Definition: kInline.h:745
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin bin)
Definition: kInline.h:905
int redNF0(LObject *P, kStrategy strat)
ideal Shdl
Definition: kutil.h:301
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:8709
BOOLEAN prod_crit
Definition: kutil.h:190
void(* enterS)(LObject h, int pos, kStrategy strat, int atR)
Definition: kutil.h:285
int(* red2)(LObject *L, kStrategy strat)
Definition: kutil.h:278
int posInT1(const TSet set, const int length, LObject &p)
Definition: kutil.cc:3976
static Poly * h
Definition: janet.cc:978
int int nonorm
Definition: myNF.cc:67
int BOOLEAN
Definition: auxiliary.h:131
KINLINE long SetpFDeg()
Definition: kInline.h:405
int redLazy(LObject *h, kStrategy strat)
Definition: kstd2.cc:844
kStrategy next
Definition: kutil.h:276
KINLINE poly kNoetherTail()
Definition: kInline.h:63
unsigned long sev
Definition: kutil.h:184
int redHoney(LObject *h, kStrategy strat)
Definition: kstd2.cc:1004
int ecart
Definition: kutil.h:78
KINLINE void T_1_2(const skStrategy *strat, TObject *&T_1, TObject *&T_2)
Definition: kInline.h:878
void enterSBba(LObject p, int atS, kStrategy strat, int atR=-1)
Definition: kutil.cc:6927
char redTailChange
Definition: kutil.h:394
pFDegProc pOrigFDeg_TailRing
Definition: kutil.h:297
int posInL11(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.cc:4664
int syzl
Definition: kutil.h:352
BOOLEAN is_sigsafe
Definition: kutil.h:93
int LazyDegree
Definition: kutil.h:356
int l
Definition: cfEzgcd.cc:94
int redSig(LObject *h, kStrategy strat)
Definition: kstd2.cc:565
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int int lazyReduce
Definition: myNF.cc:292
KINLINE long SetDegStuffReturnLDeg()
Definition: kInline.h:795
poly pCopyL2p(LObject h, kStrategy strat)
Definition: kutil.cc:8928
class sTObject TObject
Definition: kutil.h:57
ring tailRing
Definition: kutil.h:76
KINLINE void Delete()
Definition: kInline.h:175
void initSL(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:5836
poly p
Definition: kutil.h:73
intset syzIdx
Definition: kutil.h:311
KINLINE long MinComp()
Definition: kInline.h:826
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:1007
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
Definition: kspoly.cc:38
KINLINE TObject * T_1(const skStrategy *strat)
Definition: kInline.h:857
KINLINE void ShallowCopyDelete(ring new_tailRing, pShallowCopyDeleteProc p_shallow_copy_delete)
Definition: kInline.h:706
ring sbaRing(kStrategy strat, const ring r=currRing, BOOLEAN complete=TRUE, int sgn=1)
Definition: kutil.cc:8361