My Project
Loading...
Searching...
No Matches
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#ifdef HAVE_OMALLOC
16#endif
17
18#include "misc/mylimits.h"
19
20#include "kernel/polys.h"
22
23#include "kernel/structs.h"
24#include "kernel/GBEngine/kstd1.h" /* for s_poly_proc_t */
25
26// define if tailrings should be used
27#define HAVE_TAIL_RING
28
29#define setmax 128
30#define setmaxL ((4096-12)/sizeof(LObject))
31#define setmaxLinc ((4096)/sizeof(LObject))
32
33#define setmaxT ((4096-12)/sizeof(TObject))
34#define setmaxTinc ((4096)/sizeof(TObject))
35
36#define RED_CANONICALIZE 200
37#define REDNF_CANONICALIZE 60
38#define REDTAIL_CANONICALIZE 100
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
53typedef int* intset;
56
57typedef class sTObject TObject;
58typedef class sLObject LObject;
59typedef TObject * TSet;
60typedef LObject * LSet;
61
64
67
69{
70public:
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_exp; // p_GetMaxExpP(pNext(p))
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
83#ifdef HAVE_SHIFTBBA
84 int shift;
85#endif
86
87 /*BOOLEAN*/ char is_normalized; // true, if pNorm was called on p, false otherwise
88 // used in incremental sba() with F5C:
89 // we know some of the redundant elements in
90 // strat->T beforehand, so we can just discard
91 // them and do not need to consider them in the
92 // interreduction process
93 /*BOOLEAN*/ char is_redundant;
94 // used in sba's sig-safe reduction:
95 // sometimes we already know that a reducer
96 // is sig-safe, so no need for a real
97 // sig-safeness check
98 /*BOOLEAN*/ char is_sigsafe;
99
100
101#ifdef HAVE_PLURAL
102 /*BOOLEAN*/ char is_special; // true, it is a new special S-poly (e.g. for SCA)
103#endif
104
105 // initialization
106 KINLINE void Init(ring r = currRing);
111
112 KINLINE void Set(ring r=currRing);
113 KINLINE void Set(poly p_in, ring r=currRing);
114 KINLINE void Set(poly p_in, ring c_r, ring t_r);
115
116 // Frees the polys of T
117 KINLINE void Delete();
118 // Sets polys to NULL
119 KINLINE void Clear();
120 // makes a copy of the poly of T
121 KINLINE void Copy();
122
123 // ring-dependent Lm access: these might result in allocation of monomials
124 KINLINE poly GetLmCurrRing();
125 KINLINE poly GetLmTailRing();
126 KINLINE poly GetLm(ring r);
127 // this returns Lm and ring r (preferably from tailRing), but does not
128 // allocate a new poly
129 KINLINE void GetLm(poly &p, ring &r) const;
130
131#ifdef OLIVER_PRIVAT_LT
132 // routines for calc. with rings
133 KINLINE poly GetLtCurrRing();
134 KINLINE poly GetLtTailRing();
135 KINLINE poly GetLt(ring r);
136 KINLINE void GetLt(poly &p, ring &r) const;
137#endif
138
139 KINLINE BOOLEAN IsNull() const;
140
141 KINLINE int GetpLength();
142
143 // makes sure that T.p exists
144 KINLINE void SetLmCurrRing();
145
146 // Iterations
147 // simply get the next monomial
148 KINLINE poly Next();
150
151 // deg stuff
152 // compute pTotalDegree
153 KINLINE long pTotalDeg() const;
154 // computes pFDeg
155 KINLINE long pFDeg() const;
156 // computes and sets FDeg
157 KINLINE long SetpFDeg();
158 // gets stored FDeg
159 KINLINE long GetpFDeg() const;
160
161 // computes pLDeg
162 KINLINE long pLDeg();
163 // sets length, FDeg, returns LDeg
165
166 // arithmetic
167 KINLINE void Mult_nn(number n);
169 pShallowCopyDeleteProc p_shallow_copy_delete,
171 // manipulations
172 KINLINE void pNorm();
173 KINLINE void pCleardenom();
174 KINLINE void pContent();
175
176#ifdef KDEBUG
177 void wrp();
178#endif
179};
180
182
183class sLObject : public sTObject
184{
185
186public:
187 unsigned long sev;
188 poly p1,p2; /*- the pair p comes from,
189 lm(pi) in currRing, tail(pi) in tailring -*/
190
191 poly lcm; /*- the lcm of p1,p2 -*/
193 int i_r1, i_r2;
194 unsigned checked; // this is the index of S up to which
195 // the corresponding LObject was already checked in
196 // critical pair creation => when entering the
197 // reduction process it is enough to start a second
198 // rewritten criterion check from checked+1 onwards
200 // NOTE: If prod_crit = TRUE then the corresponding pair is
201 // detected by Buchberger's Product Criterion and can be
202 // deleted
203
204 // initialization
209
210 // Frees the polys of L
211 KINLINE void Delete();
212 KINLINE void Clear();
213
214 // Iterations
217
218 // spoly related things
219 // preparation for reduction if not spoly
221 KINLINE void SetLmTail(poly lm, poly new_p, int length,
222 int use_bucket, ring r);
223 KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether);
225 // deletes bucket, makes sure that p and t_p exists
226 KINLINE poly GetP(omBin lmBin = (omBin)NULL);
227 // similar, except that only t_p exists
228 KINLINE poly GetTP();
229
230 // does not delete bucket, just canonicalizes it
231 // returned poly is such that Lm(p) \in currRing, Tail(p) \in tailRing
232 KINLINE void CanonicalizeP();
233
234 // makes a copy of the poly of L
235 KINLINE void Copy();
236
237 KINLINE int GetpLength();
239 KINLINE long pLDeg();
243
244 // returns minimal component of p
245 KINLINE long MinComp();
246 // returns component of p
247 KINLINE long Comp();
248
250 pShallowCopyDeleteProc p_shallow_copy_delete);
251
252 // sets sev
254
255 // enable assignment from TObject
257
258 // get T's corresponding to p1, p2: they might return NULL
259 KINLINE TObject* T_1(const skStrategy* strat);
260 KINLINE TObject* T_2(const skStrategy* strat);
261 KINLINE void T_1_2(const skStrategy* strat,
262 TObject* &T_1, TObject* &T_2);
263
264 // simplify coefficients
265 KINLINE void Normalize();
266 KINLINE void HeadNormalize();
267};
268
270
273 : public omallocClass
274#endif
275{
276public:
278 int (*red)(LObject * L,kStrategy strat);
281 int (*posInT)(const TSet T,const int tl,LObject &h);
282 int (*posInLSba)(const LSet set, const int length,
283 LObject* L,const kStrategy strat);
284 int (*posInL)(const LSet set, const int length,
285 LObject* L,const kStrategy strat);
286 void (*enterS)(LObject &h, int pos,kStrategy strat, int atR/* =-1*/ );
287 void (*initEcartPair)(LObject * h, poly f, poly g, int ecartF, int ecartG);
288 int (*posInLOld)(const LSet Ls,const int Ll,
289 LObject* Lo,const kStrategy strat);
290 void (*enterOnePair) (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR /*= -1*/);
291 void (*chainCrit) (poly p,int ecart,kStrategy strat);
292 BOOLEAN (*syzCrit) (poly sig, unsigned long not_sevSig, kStrategy strat);
293 BOOLEAN (*rewCrit1) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
294 BOOLEAN (*rewCrit2) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
295 BOOLEAN (*rewCrit3) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
301
304 ideal D; /*V(S) is in D(D)*/
305 ideal M; /*set of minimal generators*/
310 intset fromS; // from which S[i] S[j] comes from
311 // this is important for signature-based
312 // algorithms
313 intset syzIdx;// index in the syz array at which the first
314 // syzygy of component i comes up
315 // important for signature-based algorithms
316 unsigned sbaOrder;
320 wlen_set lenSw; /* for tgb.ccc */
322 unsigned long* sevS;
323 unsigned long* sevSyz;
324 unsigned long* sevSig;
325 unsigned long* sevT;
330 poly t_kNoether; // same polys in tailring
331 KINLINE poly kNoetherTail();
333 BOOLEAN * pairtest;/*used for enterOnePair*/
334 poly tail;
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;
346 int nr;
347 int cp,c3;
348 int sl,mu;
350 int tl,tmax;
351 int Ll,Lmax;
352 int Bl,Bmax;
357 int minim;
358 bool sigdrop; //This is used to check sigdrop in sba over Z
359 int nrsyzcrit; // counts how many pairs are deleted by SyzCrit
360 int nrrewcrit; // counts how many pairs are deleted by FaugereRewCrit
361 int sbaEnterS; // sba over Z strategy: if sigdrop element has _*gen(sbaEnterS+1), then
362 // add directly sbaEnterS elements into S
363 int blockred; // counter for blocked reductions in redSig
365 #ifdef HAVE_SHIFTBBA
366 int cv; // in shift bases: counting V criterion
367 /*BOOLEAN*/ char rightGB;
368 #endif
369 /*BOOLEAN*/ char interpt;
370 /*BOOLEAN*/ char homog;
371#ifdef HAVE_PLURAL
372 /*BOOLEAN*/ char z2homog; // Z_2 - homogeneous input allows product criterion in commutative and SCA cases!
373#endif
374 /*BOOLEAN*/ char kAllAxis; // all axis are used -> (re)compute noether
375 /*BOOLEAN*/ char honey,sugarCrit;
376 /*BOOLEAN*/ char Gebauer,noTailReduction;
377 /*BOOLEAN*/ char fromT;
378 /*BOOLEAN*/ char noetherSet;
379 /*BOOLEAN*/ char update;
380 /*BOOLEAN*/ char posInLOldFlag;
381 /*BOOLEAN*/ char use_buckets;
382 // if set, pLDeg(p, l) == (pFDeg(pLast(p), pLength)
383 /*BOOLEAN*/ char LDegLast;
384 // if set, then L.length == L.pLength
385 /*BOOLEAN*/ char length_pLength;
386 // if set, then posInL does not depend on L.length
387 /*BOOLEAN*/ char posInLDependsOnLength;
388 /*FALSE, if posInL == posInL10*/
389#ifdef HAVE_PLURAL
390 // set this flag to 1 to stop the product criteria
391 // use ALLOW_PROD_CRIT(strat) to test
392 /*BOOLEAN*/ char no_prod_crit;
393#define ALLOW_PROD_CRIT(A) (!(A)->no_prod_crit)
394#else
395#define ALLOW_PROD_CRIT(A) (1)
396#endif
398 char news;
399 char newt;/*used for messageSets*/
403
404 skStrategy();
405 ~skStrategy();
406
407 // return TObject corresponding to S[i]: assume that it exists
408 // i.e. no error checking is done
409 KINLINE TObject* S_2_T(int i);
410 // like S_2_T, except that NULL is returned if it can not be found
411 KINLINE TObject* s_2_t(int i);
412};
413
414void deleteHC(poly *p, int *e, int *l, kStrategy strat);
416void deleteInS (int i,kStrategy strat);
417void cleanT (kStrategy strat);
418static inline LSet initL (int nr=setmaxL)
419{ return (LSet)omAlloc(nr*sizeof(LObject)); }
420void deleteInL(LSet set, int *length, int j,kStrategy strat);
421void enterL (LSet *set,int *length, int *LSetmax, LObject p,int at);
422void enterSBba (LObject &p,int atS,kStrategy strat, int atR = -1);
423void enterSBbaShift (LObject &p,int atS,kStrategy strat, int atR = -1);
424void enterSSba (LObject &p,int atS,kStrategy strat, int atR = -1);
425void initEcartPairBba (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
426void initEcartPairMora (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
427int posInS (const kStrategy strat, const int length, const poly p,
428 const int ecart_p);
429int posInSMonFirst (const kStrategy strat, const int length, const poly p);
430int posInIdealMonFirst (const ideal F, const poly p,int start = 0,int end = -1);
431int posInT0 (const TSet set,const int length,LObject &p);
432int posInT1 (const TSet set,const int length,LObject &p);
433int posInT2 (const TSet set,const int length,LObject &p);
434int posInT11 (const TSet set,const int length,LObject &p);
435int posInTSig (const TSet set,const int length,LObject &p);
436int posInT110 (const TSet set,const int length,LObject &p);
437int posInT13 (const TSet set,const int length,LObject &p);
438int posInT15 (const TSet set,const int length,LObject &p);
439int posInT17 (const TSet set,const int length,LObject &p);
440int posInT17_c (const TSet set,const int length,LObject &p);
441int posInT19 (const TSet set,const int length,LObject &p);
442int posInT_EcartpLength(const TSet set,const int length,LObject &p);
443int posInT_EcartFDegpLength(const TSet set,const int length,LObject &p);
444int posInT_FDegpLength(const TSet set,const int length,LObject &p);
445int posInT_pLength(const TSet set,const int length,LObject &p);
446
447#ifdef HAVE_MORE_POS_IN_T
448int posInT_EcartFDegpLength(const TSet set,const int length,LObject &p);
449int posInT_FDegpLength(const TSet set,const int length,LObject &p);
450int posInT_pLength(const TSet set,const int length,LObject &p);
451#endif
452
453
454void reorderS (int* suc,kStrategy strat);
455int posInLF5C (const LSet set, const int length,
456 LObject* L,const kStrategy strat);
457int posInLSig (const LSet set, const int length,
458 LObject* L,const kStrategy strat);
459int posInLSigRing (const LSet set, const int length,
460 LObject* L,const kStrategy strat);
461int posInSyz (const kStrategy strat, const poly sig);
462int posInL0 (const LSet set, const int length,
463 LObject* L,const kStrategy strat);
464int posInL11 (const LSet set, const int length,
465 LObject* L,const kStrategy strat);
466int posInL11Ring (const LSet set, const int length,
467 LObject* L,const kStrategy strat);
468int posInLF5CRing (const LSet set, int start , const int length,
469 LObject* L,const kStrategy strat);
470int posInL11Ringls (const LSet set, const int length,
471 LObject* L,const kStrategy strat);
472int posInL13 (const LSet set, const int length,
473 LObject* L,const kStrategy strat);
474int posInL15 (const LSet set, const int length,
475 LObject* L,const kStrategy strat);
476int posInL15Ring (const LSet set, const int length,
477 LObject* L,const kStrategy strat);
478int posInL17 (const LSet set, const int length,
479 LObject* L,const kStrategy strat);
480int posInL10 (const LSet set, const int length,
481 LObject* L,const kStrategy strat);
482int posInL10Ring (const LSet set, const int length,
483 LObject* L,const kStrategy strat);
484int posInL110 (const LSet set, const int length,
485 LObject* L,const kStrategy strat);
488KINLINE poly redtailBba_Ring (poly p,int end_pos,kStrategy strat);
489KINLINE poly redtailBba_Z (poly p,int end_pos,kStrategy strat);
490poly redtailBba_NF (poly p, kStrategy strat );
491poly redtailBba_Ring (LObject* L, int end_pos, kStrategy strat );
492poly redtailBba_Z (LObject* L, int end_pos, kStrategy strat );
493void redtailBbaAlsoLC_Z (LObject* L, int end_pos, kStrategy strat );
494poly redtailBba (LObject *L, int end_pos,kStrategy strat,
496poly redtailBbaBound (LObject *L, int end_pos,kStrategy strat,int bound,
498poly redtailSba (LObject *L, int end_pos,kStrategy strat,
501poly redtail (poly p,int end_pos,kStrategy strat);
502poly redtail (LObject *L,int end_pos,kStrategy strat);
503poly redNF (poly h,int & max_ind,int nonorm,kStrategy strat);
504int redNF0 (LObject *P,kStrategy strat);
505poly redNFTail (poly h,const int sl,kStrategy strat);
506int redHoney (LObject* h, kStrategy strat);
508int redLiftstd (LObject* h, kStrategy strat);
509int redRing (LObject* h,kStrategy strat);
510int redRing_Z (LObject* h,kStrategy strat);
511int redRiloc (LObject* h,kStrategy strat);
512void enterExtendedSpoly(poly h,kStrategy strat);
513void enterExtendedSpolySig(poly h,poly hSig,kStrategy strat);
514void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR = -1);
515void superenterpairsSig (poly h,poly hSig,int hFrom,int k,int ecart,int pos,kStrategy strat, int atR = -1);
516int redLazy (LObject* h,kStrategy strat);
517int redHomog (LObject* h,kStrategy strat);
518int redSig (LObject* h,kStrategy strat);
519int redSigRing (LObject* h,kStrategy strat);
520//adds hSig to be able to check with F5's criteria when entering pairs!
521void enterpairsSig (poly h, poly hSig, int from, int k, int ec, int pos,kStrategy strat, int atR = -1);
522void enterpairs (poly h, int k, int ec, int pos,kStrategy strat, int atR = -1);
524void pairs ();
526void message (int i,int* reduc,int* olddeg,kStrategy strat,int red_result);
527void messageStat (int hilbcount,kStrategy strat);
528void messageStatSBA (int hilbcount,kStrategy strat);
529#ifdef KDEBUG
530void messageSets (kStrategy strat);
531#else
532#define messageSets(s) do {} while (0)
533#endif
534
536void initEcartBBA (TObject* h);
537void initS (ideal F, ideal Q,kStrategy strat);
538void initSL (ideal F, ideal Q,kStrategy strat);
539void initSLSba (ideal F, ideal Q,kStrategy strat);
540/*************************************************
541 * when initializing a new bunch of principal
542 * syzygies at the beginning of a new iteration
543 * step in a signature-based algorithm we
544 * compute ONLY the leading elements of those
545 * syzygies, NOT the whole syzygy
546 * NOTE: this needs to be adjusted for a more
547 * general approach on signature-based algorithms
548 ***********************************************/
549void initSyzRules (kStrategy strat);
550void updateS(BOOLEAN toT,kStrategy strat);
551void enterSyz (LObject &p,kStrategy strat, int atT);
552void enterT (LObject &p,kStrategy strat, int atT = -1);
553void replaceInLAndSAndT(LObject &p, int tj, kStrategy strat);
554void enterT_strong (LObject &p,kStrategy strat, int atT = -1);
556void HEckeTest (poly pp,kStrategy strat);
557void initBuchMoraCrit(kStrategy strat);
558void initSbaCrit(kStrategy strat);
559void initHilbCrit(ideal F, ideal Q, intvec **hilb,kStrategy strat);
560void initBuchMoraPos(kStrategy strat);
562void initSbaPos(kStrategy strat);
563void initBuchMora (ideal F, ideal Q,kStrategy strat);
564void initSbaBuchMora (ideal F, ideal Q,kStrategy strat);
565void exitBuchMora (kStrategy strat);
566void exitSba (kStrategy strat);
567void updateResult(ideal r,ideal Q,kStrategy strat);
570void enterOnePairNormal (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR);
571void chainCritNormal (poly p,int ecart,kStrategy strat);
572void chainCritOpt_1 (poly,int,kStrategy strat);
573void chainCritSig (poly p,int ecart,kStrategy strat);
576BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat);
577BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat);
578KINLINE BOOLEAN arriRewDummy(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
579BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
580BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
581BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
582BOOLEAN findMinLMPair(poly sig, unsigned long not_sevSig, kStrategy strat, int start);
583
584/// returns index of p in TSet, or -1 if not found
585int kFindInT(poly p, TSet T, int tlength);
586#ifdef HAVE_SHIFTBBA
587int kFindInTShift(poly p, TSet T, int tlength);
588#endif
589
590/// return -1 if no divisor is found
591/// number of first divisor in T, otherwise
592int kFindDivisibleByInT(const kStrategy strat, const LObject* L, const int start=0);
593int kFindDivisibleByInT_Z(const kStrategy strat, const LObject* L, const int start=0);
594int kFindSameLMInT_Z(const kStrategy strat, const LObject* L, const int start=0);
595
596/// tests if T[0] divides the leading monomial of L, returns -1 if not
597int kTestDivisibleByT0_Z(const kStrategy strat, const LObject* L);
598/// return -1 if no divisor is found
599/// number of first divisor in S, otherwise
600int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject* L);
601
602int kFindNextDivisibleByInS(const kStrategy strat, int start,int max_ind, LObject* L);
603TObject* kFindDivisibleByInS_T(kStrategy strat, int end_pos, LObject* L, TObject *T, long ecart = LONG_MAX);
604
605/***************************************************************
606 *
607 * stuff to be inlined
608 *
609 ***************************************************************/
610
613KINLINE unsigned long* initsevT();
614KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin bin);
615KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing, omBin bin);
618
619KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing);
620KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing);
623
624// if exp bound is not violated, return TRUE and
625// get m1 = LCM(LM(p1), LM(p2))/LM(p1)
626// m2 = LCM(LM(p1), LM(p2))/LM(p2)
627// return FALSE and m1 == NULL, m2 == NULL , otherwise
628KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r,
629 poly &m1, poly &m2, const ring m_r);
630KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing,
631 poly &m1, poly &m2, poly &lcm, const ring taiRing);
632#ifdef KDEBUG
633// test strat
634BOOLEAN kTest(kStrategy strat);
635// test strat, and test that S is contained in T
637// test LObject
639 BOOLEAN testp = FALSE, int lpos = -1,
640 TSet T = NULL, int tlength = -1);
641// test TObject
642BOOLEAN kTest_T(TObject* T, kStrategy strat, int tpos = -1, char TN = '?');
643// test set strat->SevS
645#else
646#define kTest(A) (TRUE)
647#define kTest_TS(A) (TRUE)
648#define kTest_T(T,S) (TRUE)
649#define kTest_S(T) (TRUE)
650#define kTest_L(T,R) (TRUE)
651#endif
652
653
654/***************************************************************
655 *
656 * From kstd2.cc
657 *
658 ***************************************************************/
659poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing);
662poly kNF2 (ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce);
663ideal kNF2 (ideal F,ideal Q,ideal q, kStrategy strat, int lazyReduce);
664poly kNF2Bound (ideal F, ideal Q, poly q,int bound, kStrategy strat, int lazyReduce);
666void initBba(kStrategy strat);
667void initSba(ideal F,kStrategy strat);
668void f5c (kStrategy strat, int& olddeg, int& minimcnt, int& hilbeledeg,
669 int& hilbcount, int& srmax, int& lrmax, int& reduc, ideal Q,
670 intvec *w,intvec *hilb );
671
672/***************************************************************
673 *
674 * From kspoly.cc
675 *
676 ***************************************************************/
677// Reduces PR with PW
678// Assumes PR != NULL, PW != NULL, Lm(PW) divides Lm(PR)
679// Changes: PR
680// Const: PW
681// If coef != NULL, then *coef is a/gcd(a,b), where a = LC(PR), b = LC(PW)
682// If strat != NULL, tailRing is changed if reduction would violate exp bound
683// of tailRing
684// Returns: 0 everything ok, no tailRing change
685// 1 tailRing has successfully changed (strat != NULL)
686// 2 no reduction performed, tailRing needs to be changed first
687// (strat == NULL)
688// -1 tailRing change could not be performed due to exceeding exp
689// bound of currRing
690// reduce should be set inside "kNF" (only relevant for rings)
692 TObject* PW,
693 poly spNoether = NULL,
694 number *coef = NULL,
695 poly *mon =NULL,
696 kStrategy strat = NULL,
698
699/* like ksReducePoly, but if the reducer has only 1 term we still
700 * compute a possible coefficient multiplier for PR. this comes from
701 * a special situation in redRing_Z and it is used only there. */
703 TObject* PW,
704 poly spNoether = NULL,
705 number *coef = NULL,
706 kStrategy strat = NULL);
707
709 TObject* PW,
710 poly spNoether = NULL,
711 number *coef = NULL,
712 kStrategy strat = NULL);
713
714
716 TObject* PW,
717 poly spNoether = NULL,
718 number *coef = NULL,
719 kStrategy strat = NULL);
720
722 TObject* PW,
723 int bound,
724 poly spNoether = NULL,
725 number *coef = NULL,
726 kStrategy strat = NULL);
727
728// Reduces PR with PW
729// Assumes PR != NULL, PW != NULL, Lm(PW) divides Lm(PR)
730// Changes: PR
731// Const: PW
732// If coef != NULL, then *coef is a/gcd(a,b), where a = LC(PR), b = LC(PW)
733// If strat != NULL, tailRing is changed if reduction would violate exp bound
734// of tailRing
735// Returns: 0 everything ok, no tailRing change
736// 1 tailRing has successfully changed (strat != NULL)
737// 2 no reduction performed, tailRing needs to be changed first
738// (strat == NULL)
739// 3 no reduction performed, not sig-safe!!!
740// -1 tailRing change could not be performed due to exceeding exp
741// bound of currRing
743 TObject* PW,
744 long idx,
745 poly spNoether = NULL,
746 number *coef = NULL,
747 kStrategy strat = NULL);
748
750 TObject* PW,
751 long idx,
752 poly spNoether = NULL,
753 number *coef = NULL,
754 kStrategy strat = NULL);
755
756// Reduces PR at Current->next with PW
757// Assumes PR != NULL, Current contained in PR
758// Current->next != NULL, LM(PW) divides LM(Current->next)
759// Changes: PR
760// Const: PW
761// Return: see ksReducePoly
763 TObject* PW,
764 poly Current,
765 poly spNoether = NULL);
766
768
769// Creates S-Poly of Pair
770// Const: Pair->p1, Pair->p2
771// Changes: Pair->p == S-Poly of p1, p2
772// Assume: Pair->p1 != NULL && Pair->p2
774 int use_buckets=0, ring tailRing=currRing,
775 poly m1 = NULL, poly m2 = NULL, TObject** R = NULL);
776
777/*2
778* creates the leading term of the S-polynomial of p1 and p2
779* do not destroy p1 and p2
780* remarks:
781* 1. the coefficient is 0 (nNew)
782* 2. pNext is undefined
783*/
784poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing);
785
786
787// old stuff
788KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether = NULL);
789KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether = NULL);
790KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether = NULL, ring r = currRing);
791KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r = currRing);
792
793/***************************************************************
794 *
795 * Routines related for ring changes during std computations
796 *
797 ***************************************************************/
798// return TRUE and set m1, m2 to k_GetLcmTerms,
799// if spoly creation of strat->P does not violate
800// exponent bound of strat->tailRing
801// FALSE, otherwise
802BOOLEAN kCheckSpolyCreation(LObject* L, kStrategy strat, poly &m1, poly &m2);
803// return TRUE if gcdpoly creation of R[atR] and S[atS] does not violate
804// exponent bound of strat->tailRing
805// FALSE, otherwise
806BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat);
808void postReduceByMon(LObject* h, kStrategy strat);
810void finalReduceByMon(kStrategy strat);
811// change strat->tailRing and adjust all data in strat, L, and T:
812// new tailRing has larger exponent bound
813// do nothing and return FALSE if exponent bound increase would result in
814// larger exponent bound that that of currRing
816 LObject* L = NULL, TObject* T = NULL,
817 // take this as new_expbound: if 0
818 // new expbound is 2*expbound of tailRing
819 unsigned long new_expbound = 0);
820// initiate a change of the tailRing of strat -- should be called
821// right before main loop in bba
823
824/// Output some debug info about a given strategy
825void kDebugPrint(kStrategy strat);
826
827// getting sb order for sba computations
828ring sbaRing(kStrategy strat, const ring r=currRing, BOOLEAN complete=TRUE, int sgn=1);
829
830KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k,
831 kStrategy strat);
832
834
835/* shiftgb stuff */
837
838#ifdef HAVE_SHIFTBBA
839static inline int kFindInL1(const poly p, const kStrategy strat)
840{
841 for(int i=strat->Ll;i>=0;i--)
842 {
843 if (p==strat->L[i].p1) return i;
844 }
845 return -1;
846}
847
848void enterTShift(LObject p, kStrategy strat, int atT = -1);
849
850BOOLEAN enterOnePairShift (poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS);
851
852void enterpairsShift (poly h,int k,int ecart,int pos,kStrategy strat, int atR);
853
854void superenterpairsShift (poly h,int k,int ecart,int pos,kStrategy strat, int atR);
855
857
858int redFirstShift (LObject* h,kStrategy strat); // ok
859
861#endif
862
863// test syz strategy: // will be removed soon
864EXTERN_VAR int (*test_PosInT)(const TSet T,const int tl,LObject &h);
865EXTERN_VAR int (*test_PosInL)(const LSet set, const int length,
866 LObject* L,const kStrategy strat);
867
868static inline void kDeleteLcm(LObject *P)
869{
870 if (P->lcm!=NULL)
871 {
873 pLmDelete(P->lcm);
874 else
875 pLmFree(P->lcm);
876 P->lcm=NULL;
877 }
878}
879
880void initenterpairs (poly h,int k,int ecart,int isFromQ,kStrategy strat, int atR = -1);
881#endif
int sgn(const Rational &a)
Definition GMPrat.cc:430
long int64
Definition auxiliary.h:68
int BOOLEAN
Definition auxiliary.h:87
#define TRUE
Definition auxiliary.h:100
#define FALSE
Definition auxiliary.h:96
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition cf_gcd.cc:676
int l
Definition cfEzgcd.cc:100
int m
Definition cfEzgcd.cc:128
int i
Definition cfEzgcd.cc:132
int k
Definition cfEzgcd.cc:99
int p
Definition cfModGcd.cc:4086
g
Definition cfModGcd.cc:4098
static CanonicalForm bound(const CFMatrix &M)
Definition cf_linsys.cc:460
FILE * f
Definition checklibs.c:9
KINLINE long SetDegStuffReturnLDeg()
Definition kInline.h:847
KINLINE void Tail_Mult_nn(number n)
Definition kInline.h:652
int i_r1
Definition kutil.h:193
KINLINE void Copy()
Definition kInline.h:800
KINLINE void Delete()
Definition kInline.h:585
KINLINE void LmDeleteAndIter()
Definition kInline.h:688
KINLINE TObject * T_2(const skStrategy *strat)
Definition kInline.h:918
KINLINE void PrepareRed(BOOLEAN use_bucket)
Definition kInline.h:616
unsigned checked
Definition kutil.h:194
KINLINE void CanonicalizeP()
Definition kInline.h:361
KINLINE void SetLmTail(poly lm, poly new_p, int length, int use_bucket, ring r)
Definition kInline.h:634
KINLINE void T_1_2(const skStrategy *strat, TObject *&T_1, TObject *&T_2)
Definition kInline.h:929
KINLINE void Normalize()
Definition kInline.h:347
unsigned long sev
Definition kutil.h:187
KINLINE void Init(ring tailRing=currRing)
Definition kInline.h:592
KINLINE long MinComp()
Definition kInline.h:878
kBucket_pt bucket
Definition kutil.h:192
poly p2
Definition kutil.h:188
BOOLEAN prod_crit
Definition kutil.h:199
KINLINE TObject * T_1(const skStrategy *strat)
Definition kInline.h:908
KINLINE int GetpLength()
Definition kInline.h:861
KINLINE int SetLength(BOOLEAN lengt_pLength=FALSE)
Definition kInline.h:868
poly lcm
Definition kutil.h:191
KINLINE void Clear()
Definition kInline.h:578
KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether)
Definition kInline.h:666
KINLINE void ShallowCopyDelete(ring new_tailRing, pShallowCopyDeleteProc p_shallow_copy_delete)
Definition kInline.h:777
KINLINE poly GetTP()
Definition kInline.h:734
KINLINE long pLDeg()
Definition kInline.h:816
KINLINE sLObject & operator=(const sTObject &)
Definition kInline.h:902
KINLINE void SetShortExpVector()
Definition kInline.h:788
KINLINE void HeadNormalize()
Definition kInline.h:367
KINLINE poly GetP(omBin lmBin=(omBin) NULL)
Definition kInline.h:750
poly p1
Definition kutil.h:188
KINLINE long Comp()
Definition kInline.h:893
KINLINE poly LmExtractAndIter()
Definition kInline.h:708
int i_r2
Definition kutil.h:193
KINLINE poly GetLm(ring r)
Definition kInline.h:262
KINLINE poly GetLmCurrRing()
Definition kInline.h:242
char is_redundant
Definition kutil.h:93
poly sig
Definition kutil.h:72
KINLINE void Init(ring r=currRing)
Definition kInline.h:110
KINLINE void Mult_nn(number n)
Definition kInline.h:334
int length
Definition kutil.h:79
KINLINE long SetDegStuffReturnLDeg()
Definition kInline.h:446
KINLINE poly GetLmTailRing()
Definition kInline.h:249
KINLINE void pCleardenom()
Definition kInline.h:458
int ecart
Definition kutil.h:78
KINLINE long GetpFDeg() const
Definition kInline.h:437
KINLINE void ShallowCopyDelete(ring new_tailRing, omBin new_tailBin, pShallowCopyDeleteProc p_shallow_copy_delete, BOOLEAN set_max=TRUE)
Definition kInline.h:381
char is_special
Definition kutil.h:102
KINLINE void SetLmCurrRing()
Definition kInline.h:299
poly max_exp
Definition kutil.h:75
char is_normalized
Definition kutil.h:87
KINLINE long pLDeg()
Definition kInline.h:442
char is_sigsafe
Definition kutil.h:98
KINLINE void LmDeleteAndIter()
Definition kInline.h:313
int pLength
Definition kutil.h:80
KINLINE long pFDeg() const
Definition kInline.h:422
int i_r
Definition kutil.h:81
poly p
Definition kutil.h:73
KINLINE BOOLEAN IsNull() const
Definition kInline.h:288
KINLINE void Set(ring r=currRing)
Definition kInline.h:106
KINLINE void Delete()
Definition kInline.h:199
poly t_p
Definition kutil.h:74
ring tailRing
Definition kutil.h:76
KINLINE int GetpLength()
Definition kInline.h:293
KINLINE void pNorm()
Definition kInline.h:558
KINLINE void Clear()
Definition kInline.h:213
long FDeg
Definition kutil.h:77
KINLINE poly Next()
Definition kInline.h:305
void wrp()
Definition kutil.cc:771
int shift
Definition kutil.h:84
KINLINE void pContent()
Definition kInline.h:536
KINLINE long pTotalDeg() const
Definition kInline.h:427
KINLINE long SetpFDeg()
Definition kInline.h:432
unsigned long sevSig
Definition kutil.h:71
KINLINE void Copy()
Definition kInline.h:224
KINLINE poly kNoetherTail()
Definition kInline.h:66
unsigned long * sevSyz
Definition kutil.h:323
kStrategy next
Definition kutil.h:277
intvec * kModW
Definition kutil.h:335
bool sigdrop
Definition kutil.h:358
poly t_kNoether
Definition kutil.h:330
int syzComp
Definition kutil.h:354
int * S_2_R
Definition kutil.h:342
ring tailRing
Definition kutil.h:343
void(* chainCrit)(poly p, int ecart, kStrategy strat)
Definition kutil.h:291
ideal D
Definition kutil.h:304
char noTailReduction
Definition kutil.h:376
int currIdx
Definition kutil.h:317
int nrsyzcrit
Definition kutil.h:359
intset lenS
Definition kutil.h:319
int nrrewcrit
Definition kutil.h:360
char posInLOldFlag
Definition kutil.h:380
pFDegProc pOrigFDeg_TailRing
Definition kutil.h:298
int Ll
Definition kutil.h:351
TSet T
Definition kutil.h:326
BOOLEAN(* rewCrit1)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.h:293
char news
Definition kutil.h:398
omBin lmBin
Definition kutil.h:344
int syzmax
Definition kutil.h:349
int Bl
Definition kutil.h:352
intset ecartS
Definition kutil.h:309
int syzidxmax
Definition kutil.h:349
char honey
Definition kutil.h:375
char rightGB
Definition kutil.h:367
polyset S
Definition kutil.h:306
int minim
Definition kutil.h:357
poly kNoether
Definition kutil.h:329
BOOLEAN * NotUsedAxis
Definition kutil.h:332
LSet B
Definition kutil.h:328
BOOLEAN * pairtest
Definition kutil.h:333
int cp
Definition kutil.h:347
int ak
Definition kutil.h:353
TObject ** R
Definition kutil.h:340
BOOLEAN(* rewCrit3)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.h:295
int lastAxis
Definition kutil.h:355
ideal M
Definition kutil.h:305
int tl
Definition kutil.h:350
int(* red2)(LObject *L, kStrategy strat)
Definition kutil.h:279
unsigned long * sevT
Definition kutil.h:325
unsigned long * sevSig
Definition kutil.h:324
int nr
Definition kutil.h:346
intvec * kHomW
Definition kutil.h:336
int max_lower_index
Definition kutil.h:318
poly tail
Definition kutil.h:334
char sugarCrit
Definition kutil.h:375
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.h:284
KINLINE TObject * s_2_t(int i)
Definition kInline.h:47
int blockred
Definition kutil.h:363
intset syzIdx
Definition kutil.h:313
ideal Shdl
Definition kutil.h:303
int syzl
Definition kutil.h:349
unsigned sbaOrder
Definition kutil.h:316
pFDegProc pOrigFDeg
Definition kutil.h:296
int blockredmax
Definition kutil.h:364
int tmax
Definition kutil.h:350
int(* posInLOld)(const LSet Ls, const int Ll, LObject *Lo, const kStrategy strat)
Definition kutil.h:288
polyset sig
Definition kutil.h:308
polyset syz
Definition kutil.h:307
char LDegLast
Definition kutil.h:383
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
Definition kutil.h:287
BOOLEAN(* syzCrit)(poly sig, unsigned long not_sevSig, kStrategy strat)
Definition kutil.h:292
wlen_set lenSw
Definition kutil.h:320
char kAllAxis
Definition kutil.h:374
int cv
Definition kutil.h:366
char noetherSet
Definition kutil.h:378
pShallowCopyDeleteProc p_shallow_copy_delete
Definition kutil.h:338
char Gebauer
Definition kutil.h:376
intset fromQ
Definition kutil.h:321
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
Definition kutil.h:286
char newt
Definition kutil.h:399
char use_buckets
Definition kutil.h:381
int mu
Definition kutil.h:348
char interpt
Definition kutil.h:369
char redTailChange
Definition kutil.h:397
int newIdeal
Definition kutil.h:356
char fromT
Definition kutil.h:377
char completeReduce_retry
Definition kutil.h:401
void(* initEcart)(TObject *L)
Definition kutil.h:280
omBin tailBin
Definition kutil.h:345
LObject P
Definition kutil.h:302
KINLINE TObject * S_2_T(int i)
Definition kInline.h:38
char noClearS
Definition kutil.h:400
int Lmax
Definition kutil.h:351
char z2homog
Definition kutil.h:372
int LazyPass
Definition kutil.h:353
char no_prod_crit
Definition kutil.h:392
char overflow
Definition kutil.h:402
void(* enterOnePair)(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
Definition kutil.h:290
LSet L
Definition kutil.h:327
char length_pLength
Definition kutil.h:385
int(* posInT)(const TSet T, const int tl, LObject &h)
Definition kutil.h:281
int(* red)(LObject *L, kStrategy strat)
Definition kutil.h:278
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.h:294
int sl
Definition kutil.h:348
int sbaEnterS
Definition kutil.h:361
int LazyDegree
Definition kutil.h:353
char posInLDependsOnLength
Definition kutil.h:387
unsigned long * sevS
Definition kutil.h:322
char homog
Definition kutil.h:370
pLDegProc pOrigLDeg
Definition kutil.h:297
intset fromS
Definition kutil.h:310
char update
Definition kutil.h:379
s_poly_proc_t s_poly
Definition kutil.h:300
int(* posInLSba)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.h:282
pLDegProc pOrigLDeg_TailRing
Definition kutil.h:299
int Bmax
Definition kutil.h:352
int c3
Definition kutil.h:347
const CanonicalForm & w
Definition facAbsFact.cc:51
CFArray copy(const CFList &list)
write elements of list into an array
int j
Definition facHensel.cc:110
#define EXTERN_VAR
Definition globaldefs.h:6
static BOOLEAN length(leftv result, leftv arg)
Definition interval.cc:257
STATIC_VAR jList * T
Definition janet.cc:30
STATIC_VAR Poly * h
Definition janet.cc:971
BOOLEAN(* s_poly_proc_t)(kStrategy strat)
Definition kstd1.h:14
int posInLF5C(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5792
KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r=currRing)
Definition kInline.h:1201
void initSbaPos(kStrategy strat)
Definition kutil.cc:9859
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
Definition kutil.cc:7465
BOOLEAN findMinLMPair(poly sig, unsigned long not_sevSig, kStrategy strat, int start)
int ksReducePolyGCD(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
int ksReducePolyLC(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
Definition kspoly.cc:477
void initenterpairs(poly h, int k, int ecart, int isFromQ, kStrategy strat, int atR=-1)
Definition kutil.cc:3814
int posInSyz(const kStrategy strat, const poly sig)
Definition kutil.cc:5763
int redLiftstd(LObject *h, kStrategy strat)
Definition kLiftstd.cc:167
int ksReducePolyBound(LObject *PR, TObject *PW, int bound, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
Definition kspoly.cc:591
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:321
int redRing_Z(LObject *h, kStrategy strat)
Definition kstd2.cc:677
int posInT17(const TSet set, const int length, LObject &p)
Definition kutil.cc:5283
int posInL13(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:6147
void initBuchMora(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:9748
void initEcartPairBba(LObject *Lp, poly f, poly g, int ecartF, int ecartG)
Definition kutil.cc:1313
denominator_list_s * denominator_list
Definition kutil.h:63
wlen_type * wlen_set
Definition kutil.h:55
poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing)
Definition kstd2.cc:566
int redFirstShift(LObject *h, kStrategy strat)
Definition kstd2.cc:4957
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.cc:6648
void enterSyz(LObject &p, kStrategy strat, int atT)
Definition kutil.cc:9340
int posInL15(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:6182
int redNF0(LObject *P, kStrategy strat)
int posInT11(const TSet set, const int length, LObject &p)
Definition kutil.cc:4958
int posInLSigRing(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5699
int ksReducePolySigRing(LObject *PR, TObject *PW, long idx, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
Definition kspoly.cc:944
int posInTSig(const TSet set, const int length, LObject &p)
int posInT1(const TSet set, const int length, LObject &p)
Definition kutil.cc:4901
EXTERN_VAR int(* test_PosInT)(const TSet T, const int tl, LObject &h)
Definition kutil.h:864
int ksReducePolySig(LObject *PR, TObject *PW, long idx, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
Definition kspoly.cc:738
void enterT_strong(LObject &p, kStrategy strat, int atT=-1)
Definition kutil.cc:9239
BOOLEAN kTest(kStrategy strat)
Definition kutil.cc:1010
void chainCritSig(poly p, int ecart, kStrategy strat)
Definition kutil.cc:3466
int posInT_EcartpLength(const TSet set, const int length, LObject &p)
Definition kutil.cc:5151
BOOLEAN kTest_TS(kStrategy strat)
Definition kutil.cc:1071
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:421
int kFindInT(poly p, TSet T, int tlength)
returns index of p in TSet, or -1 if not found
Definition kutil.cc:716
BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat)
Definition kutil.cc:10514
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, poly *mon=NULL, kStrategy strat=NULL, BOOLEAN redtail=FALSE)
Definition kspoly.cc:187
int kTestDivisibleByT0_Z(const kStrategy strat, const LObject *L)
tests if T[0] divides the leading monomial of L, returns -1 if not
Definition kstd2.cc:146
BOOLEAN kTest_L(LObject *L, kStrategy strat, BOOLEAN testp=FALSE, int lpos=-1, TSet T=NULL, int tlength=-1)
Definition kutil.cc:924
TObject * TSet
Definition kutil.h:59
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
Definition kutil.cc:1274
int posInL17(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:6257
#define setmaxL
Definition kutil.h:30
void enterT(LObject &p, kStrategy strat, int atT=-1)
Definition kutil.cc:9140
int kFindSameLMInT_Z(const kStrategy strat, const LObject *L, const int start=0)
void enterTShift(LObject p, kStrategy strat, int atT=-1)
Definition kutil.cc:12975
int posInT2(const TSet set, const int length, LObject &p)
Definition kutil.cc:4930
int posInL15Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:6217
void superenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR=-1)
Definition kutil.cc:4475
int posInT_pLength(const TSet set, const int length, LObject &p)
Definition kutil.cc:11463
void completeReduce(kStrategy strat, BOOLEAN withT=FALSE)
Definition kutil.cc:10282
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
Definition kutil.cc:1944
static int kFindInL1(const poly p, const kStrategy strat)
Definition kutil.h:839
int posInT13(const TSet set, const int length, LObject &p)
Definition kutil.cc:5122
void redtailBbaAlsoLC_Z(LObject *L, int end_pos, kStrategy strat)
Definition kutil.cc:7142
poly kNF2(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
Definition kstd2.cc:3929
BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat)
Definition kutil.cc:6515
void deleteHC(poly *p, int *e, int *l, kStrategy strat)
Definition kutil.cc:356
int posInSMonFirst(const kStrategy strat, const int length, const poly p)
Definition kutil.cc:4769
KINLINE BOOLEAN arriRewDummy(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kInline.h:1255
ideal sba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition kstd2.cc:2967
EXTERN_VAR denominator_list DENOMINATOR_LIST
Definition kutil.h:66
void initBuchMoraPos(kStrategy strat)
Definition kutil.cc:9577
void initS(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:7588
int posInIdealMonFirst(const ideal F, const poly p, int start=0, int end=-1)
Definition kutil.cc:4846
KINLINE poly redtailBbaBound(poly p, int end_pos, kStrategy strat, int bound, BOOLEAN normalize=FALSE)
Definition kInline.h:1215
int redHoney(LObject *h, kStrategy strat)
Definition kstd2.cc:2067
EXTERN_VAR int strat_nr
Definition kutil.h:181
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:10535
KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin bin)
Definition kInline.h:974
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L=NULL, TObject *T=NULL, unsigned long new_expbound=0)
Definition kutil.cc:10957
int64 wlen_type
Definition kutil.h:54
int posInLSig(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5674
KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
Definition kInline.h:965
int posInL11(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5804
void chainCritOpt_1(poly, int, kStrategy strat)
Definition kutil.cc:3450
int kFindNextDivisibleByInS(const kStrategy strat, int start, int max_ind, LObject *L)
Definition kstd2.cc:524
static LSet initL(int nr=setmaxL)
Definition kutil.h:418
KINLINE TSet initT()
Definition kInline.h:84
void cancelunit(LObject *p, BOOLEAN inNF=FALSE)
Definition kutil.cc:370
EXTERN_VAR int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.h:865
int posInL11Ringls(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5914
KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
Definition kInline.h:981
KINLINE poly redtailBba_Ring(poly p, int end_pos, kStrategy strat)
Definition kInline.h:1221
int kFindDivisibleByInT_Z(const kStrategy strat, const LObject *L, const int start=0)
Definition kstd2.cc:213
LObject * LSet
Definition kutil.h:60
int redHomog(LObject *h, kStrategy strat)
Definition kstd2.cc:1107
int posInT17_c(const TSet set, const int length, LObject &p)
Definition kutil.cc:5389
poly redtailBbaShift(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
Definition kutil.cc:12998
denominator_list next
Definition kutil.h:65
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
Definition kutil.cc:11372
int posInT15(const TSet set, const int length, LObject &p)
Definition kutil.cc:5189
void kFreeStrat(kStrategy strat)
void pairs()
void postReduceByMon(LObject *h, kStrategy strat)
used for GB over ZZ: intermediate reduction by monomial elements background: any known constant eleme...
Definition kutil.cc:10700
BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat)
Definition kutil.cc:6480
EXTERN_VAR int HCord
Definition kutil.h:269
void HEckeTest(poly pp, kStrategy strat)
Definition kutil.cc:498
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition kstd2.cc:2609
int redLazy(LObject *h, kStrategy strat)
Definition kstd2.cc:1862
void enterExtendedSpolySig(poly h, poly hSig, kStrategy strat)
Definition kutil.cc:4321
void enterpairsSig(poly h, poly hSig, int from, int k, int ec, int pos, kStrategy strat, int atR=-1)
Definition kutil.cc:4518
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
Definition kutil.cc:12945
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin bin)
Definition kInline.h:956
void initBba(kStrategy strat)
Definition kstd1.cc:1685
void exitBuchMora(kStrategy strat)
Definition kutil.cc:9833
void messageStatSBA(int hilbcount, kStrategy strat)
Definition kutil.cc:7519
int redRiloc(LObject *h, kStrategy strat)
Definition kstd1.cc:386
void initEcartNormal(TObject *h)
Definition kutil.cc:1298
static void kDeleteLcm(LObject *P)
Definition kutil.h:868
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
Definition kutil.cc:4668
void updateS(BOOLEAN toT, kStrategy strat)
Definition kutil.cc:8556
int posInL0(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5616
int redSigRing(LObject *h, kStrategy strat)
Definition kstd2.cc:1493
int * intset
Definition kutil.h:53
void initSLSba(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:7780
TObject * kFindDivisibleByInS_T(kStrategy strat, int end_pos, LObject *L, TObject *T, long ecart=LONG_MAX)
Definition kutil.cc:6699
void enterSBbaShift(LObject &p, int atS, kStrategy strat, int atR=-1)
Definition kutil.cc:8891
void initSba(ideal F, kStrategy strat)
Definition kstd1.cc:1745
int ksReducePolyTail(LObject *PR, TObject *PW, poly Current, poly spNoether=NULL)
Definition kspoly.cc:1351
void initSyzRules(kStrategy strat)
Definition kutil.cc:7932
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:9961
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
Definition kutil.cc:10476
void cleanT(kStrategy strat)
Definition kutil.cc:563
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:1057
int posInT110(const TSet set, const int length, LObject &p)
Definition kutil.cc:5034
BOOLEAN kTest_S(kStrategy strat)
Definition kutil.cc:1053
KINLINE TObject ** initR()
Definition kInline.h:95
void replaceInLAndSAndT(LObject &p, int tj, kStrategy strat)
Definition kutil.cc:9049
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition kstd2.cc:2302
void reorderS(int *suc, kStrategy strat)
Definition kutil.cc:4615
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether=NULL)
Definition kInline.h:1171
void enterExtendedSpoly(poly h, kStrategy strat)
Definition kutil.cc:4237
void enterpairs(poly h, int k, int ec, int pos, kStrategy strat, int atR=-1)
Definition kutil.cc:4492
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR=-1)
Definition kutil.cc:4462
int redSig(LObject *h, kStrategy strat)
Definition kstd2.cc:1326
KINLINE poly redtailBba_Z(poly p, int end_pos, kStrategy strat)
Definition kInline.h:1226
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether=NULL)
Definition kInline.h:1181
int posInL10(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kstd1.cc:1361
KINLINE poly redtailBba(poly p, int end_pos, kStrategy strat, BOOLEAN normalize=FALSE)
Definition kInline.h:1209
void updateResult(ideal r, ideal Q, kStrategy strat)
Definition kutil.cc:10076
int posInT0(const TSet set, const int length, LObject &p)
Definition kutil.cc:4890
#define KINLINE
Definition kutil.h:49
int posInT19(const TSet set, const int length, LObject &p)
Definition kutil.cc:5515
poly redtailBba_NF(poly p, kStrategy strat)
Definition kutil.cc:7352
void exitSba(kStrategy strat)
Definition kutil.cc:10036
ring sbaRing(kStrategy strat, const ring r=currRing, BOOLEAN complete=TRUE, int sgn=1)
Definition kutil.cc:11078
BOOLEAN enterOnePairShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS)
Definition kutil.cc:12161
void enterSSba(LObject &p, int atS, kStrategy strat, int atR=-1)
Definition kutil.cc:8914
void kDebugPrint(kStrategy strat)
Output some debug info about a given strategy.
Definition kutil.cc:11497
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:4265
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition kutil.cc:1213
void initHilbCrit(ideal F, ideal Q, intvec **hilb, kStrategy strat)
Definition kutil.cc:9414
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether=NULL, ring r=currRing)
Definition kInline.h:1191
void kStratInitChangeTailRing(kStrategy strat)
Definition kutil.cc:11050
BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.cc:6623
void initBuchMoraCrit(kStrategy strat)
Definition kutil.cc:9432
void initBuchMoraPosRing(kStrategy strat)
Definition kutil.cc:9662
poly kNF2Bound(ideal F, ideal Q, poly q, int bound, kStrategy strat, int lazyReduce)
Definition kstd2.cc:4015
int kFindInTShift(poly p, TSet T, int tlength)
Definition kutil.cc:741
void postReduceByMonSig(LObject *h, kStrategy strat)
Definition kutil.cc:10776
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:1204
int posInL11Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5846
void enterSBba(LObject &p, int atS, kStrategy strat, int atR=-1)
Definition kutil.cc:8791
void messageSets(kStrategy strat)
Definition kutil.cc:7538
int redRing(LObject *h, kStrategy strat)
Definition kstd2.cc:945
void deleteInS(int i, kStrategy strat)
Definition kutil.cc:1137
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
Definition kutil.cc:11426
BOOLEAN sbaCheckGcdPair(LObject *h, kStrategy strat)
Definition kutil.cc:1693
int posInL110(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:6060
poly redtail(poly p, int end_pos, kStrategy strat)
Definition kutil.cc:6908
int posInL10Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
void initEcartPairMora(LObject *Lp, poly f, poly g, int ecartF, int ecartG)
Definition kutil.cc:1320
void superenterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
void entersets(LObject h)
void chainCritNormal(poly p, int ecart, kStrategy strat)
Definition kutil.cc:3209
void initEcartBBA(TObject *h)
Definition kutil.cc:1306
class sTObject TObject
Definition kutil.h:57
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
Definition kInline.h:1232
ideal bbaShift(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
Definition kstd2.cc:4577
int posInLF5CRing(const LSet set, int start, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5880
int ksReducePolyZ(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
poly redNFTail(poly h, const int sl, kStrategy strat)
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
Definition kspoly.cc:1447
void messageStat(int hilbcount, kStrategy strat)
Definition kutil.cc:7506
int redHoneyM(LObject *h, kStrategy strat)
void initSL(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:7681
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:1015
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
Definition kutil.cc:10865
BOOLEAN kTest_T(TObject *T, kStrategy strat, int tpos=-1, char TN='?')
Definition kutil.cc:799
void initSbaCrit(kStrategy strat)
Definition kutil.cc:9495
BOOLEAN newHEdge(kStrategy strat)
Definition kutil.cc:10404
BOOLEAN homogTest(polyset F, int Fmax)
class sLObject LObject
Definition kutil.h:58
poly redtailSba(LObject *L, int end_pos, kStrategy strat, BOOLEAN withT=FALSE, BOOLEAN normalize=FALSE)
Definition kstd2.cc:1742
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.cc:6564
KINLINE unsigned long * initsevT()
Definition kInline.h:100
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition minpoly.cc:709
Definition lq.h:40
#define omAlloc(size)
#define NULL
Definition omList.c:12
omBin_t * omBin
Definition omStructs.h:12
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
Compatibility layer for legacy polynomial operations (over currRing)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition polys.h:76
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
Definition polys.h:70
poly * polyset
Definition polys.h:259
long(* pFDegProc)(poly p, ring r)
Definition ring.h:38
long(* pLDegProc)(poly p, int *length, ring r)
Definition ring.h:37
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:44
#define rField_is_Ring(R)
Definition ring.h:490
#define R
Definition sirandom.c:27
#define Q
Definition sirandom.c:26
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
Definition syz3.cc:1027