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#include "coeffs/bigintmat.h" /* for s_poly_proc_t */
26
27// define if tailrings should be used
28#define HAVE_TAIL_RING
29
30#define setmax 128
31#define setmaxL ((int)((4096-12)/sizeof(LObject)))
32#define setmaxLinc ((int)((4096)/sizeof(LObject)))
33
34#define setmaxT ((int)((4096-12)/sizeof(TObject)))
35#define setmaxTinc ((int)((4096)/sizeof(TObject)))
36
37#define RED_CANONICALIZE 200
38#define REDNF_CANONICALIZE 60
39#define REDTAIL_CANONICALIZE 100
40
41// if you want std computations as in Singular version < 2:
42// This disables RedThrough, tailReductions against T (bba),
43// sets posInT = posInT15 (bba, strat->honey), and enables redFirst with LDeg
44// NOTE: can be achieved with option(oldStd)
45
46#undef NO_KINLINE
47#if !defined(KDEBUG) && !defined(NO_INLINE)
48#define KINLINE inline
49#else
50#define KINLINE
51#define NO_KINLINE 1
52#endif
53
54typedef int* intset;
57
58typedef class sTObject TObject;
59typedef class sLObject LObject;
60typedef TObject * TSet;
61typedef LObject * LSet;
62
65
68
70{
71public:
72 unsigned long sevSig;
73 poly sig; // the signature of the element
74 poly p; // Lm(p) \in currRing Tail(p) \in tailRing
75 poly t_p; // t_p \in tailRing: as monomials Lm(t_p) == Lm(p)
76 poly max_exp; // p_GetMaxExpP(pNext(p))
78 long FDeg; // pFDeg(p)
79 int ecart,
80 length, // as of pLDeg
81 pLength, // either == 0, or == pLength(p)
82 i_r; // index of TObject in R set, or -1 if not in T
83
84#ifdef HAVE_SHIFTBBA
85 int shift;
86#endif
87
88 /*BOOLEAN*/ char is_normalized; // true, if pNorm was called on p, false otherwise
89 // used in incremental sba() with F5C:
90 // we know some of the redundant elements in
91 // strat->T beforehand, so we can just discard
92 // them and do not need to consider them in the
93 // interreduction process
94 /*BOOLEAN*/ char is_redundant;
95 // used in sba's sig-safe reduction:
96 // sometimes we already know that a reducer
97 // is sig-safe, so no need for a real
98 // sig-safeness check
99 /*BOOLEAN*/ char is_sigsafe;
100
101
102#ifdef HAVE_PLURAL
103 /*BOOLEAN*/ char is_special; // true, it is a new special S-poly (e.g. for SCA)
104#endif
105
106 // initialization
107 KINLINE void Init(ring r = currRing);
109 KINLINE sTObject(poly p, ring tailRing = currRing);
110 KINLINE sTObject(poly p, ring c_r, ring tailRing);
112
113 KINLINE void Set(ring r=currRing);
114 KINLINE void Set(poly p_in, ring r=currRing);
115 KINLINE void Set(poly p_in, ring c_r, ring t_r);
116
117 // Frees the polys of T
118 KINLINE void Delete();
119 // Sets polys to NULL
120 KINLINE void Clear();
121 // makes a copy of the poly of T
122 KINLINE void Copy();
123
124 // ring-dependent Lm access: these might result in allocation of monomials
125 KINLINE poly GetLmCurrRing();
126 KINLINE poly GetLmTailRing();
127 KINLINE poly GetLm(ring r);
128 // this returns Lm and ring r (preferably from tailRing), but does not
129 // allocate a new poly
130 KINLINE void GetLm(poly &p, ring &r) const;
131
132#ifdef OLIVER_PRIVAT_LT
133 // routines for calc. with rings
134 KINLINE poly GetLtCurrRing();
135 KINLINE poly GetLtTailRing();
136 KINLINE poly GetLt(ring r);
137 KINLINE void GetLt(poly &p, ring &r) const;
138#endif
139
140 KINLINE BOOLEAN IsNull() const;
141
142 KINLINE int GetpLength();
143
144 // makes sure that T.p exists
145 KINLINE void SetLmCurrRing();
146
147 // Iterations
148 // simply get the next monomial
149 KINLINE poly Next();
151
152 // deg stuff
153 // compute pTotalDegree
154 KINLINE long pTotalDeg() const;
155 // computes pFDeg
156 KINLINE long pFDeg() const;
157 // computes and sets FDeg
158 KINLINE long SetpFDeg();
159 // gets stored FDeg
160 KINLINE long GetpFDeg() const;
161
162 // computes pLDeg
163 KINLINE long pLDeg();
164 // sets length, FDeg, returns LDeg
166
167 // arithmetic
168 KINLINE void Mult_nn(number n);
169 KINLINE void ShallowCopyDelete(ring new_tailRing, omBin new_tailBin,
170 pShallowCopyDeleteProc p_shallow_copy_delete,
171 BOOLEAN set_max = TRUE);
172 // manipulations
173 KINLINE void pNorm();
174 KINLINE void pCleardenom();
175 KINLINE void pContent();
176
177#ifdef KDEBUG
178 void wrp();
179#endif
180};
181
183
184class sLObject : public sTObject
185{
186
187public:
188 unsigned long sev;
189 poly p1,p2; /*- the pair p comes from,
190 lm(pi) in currRing, tail(pi) in tailring -*/
191
192 poly lcm; /*- the lcm of p1,p2 -*/
194 int i_r1, i_r2;
195 unsigned checked; // this is the index of S up to which
196 // the corresponding LObject was already checked in
197 // critical pair creation => when entering the
198 // reduction process it is enough to start a second
199 // rewritten criterion check from checked+1 onwards
201 // NOTE: If prod_crit = TRUE then the corresponding pair is
202 // detected by Buchberger's Product Criterion and can be
203 // deleted
204
205 // initialization
206 KINLINE void Init(ring tailRing = currRing);
208 KINLINE sLObject(poly p, ring tailRing = currRing);
209 KINLINE sLObject(poly p, ring c_r, ring tailRing);
210
211 // Frees the polys of L
212 KINLINE void Delete();
213 KINLINE void Clear();
214
215 // Iterations
218
219 // spoly related things
220 // preparation for reduction if not spoly
221 KINLINE void PrepareRed(BOOLEAN use_bucket);
222 KINLINE void SetLmTail(poly lm, poly new_p, int length,
223 int use_bucket, ring r);
224 KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether);
225 KINLINE void Tail_Mult_nn(number n);
226 // deletes bucket, makes sure that p and t_p exists
227 KINLINE poly GetP(omBin lmBin = (omBin)NULL);
228 // similar, except that only t_p exists
229 KINLINE poly GetTP();
230
231 // does not delete bucket, just canonicalizes it
232 // returned poly is such that Lm(p) \in currRing, Tail(p) \in tailRing
233 KINLINE void CanonicalizeP();
234
235 // makes a copy of the poly of L
236 KINLINE void Copy();
237
238 KINLINE int GetpLength();
239 KINLINE long pLDeg(BOOLEAN use_last);
240 KINLINE long pLDeg();
241 KINLINE int SetLength(BOOLEAN lengt_pLength = FALSE);
244
245 // returns minimal component of p
246 KINLINE long MinComp();
247 // returns component of p
248 KINLINE long Comp();
249
250 KINLINE void ShallowCopyDelete(ring new_tailRing,
251 pShallowCopyDeleteProc p_shallow_copy_delete);
252
253 // sets sev
255
256 // enable assignment from TObject
258
259 // get T's corresponding to p1, p2: they might return NULL
260 KINLINE TObject* T_1(const skStrategy* strat);
261 KINLINE TObject* T_2(const skStrategy* strat);
262 KINLINE void T_1_2(const skStrategy* strat,
263 TObject* &T_1, TObject* &T_2);
264
265 // simplify coefficients
266 KINLINE void Normalize();
267 KINLINE void HeadNormalize();
268};
269
271
273#ifdef HAVE_OMALLOC
274 : public omallocClass
275#endif
276{
277public:
279 int (*red)(LObject * L,kStrategy strat);
280 int (*red2)(LObject * L,kStrategy strat);
281 void (*initEcart)(TObject * L);
282 int (*posInT)(const TSet T,const int tl,LObject &h);
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*/);
300
302 ideal Shdl;
303 ideal D; /*V(S) is in D(D)*/
304 ideal M; /*set of minimal generators*/
309 intset fromS; // from which S[i] S[j] comes from
310 // this is important for signature-based
311 // algorithms
312 intset syzIdx;// index in the syz array at which the first
313 // syzygy of component i comes up
314 // important for signature-based algorithms
315 unsigned sbaOrder;
319 wlen_set lenSw; /* for tgb.ccc */
321 unsigned long* sevS;
322 unsigned long* sevSyz;
323 unsigned long* sevSig;
324 unsigned long* sevT;
329 poly t_kNoether; // same polys in tailring
330 KINLINE poly kNoetherTail();
332 BOOLEAN * pairtest;/*used for enterOnePair*/
333 poly tail;
336 // procedure for ShalloCopy from tailRing to currRing
338 // pointers to Tobjects R[i] is ith Tobject which is generated
340 // S_2_R[i] yields Tobject which corresponds to S[i]
341 int* S_2_R;
345 int nr;
346 int cp,c3;
347 int sl,mu;
349 int tl,tmax;
350 int Ll,Lmax;
351 int Bl,Bmax;
356 int minim;
357 bool sigdrop; //This is used to check sigdrop in sba over Z
358 int nrsyzcrit; // counts how many pairs are deleted by SyzCrit
359 int nrrewcrit; // counts how many pairs are deleted by FaugereRewCrit
360 int sbaEnterS; // sba over Z strategy: if sigdrop element has _*gen(sbaEnterS+1), then
361 // add directly sbaEnterS elements into S
362 int blockred; // counter for blocked reductions in redSig
364 #ifdef HAVE_SHIFTBBA
365 int cv; // in shift bases: counting V criterion
366 /*BOOLEAN*/ char rightGB;
367 #endif
368 /*BOOLEAN*/ char interpt;
369 /*BOOLEAN*/ char homog;
370#ifdef HAVE_PLURAL
371 /*BOOLEAN*/ char z2homog; // Z_2 - homogeneous input allows product criterion in commutative and SCA cases!
372#endif
373 /*BOOLEAN*/ char kAllAxis; // all axis are used -> (re)compute noether
374 /*BOOLEAN*/ char honey,sugarCrit;
375 /*BOOLEAN*/ char Gebauer,noTailReduction;
376 /*BOOLEAN*/ char fromT;
377 /*BOOLEAN*/ char noetherSet;
378 /*BOOLEAN*/ char update;
379 /*BOOLEAN*/ char posInLOldFlag;
380 /*BOOLEAN*/ char use_buckets;
381 // if set, pLDeg(p, l) == (pFDeg(pLast(p), pLength)
382 /*BOOLEAN*/ char LDegLast;
383 // if set, then L.length == L.pLength
384 /*BOOLEAN*/ char length_pLength;
385 // if set, then posInL does not depend on L.length
386 /*BOOLEAN*/ char posInLDependsOnLength;
387 /*FALSE, if posInL == posInL10*/
388#ifdef HAVE_PLURAL
389 // set this flag to 1 to stop the product criteria
390 // use ALLOW_PROD_CRIT(strat) to test
391 /*BOOLEAN*/ char no_prod_crit;
392#define ALLOW_PROD_CRIT(A) (!(A)->no_prod_crit)
393#else
394#define ALLOW_PROD_CRIT(A) (1)
395#endif
397 char news;
398 char newt;/*used for messageSets*/
402
403 skStrategy();
404 ~skStrategy();
405
406 // return TObject corresponding to S[i]: assume that it exists
407 // i.e. no error checking is done
408 KINLINE TObject* S_2_T(int i);
409 // like S_2_T, except that NULL is returned if it can not be found
410 KINLINE TObject* s_2_t(int i);
411};
412
413void deleteHC(poly *p, int *e, int *l, kStrategy strat);
414void deleteHC(LObject* L, kStrategy strat, BOOLEAN fromNext = FALSE);
415void deleteInS (int i,kStrategy strat);
416void cleanT (kStrategy strat);
417static inline LSet initL (int nr=setmaxL)
418{ return (LSet)omAlloc(nr*sizeof(LObject)); }
419void deleteInL(LSet set, int *length, int j,kStrategy strat);
420void enterL (LSet *set,int *length, int *LSetmax, LObject p,int at);
421void enterSBba (LObject* p,int atS,kStrategy strat, int atR = -1);
422void enterSBbaShift (LObject* p,int atS,kStrategy strat, int atR = -1);
423void enterSSba (LObject* p,int atS,kStrategy strat, int atR = -1);
424void initEcartPairBba (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
425void initEcartPairMora (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
426int posInS (const kStrategy strat, const int length, const poly p,
427 const int ecart_p);
428int posInSMonFirst (const kStrategy strat, const int length, const poly p);
429int posInIdealMonFirst (const ideal F, const poly p,int start = 0,int end = -1);
430int posInT0 (const TSet set,const int length,LObject &p);
431int posInT1 (const TSet set,const int length,LObject &p);
432int posInT2 (const TSet set,const int length,LObject &p);
433int posInT11 (const TSet set,const int length,LObject &p);
434int posInTSig (const TSet set,const int length,LObject &p);
435int posInT110 (const TSet set,const int length,LObject &p);
436int posInT13 (const TSet set,const int length,LObject &p);
437int posInT15 (const TSet set,const int length,LObject &p);
438int posInT17 (const TSet set,const int length,LObject &p);
439int posInT17_c (const TSet set,const int length,LObject &p);
440int posInT19 (const TSet set,const int length,LObject &p);
441int posInT_EcartpLength(const TSet set,const int length,LObject &p);
442int posInT_EcartFDegpLength(const TSet set,const int length,LObject &p);
443int posInT_FDegpLength(const TSet set,const int length,LObject &p);
444int posInT_pLength(const TSet set,const int length,LObject &p);
445
446#ifdef HAVE_MORE_POS_IN_T
447int posInT_EcartFDegpLength(const TSet set,const int length,LObject &p);
448int posInT_FDegpLength(const TSet set,const int length,LObject &p);
449int posInT_pLength(const TSet set,const int length,LObject &p);
450#endif
451
452
453void reorderS (int* suc,kStrategy strat);
454//int posInLF5C (const LSet set, const int length,
455// LObject* L,const kStrategy strat);
456int posInLSig (const LSet set, const int length,
457 LObject* L,const kStrategy strat);
458int posInLSigRing (const LSet set, const int length,
459 LObject* L,const kStrategy strat);
460int posInSyz (const kStrategy strat, const poly sig);
461int posInL0 (const LSet set, const int length,
462 LObject* L,const kStrategy strat);
463int posInL11 (const LSet set, const int length,
464 LObject* L,const kStrategy strat);
465int posInL11Ring (const LSet set, const int length,
466 LObject* L,const kStrategy strat);
467int posInLF5CRing (const LSet set, int start , const int length,
468 LObject* L,const kStrategy strat);
469int posInL11Ringls (const LSet set, const int length,
470 LObject* L,const kStrategy strat);
471int posInL13 (const LSet set, const int length,
472 LObject* L,const kStrategy strat);
473int posInL15 (const LSet set, const int length,
474 LObject* L,const kStrategy strat);
475int posInL15Ring (const LSet set, const int length,
476 LObject* L,const kStrategy strat);
477int posInL17 (const LSet set, const int length,
478 LObject* L,const kStrategy strat);
479int posInL10 (const LSet set, const int length,
480 LObject* L,const kStrategy strat);
481int posInL10Ring (const LSet set, const int length,
482 LObject* L,const kStrategy strat);
483int posInL110 (const LSet set, const int length,
484 LObject* L,const kStrategy strat);
485KINLINE poly redtailBba (poly p,int end_pos,kStrategy strat,BOOLEAN normalize=FALSE);
486KINLINE poly redtailBbaBound (poly p,int end_pos,kStrategy strat,int bound,BOOLEAN normalize=FALSE);
487KINLINE poly redtailBba_Ring (poly p,int end_pos,kStrategy strat);
488KINLINE poly redtailBba_Z (poly p,int end_pos,kStrategy strat);
489poly redtailBba_NF (poly p, kStrategy strat );
490poly redtailBba_Ring (LObject* L, int end_pos, kStrategy strat );
491poly redtailBba_Z (LObject* L, int end_pos, kStrategy strat );
492void redtailBbaAlsoLC_Z (LObject* L, int end_pos, kStrategy strat );
493poly redtailBba (LObject *L, int end_pos,kStrategy strat,
495poly redtailBbaBound (LObject *L, int end_pos,kStrategy strat,int bound,
497poly redtailSba (LObject *L, int end_pos,kStrategy strat,
499poly redtailBba (TObject *T, int end_pos,kStrategy strat);
500poly redtail (poly p,int end_pos,kStrategy strat);
501poly redtail (LObject *L,int end_pos,kStrategy strat);
502poly redNF (poly h,int & max_ind,int nonorm,kStrategy strat);
503int redNF0 (LObject *P,kStrategy strat);
504poly redNFTail (poly h,const int sl,kStrategy strat);
505int redHoney (LObject* h, kStrategy strat);
507int redLiftstd (LObject* h, kStrategy strat);
508int redRing (LObject* h,kStrategy strat);
509int redRing_Z (LObject* h,kStrategy strat);
510int redRiloc (LObject* h,kStrategy strat);
511void enterExtendedSpoly(poly h,kStrategy strat);
512void enterExtendedSpolySig(poly h,poly hSig,kStrategy strat);
513void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR = -1);
514void superenterpairsSig (poly h,poly hSig,int hFrom,int k,int ecart,int pos,kStrategy strat, int atR = -1);
515int redLazy (LObject* h,kStrategy strat);
516int redHomog (LObject* h,kStrategy strat);
517int redSig (LObject* h,kStrategy strat);
518int redSigRing (LObject* h,kStrategy strat);
519//adds hSig to be able to check with F5's criteria when entering pairs!
520void enterpairsSig (poly h, poly hSig, int from, int k, int ec, int pos,kStrategy strat, int atR = -1);
521void enterpairs (poly h, int k, int ec, int pos,kStrategy strat, int atR = -1);
523void pairs ();
525void message (int i,int* olddeg,int* reduc,kStrategy strat,int red_result);
526void messageStat (int hilbcount,kStrategy strat);
527void messageStatSBA (int hilbcount,kStrategy strat);
528#ifdef KDEBUG
529void messageSets (kStrategy strat);
530#else
531#define messageSets(s) do {} while (0)
532#endif
533
535void initEcartBBA (TObject* h);
536void initS (ideal F, ideal Q,kStrategy strat);
537void initSL (ideal F, ideal Q,kStrategy strat);
538void initSLSba (ideal F, ideal Q,kStrategy strat);
539/*************************************************
540 * when initializing a new bunch of principal
541 * syzygies at the beginning of a new iteration
542 * step in a signature-based algorithm we
543 * compute ONLY the leading elements of those
544 * syzygies, NOT the whole syzygy
545 * NOTE: this needs to be adjusted for a more
546 * general approach on signature-based algorithms
547 ***********************************************/
548void initSyzRules (kStrategy strat);
549void updateS(BOOLEAN toT,kStrategy strat);
550void enterSyz (LObject &p,kStrategy strat, int atT);
551void enterT (LObject* p,kStrategy strat, int atT = -1);
552#if STDZ_EXCHANGE_DURING_REDUCTIO
553void replaceInLAndSAndT(LObject* p, int tj, kStrategy strat);
554#endif
555void enterT_strong (LObject* p,kStrategy strat, int atT = -1);
556void cancelunit (LObject* p,BOOLEAN inNF=FALSE);
557void HEckeTest (poly pp,kStrategy strat);
558void initBuchMoraCrit(kStrategy strat);
559void initSbaCrit(kStrategy strat);
560void initHilbCrit(ideal F, ideal Q, bigintmat **hilb,kStrategy strat);
561void initBuchMoraPos(kStrategy strat);
563void initSbaPos(kStrategy strat);
564void initBuchMora (ideal F, ideal Q,kStrategy strat);
565void initSbaBuchMora (ideal F, ideal Q,kStrategy strat);
566void exitBuchMora (kStrategy strat);
567void exitSba (kStrategy strat);
568void updateResult(ideal r,ideal Q,kStrategy strat);
569void completeReduce (kStrategy strat, BOOLEAN withT=FALSE);
571void enterOnePairNormal (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR);
572void chainCritNormal (poly p,int ecart,kStrategy strat);
573void chainCritOpt_1 (poly,int,kStrategy strat);
574void chainCritSig (poly p,int ecart,kStrategy strat);
577BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat);
578BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat);
579KINLINE BOOLEAN arriRewDummy(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
580BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
581BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
582BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
583BOOLEAN findMinLMPair(poly sig, unsigned long not_sevSig, kStrategy strat, int start);
584
585/// returns index of p in TSet, or -1 if not found
586int kFindInT(poly p, TSet T, int tlength);
587#ifdef HAVE_SHIFTBBA
588int kFindInTShift(poly p, TSet T, int tlength);
589#endif
590
591/// return -1 if no divisor is found
592/// number of first divisor in T, otherwise
593int kFindDivisibleByInT(const kStrategy strat, const LObject* L, const int start=0);
594int kFindDivisibleByInT_ecart(const kStrategy strat, const LObject* L, const int ecart);
595int kFindDivisibleByInT_Z(const kStrategy strat, const LObject* L, const int start=0);
596int kFindSameLMInT_Z(const kStrategy strat, const LObject* L, const int start=0);
597
598/// tests if T[0] divides the leading monomial of L, returns -1 if not
599int kTestDivisibleByT0_Z(const kStrategy strat, const LObject* L);
600/// return -1 if no divisor is found
601/// number of first divisor in S, otherwise
602int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject* L);
603
604int kFindNextDivisibleByInS(const kStrategy strat, int start,int max_ind, LObject* L);
605TObject* kFindDivisibleByInS_T(kStrategy strat, int end_pos, LObject* L, TObject *T, long ecart = LONG_MAX);
606
607/***************************************************************
608 *
609 * stuff to be inlined
610 *
611 ***************************************************************/
612
615KINLINE unsigned long* initsevT();
616KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin bin);
617KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing, omBin bin);
618KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin bin);
619KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin bin);
620
621KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing);
622KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing);
623KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing);
624KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing);
625
626// if exp bound is not violated, return TRUE and
627// get m1 = LCM(LM(p1), LM(p2))/LM(p1)
628// m2 = LCM(LM(p1), LM(p2))/LM(p2)
629// return FALSE and m1 == NULL, m2 == NULL , otherwise
630KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r,
631 poly &m1, poly &m2, const ring m_r);
632KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing,
633 poly &m1, poly &m2, poly &lcm, const ring taiRing);
634#ifdef KDEBUG
635// test strat
636BOOLEAN kTest(kStrategy strat);
637// test strat, and test that S is contained in T
639// test LObject
641 BOOLEAN testp = FALSE, int lpos = -1,
642 TSet T = NULL, int tlength = -1);
643// test TObject
644BOOLEAN kTest_T(TObject* T, kStrategy strat, int tpos = -1, char TN = '?');
645// test set strat->SevS
647#else
648#define kTest(A) (TRUE)
649#define kTest_TS(A) (TRUE)
650#define kTest_T(T,S) (TRUE)
651#define kTest_S(T) (TRUE)
652#define kTest_L(T,R) (TRUE)
653#endif
654
655
656/***************************************************************
657 *
658 * From kstd1.cc
659 *
660 ***************************************************************/
661int redFirst (LObject* h,kStrategy strat);
662int redEcart (LObject* h,kStrategy strat);
663void enterSMora (LObject* p,int atS,kStrategy strat, int atR=-1);
664void enterSMoraNF (LObject* p,int atS,kStrategy strat, int atR=-1);
665
666
667/***************************************************************
668 *
669 * From kstd2.cc
670 *
671 ***************************************************************/
672poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing);
673ideal bba (ideal F, ideal Q,intvec *w,bigintmat *hilb,kStrategy strat);
674ideal sba (ideal F, ideal Q,intvec *w,bigintmat *hilb,kStrategy strat);
675poly kNF2 (ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce);
676ideal kNF2 (ideal F,ideal Q,ideal q, kStrategy strat, int lazyReduce);
677poly kNF2Bound (ideal F, ideal Q, poly q,int bound, kStrategy strat, int lazyReduce);
678ideal kNF2Bound (ideal F,ideal Q,ideal q,int bound, kStrategy strat, int lazyReduce);
679void initBba(kStrategy strat);
680void initSba(ideal F,kStrategy strat);
681void f5c (kStrategy strat, int& olddeg, int& minimcnt, int& hilbeledeg,
682 int& hilbcount, int& srmax, int& lrmax, int& reduc, ideal Q,
683 intvec *w,bigintmat *hilb );
684
685/***************************************************************
686 *
687 * From kspoly.cc
688 *
689 ***************************************************************/
690// Reduces PR with PW
691// Assumes PR != NULL, PW != NULL, Lm(PW) divides Lm(PR)
692// Changes: PR
693// Const: PW
694// If coef != NULL, then *coef is a/gcd(a,b), where a = LC(PR), b = LC(PW)
695// If strat != NULL, tailRing is changed if reduction would violate exp bound
696// of tailRing
697// Returns: 0 everything ok, no tailRing change
698// 1 tailRing has successfully changed (strat != NULL)
699// 2 no reduction performed, tailRing needs to be changed first
700// (strat == NULL)
701// -1 tailRing change could not be performed due to exceeding exp
702// bound of currRing
703// reduce should be set inside "kNF" (only relevant for rings)
704int ksReducePoly(LObject* PR,
705 TObject* PW,
706 poly spNoether = NULL,
707 number *coef = NULL,
708 poly *mon =NULL,
709 kStrategy strat = NULL,
711
712/* like ksReducePoly, but if the reducer has only 1 term we still
713 * compute a possible coefficient multiplier for PR. this comes from
714 * a special situation in redRing_Z and it is used only there. */
716 TObject* PW,
717 poly spNoether = NULL,
718 number *coef = NULL,
719 kStrategy strat = NULL);
720
721int ksReducePolyLC(LObject* PR,
722 TObject* PW,
723 poly spNoether = NULL,
724 number *coef = NULL,
725 kStrategy strat = NULL);
726
727
729 TObject* PW,
730 poly spNoether = NULL,
731 number *coef = NULL,
732 kStrategy strat = NULL);
733
735 TObject* PW,
736 int bound,
737 poly spNoether = NULL,
738 number *coef = NULL,
739 kStrategy strat = NULL);
740
741// Reduces PR with PW
742// Assumes PR != NULL, PW != NULL, Lm(PW) divides Lm(PR)
743// Changes: PR
744// Const: PW
745// If coef != NULL, then *coef is a/gcd(a,b), where a = LC(PR), b = LC(PW)
746// If strat != NULL, tailRing is changed if reduction would violate exp bound
747// of tailRing
748// Returns: 0 everything ok, no tailRing change
749// 1 tailRing has successfully changed (strat != NULL)
750// 2 no reduction performed, tailRing needs to be changed first
751// (strat == NULL)
752// 3 no reduction performed, not sig-safe!!!
753// -1 tailRing change could not be performed due to exceeding exp
754// bound of currRing
756 TObject* PW,
757 long idx,
758 poly spNoether = NULL,
759 number *coef = NULL,
760 kStrategy strat = NULL);
761
763 TObject* PW,
764 long idx,
765 poly spNoether = NULL,
766 number *coef = NULL,
767 kStrategy strat = NULL);
768
769// Reduces PR at Current->next with PW
770// Assumes PR != NULL, Current contained in PR
771// Current->next != NULL, LM(PW) divides LM(Current->next)
772// Changes: PR
773// Const: PW
774// Return: see ksReducePoly
776 TObject* PW,
777 poly Current,
778 poly spNoether = NULL);
779
781
782// Creates S-Poly of Pair
783// Const: Pair->p1, Pair->p2
784// Changes: Pair->p == S-Poly of p1, p2
785// Assume: Pair->p1 != NULL && Pair->p2
786void ksCreateSpoly(LObject* Pair, poly spNoether = NULL,
787 int use_buckets=0, ring tailRing=currRing,
788 poly m1 = NULL, poly m2 = NULL, TObject** R = NULL);
789
790/*2
791* creates the leading term of the S-polynomial of p1 and p2
792* do not destroy p1 and p2
793* remarks:
794* 1. the coefficient is 0 (nNew)
795* 2. pNext is undefined
796*/
797poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing);
798
799
800// old stuff
801KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether = NULL);
802KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether = NULL);
803KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether = NULL, ring r = currRing);
804KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r = currRing);
805
806/***************************************************************
807 *
808 * Routines related for ring changes during std computations
809 *
810 ***************************************************************/
811// return TRUE and set m1, m2 to k_GetLcmTerms,
812// if spoly creation of strat->P does not violate
813// exponent bound of strat->tailRing
814// FALSE, otherwise
815BOOLEAN kCheckSpolyCreation(LObject* L, kStrategy strat, poly &m1, poly &m2);
816// return TRUE if gcdpoly creation of R[atR] and S[atS] does not violate
817// exponent bound of strat->tailRing
818// FALSE, otherwise
819BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat);
820poly preIntegerCheck(ideal F, ideal Q);
821void postReduceByMon(LObject* h, kStrategy strat);
823void finalReduceByMon(kStrategy strat);
824// change strat->tailRing and adjust all data in strat, L, and T:
825// new tailRing has larger exponent bound
826// do nothing and return FALSE if exponent bound increase would result in
827// larger exponent bound that that of currRing
829 LObject* L = NULL, TObject* T = NULL,
830 // take this as new_expbound: if 0
831 // new expbound is 2*expbound of tailRing
832 unsigned long new_expbound = 0);
833// initiate a change of the tailRing of strat -- should be called
834// right before main loop in bba
836
837/// Output some debug info about a given strategy
838void kDebugPrint(kStrategy strat);
839
840// getting sb order for sba computations
841ring sbaRing(kStrategy strat, const ring r=currRing, BOOLEAN complete=TRUE, int sgn=1);
842
843KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k,
844 kStrategy strat);
845
847
848/* shiftgb stuff */
850
851#ifdef HAVE_SHIFTBBA
852static inline int kFindInL1(const poly p, const kStrategy strat)
853{
854 for(int i=strat->Ll;i>=0;i--)
855 {
856 if (p==strat->L[i].p1) return i;
857 }
858 return -1;
859}
860
861void enterTShift(LObject* p, kStrategy strat, int atT = -1);
862
863BOOLEAN enterOnePairShift (poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS);
864
865void enterpairsShift (poly h,int k,int ecart,int pos,kStrategy strat, int atR);
866
867void superenterpairsShift (poly h,int k,int ecart,int pos,kStrategy strat, int atR);
868
869poly redtailBbaShift (LObject* L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize);
870
871int redFirstShift (LObject* h,kStrategy strat); // ok
872
873ideal bbaShift(ideal F, ideal Q,intvec *w,bigintmat *hilb,kStrategy strat);
874#endif
875
876static inline void kDeleteLcm(LObject *P)
877{
878 if (P->lcm!=NULL)
879 {
881 pLmDelete(P->lcm);
882 else
883 pLmFree(P->lcm);
884 P->lcm=NULL;
885 }
886}
887
888void initenterpairs (poly h,int k,int ecart,int isFromQ,kStrategy strat, int atR = -1);
889#endif
int sgn(const Rational &a)
Definition GMPrat.cc:430
long int64
Definition auxiliary.h:68
int BOOLEAN
Definition auxiliary.h:88
#define TRUE
Definition auxiliary.h:101
#define FALSE
Definition auxiliary.h:97
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
Matrices of numbers.
Definition bigintmat.h:51
KINLINE long SetDegStuffReturnLDeg()
Definition kInline.h:850
KINLINE void Tail_Mult_nn(number n)
Definition kInline.h:655
int i_r1
Definition kutil.h:194
KINLINE void Copy()
Definition kInline.h:803
KINLINE void Delete()
Definition kInline.h:585
KINLINE void LmDeleteAndIter()
Definition kInline.h:691
KINLINE TObject * T_2(const skStrategy *strat)
Definition kInline.h:921
KINLINE void PrepareRed(BOOLEAN use_bucket)
Definition kInline.h:616
unsigned checked
Definition kutil.h:195
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:637
KINLINE void T_1_2(const skStrategy *strat, TObject *&T_1, TObject *&T_2)
Definition kInline.h:932
KINLINE void Normalize()
Definition kInline.h:347
unsigned long sev
Definition kutil.h:188
KINLINE void Init(ring tailRing=currRing)
Definition kInline.h:592
KINLINE long MinComp()
Definition kInline.h:881
kBucket_pt bucket
Definition kutil.h:193
poly p2
Definition kutil.h:189
BOOLEAN prod_crit
Definition kutil.h:200
KINLINE TObject * T_1(const skStrategy *strat)
Definition kInline.h:911
KINLINE int GetpLength()
Definition kInline.h:864
KINLINE int SetLength(BOOLEAN lengt_pLength=FALSE)
Definition kInline.h:871
poly lcm
Definition kutil.h:192
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:669
KINLINE void ShallowCopyDelete(ring new_tailRing, pShallowCopyDeleteProc p_shallow_copy_delete)
Definition kInline.h:780
KINLINE poly GetTP()
Definition kInline.h:737
KINLINE long pLDeg()
Definition kInline.h:819
KINLINE sLObject & operator=(const sTObject &)
Definition kInline.h:905
KINLINE void SetShortExpVector()
Definition kInline.h:791
KINLINE void HeadNormalize()
Definition kInline.h:367
KINLINE poly GetP(omBin lmBin=(omBin) NULL)
Definition kInline.h:753
KINLINE sLObject(ring tailRing=currRing)
Definition kInline.h:600
poly p1
Definition kutil.h:189
KINLINE long Comp()
Definition kInline.h:896
KINLINE poly LmExtractAndIter()
Definition kInline.h:711
int i_r2
Definition kutil.h:194
KINLINE poly GetLm(ring r)
Definition kInline.h:262
KINLINE poly GetLmCurrRing()
Definition kInline.h:242
char is_redundant
Definition kutil.h:94
poly sig
Definition kutil.h:73
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:80
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:79
KINLINE long GetpFDeg() const
Definition kInline.h:437
KINLINE sTObject(ring tailRing=currRing)
Definition kInline.h:116
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:103
KINLINE void SetLmCurrRing()
Definition kInline.h:299
poly max_exp
Definition kutil.h:76
char is_normalized
Definition kutil.h:88
KINLINE long pLDeg()
Definition kInline.h:442
char is_sigsafe
Definition kutil.h:99
KINLINE void LmDeleteAndIter()
Definition kInline.h:313
int pLength
Definition kutil.h:81
KINLINE long pFDeg() const
Definition kInline.h:422
int i_r
Definition kutil.h:82
poly p
Definition kutil.h:74
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:75
ring tailRing
Definition kutil.h:77
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:78
KINLINE poly Next()
Definition kInline.h:305
void wrp()
Definition kutil.cc:757
int shift
Definition kutil.h:85
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:72
KINLINE void Copy()
Definition kInline.h:224
KINLINE poly kNoetherTail()
Definition kInline.h:66
unsigned long * sevSyz
Definition kutil.h:322
kStrategy next
Definition kutil.h:278
intvec * kModW
Definition kutil.h:334
bool sigdrop
Definition kutil.h:357
poly t_kNoether
Definition kutil.h:329
int syzComp
Definition kutil.h:353
int * S_2_R
Definition kutil.h:341
ring tailRing
Definition kutil.h:342
void(* chainCrit)(poly p, int ecart, kStrategy strat)
Definition kutil.h:290
ideal D
Definition kutil.h:303
char noTailReduction
Definition kutil.h:375
int currIdx
Definition kutil.h:316
int nrsyzcrit
Definition kutil.h:358
intset lenS
Definition kutil.h:318
int nrrewcrit
Definition kutil.h:359
char posInLOldFlag
Definition kutil.h:379
pFDegProc pOrigFDeg_TailRing
Definition kutil.h:297
int Ll
Definition kutil.h:350
TSet T
Definition kutil.h:325
BOOLEAN(* rewCrit1)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.h:292
char news
Definition kutil.h:397
omBin lmBin
Definition kutil.h:343
int syzmax
Definition kutil.h:348
int Bl
Definition kutil.h:351
intset ecartS
Definition kutil.h:308
int syzidxmax
Definition kutil.h:348
char honey
Definition kutil.h:374
char rightGB
Definition kutil.h:366
polyset S
Definition kutil.h:305
int minim
Definition kutil.h:356
poly kNoether
Definition kutil.h:328
BOOLEAN * NotUsedAxis
Definition kutil.h:331
LSet B
Definition kutil.h:327
BOOLEAN * pairtest
Definition kutil.h:332
int cp
Definition kutil.h:346
int ak
Definition kutil.h:352
TObject ** R
Definition kutil.h:339
BOOLEAN(* rewCrit3)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.h:294
int lastAxis
Definition kutil.h:354
ideal M
Definition kutil.h:304
int tl
Definition kutil.h:349
int(* red2)(LObject *L, kStrategy strat)
Definition kutil.h:280
unsigned long * sevT
Definition kutil.h:324
unsigned long * sevSig
Definition kutil.h:323
int nr
Definition kutil.h:345
intvec * kHomW
Definition kutil.h:335
int max_lower_index
Definition kutil.h:317
poly tail
Definition kutil.h:333
char sugarCrit
Definition kutil.h:374
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.h:283
KINLINE TObject * s_2_t(int i)
Definition kInline.h:47
int blockred
Definition kutil.h:362
intset syzIdx
Definition kutil.h:312
ideal Shdl
Definition kutil.h:302
int syzl
Definition kutil.h:348
unsigned sbaOrder
Definition kutil.h:315
pFDegProc pOrigFDeg
Definition kutil.h:295
int blockredmax
Definition kutil.h:363
int tmax
Definition kutil.h:349
int(* posInLOld)(const LSet Ls, const int Ll, LObject *Lo, const kStrategy strat)
Definition kutil.h:287
polyset sig
Definition kutil.h:307
polyset syz
Definition kutil.h:306
char LDegLast
Definition kutil.h:382
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
Definition kutil.h:286
BOOLEAN(* syzCrit)(poly sig, unsigned long not_sevSig, kStrategy strat)
Definition kutil.h:291
wlen_set lenSw
Definition kutil.h:319
void(* enterS)(LObject *h, int pos, kStrategy strat, int atR)
Definition kutil.h:285
char kAllAxis
Definition kutil.h:373
int cv
Definition kutil.h:365
char noetherSet
Definition kutil.h:377
pShallowCopyDeleteProc p_shallow_copy_delete
Definition kutil.h:337
char Gebauer
Definition kutil.h:375
intset fromQ
Definition kutil.h:320
char newt
Definition kutil.h:398
char use_buckets
Definition kutil.h:380
int mu
Definition kutil.h:347
char interpt
Definition kutil.h:368
char redTailChange
Definition kutil.h:396
int newIdeal
Definition kutil.h:355
char fromT
Definition kutil.h:376
char completeReduce_retry
Definition kutil.h:400
void(* initEcart)(TObject *L)
Definition kutil.h:281
omBin tailBin
Definition kutil.h:344
LObject P
Definition kutil.h:301
KINLINE TObject * S_2_T(int i)
Definition kInline.h:38
char noClearS
Definition kutil.h:399
int Lmax
Definition kutil.h:350
char z2homog
Definition kutil.h:371
int LazyPass
Definition kutil.h:352
char no_prod_crit
Definition kutil.h:391
char overflow
Definition kutil.h:401
void(* enterOnePair)(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
Definition kutil.h:289
LSet L
Definition kutil.h:326
char length_pLength
Definition kutil.h:384
int(* posInT)(const TSet T, const int tl, LObject &h)
Definition kutil.h:282
int(* red)(LObject *L, kStrategy strat)
Definition kutil.h:279
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.h:293
int sl
Definition kutil.h:347
int sbaEnterS
Definition kutil.h:360
int LazyDegree
Definition kutil.h:352
char posInLDependsOnLength
Definition kutil.h:386
unsigned long * sevS
Definition kutil.h:321
char homog
Definition kutil.h:369
pLDegProc pOrigLDeg
Definition kutil.h:296
intset fromS
Definition kutil.h:309
char update
Definition kutil.h:378
s_poly_proc_t s_poly
Definition kutil.h:299
pLDegProc pOrigLDeg_TailRing
Definition kutil.h:298
int Bmax
Definition kutil.h:351
int c3
Definition kutil.h:346
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:15
VAR int strat_nr
Definition kstdfac.cc:21
poly redtail(LObject *L, int end_pos, kStrategy strat)
Definition kutil.cc:6836
VAR int HCord
Definition kutil.cc:239
VAR denominator_list DENOMINATOR_LIST
Definition kutil.cc:79
KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r=currRing)
Definition kInline.h:1204
void initSbaPos(kStrategy strat)
Definition kutil.cc:9863
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:3809
int posInSyz(const kStrategy strat, const poly sig)
Definition kutil.cc:5758
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:590
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:317
int redRing_Z(LObject *h, kStrategy strat)
Definition kstd2.cc:720
int posInT17(const TSet set, const int length, LObject &p)
Definition kutil.cc:5278
int posInL13(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:6145
void initBuchMora(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:9749
void initEcartPairBba(LObject *Lp, poly f, poly g, int ecartF, int ecartG)
Definition kutil.cc:1308
int redFirst(LObject *h, kStrategy strat)
Definition kstd1.cc:794
denominator_list_s * denominator_list
Definition kutil.h:64
wlen_type * wlen_set
Definition kutil.h:56
poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing)
Definition kstd2.cc:609
void enterSSba(LObject *p, int atS, kStrategy strat, int atR=-1)
Definition kutil.cc:8915
int redFirstShift(LObject *h, kStrategy strat)
Definition kstd2.cc:4951
BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.cc:6646
void enterSyz(LObject &p, kStrategy strat, int atT)
Definition kutil.cc:9343
int posInL15(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:6180
int redNF0(LObject *P, kStrategy strat)
int redEcart(LObject *h, kStrategy strat)
Definition kstd1.cc:168
int posInT11(const TSet set, const int length, LObject &p)
Definition kutil.cc:4953
int posInLSigRing(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5694
int ksReducePolySigRing(LObject *PR, TObject *PW, long idx, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
Definition kspoly.cc:943
int posInTSig(const TSet set, const int length, LObject &p)
int posInT1(const TSet set, const int length, LObject &p)
Definition kutil.cc:4896
int ksReducePolySig(LObject *PR, TObject *PW, long idx, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
Definition kspoly.cc:737
void message(int i, int *olddeg, int *reduc, kStrategy strat, int red_result)
Definition kutil.cc:7463
BOOLEAN kTest(kStrategy strat)
Definition kutil.cc:1004
void chainCritSig(poly p, int ecart, kStrategy strat)
Definition kutil.cc:3461
int posInT_EcartpLength(const TSet set, const int length, LObject &p)
Definition kutil.cc:5146
BOOLEAN kTest_TS(kStrategy strat)
Definition kutil.cc:1067
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:464
int kFindInT(poly p, TSet T, int tlength)
returns index of p in TSet, or -1 if not found
Definition kutil.cc:703
BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat)
Definition kutil.cc:10497
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:142
BOOLEAN kTest_L(LObject *L, kStrategy strat, BOOLEAN testp=FALSE, int lpos=-1, TSet T=NULL, int tlength=-1)
Definition kutil.cc:916
TObject * TSet
Definition kutil.h:60
void enterSBbaShift(LObject *p, int atS, kStrategy strat, int atR=-1)
Definition kutil.cc:8892
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
Definition kutil.cc:1269
void enterTShift(LObject *p, kStrategy strat, int atT=-1)
Definition kutil.cc:12957
int posInL17(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:6255
#define setmaxL
Definition kutil.h:31
int kFindSameLMInT_Z(const kStrategy strat, const LObject *L, const int start=0)
int posInT2(const TSet set, const int length, LObject &p)
Definition kutil.cc:4925
int posInL15Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:6215
void superenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR=-1)
Definition kutil.cc:4470
int posInT_pLength(const TSet set, const int length, LObject &p)
Definition kutil.cc:11449
void completeReduce(kStrategy strat, BOOLEAN withT=FALSE)
Definition kutil.cc:10257
void initHilbCrit(ideal F, ideal Q, bigintmat **hilb, kStrategy strat)
Definition kutil.cc:9417
void enterOnePairNormal(int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR)
Definition kutil.cc:1939
static int kFindInL1(const poly p, const kStrategy strat)
Definition kutil.h:852
int posInT13(const TSet set, const int length, LObject &p)
Definition kutil.cc:5117
void redtailBbaAlsoLC_Z(LObject *L, int end_pos, kStrategy strat)
Definition kutil.cc:7140
poly kNF2(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
Definition kstd2.cc:3927
void enterSBba(LObject *p, int atS, kStrategy strat, int atR=-1)
Definition kutil.cc:8792
BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat)
Definition kutil.cc:6513
void deleteHC(poly *p, int *e, int *l, kStrategy strat)
Definition kutil.cc:351
int kFindDivisibleByInT_ecart(const kStrategy strat, const LObject *L, const int ecart)
Definition kstd2.cc:416
int posInSMonFirst(const kStrategy strat, const int length, const poly p)
Definition kutil.cc:4764
KINLINE BOOLEAN arriRewDummy(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kInline.h:1258
void initBuchMoraPos(kStrategy strat)
Definition kutil.cc:9580
void initS(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:7586
int posInIdealMonFirst(const ideal F, const poly p, int start=0, int end=-1)
Definition kutil.cc:4841
KINLINE poly redtailBbaBound(poly p, int end_pos, kStrategy strat, int bound, BOOLEAN normalize=FALSE)
Definition kInline.h:1218
int redHoney(LObject *h, kStrategy strat)
Definition kstd2.cc:2110
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:10518
KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin bin)
Definition kInline.h:977
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L=NULL, TObject *T=NULL, unsigned long new_expbound=0)
Definition kutil.cc:10939
int64 wlen_type
Definition kutil.h:55
int posInLSig(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5669
KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
Definition kInline.h:968
int posInL11(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5802
void chainCritOpt_1(poly, int, kStrategy strat)
Definition kutil.cc:3445
ideal sba(ideal F, ideal Q, intvec *w, bigintmat *hilb, kStrategy strat)
Definition kstd2.cc:2971
int kFindNextDivisibleByInS(const kStrategy strat, int start, int max_ind, LObject *L)
Definition kstd2.cc:567
static LSet initL(int nr=setmaxL)
Definition kutil.h:417
KINLINE TSet initT()
Definition kInline.h:84
void cancelunit(LObject *p, BOOLEAN inNF=FALSE)
Definition kutil.cc:365
int posInL11Ringls(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5912
KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin bin)
Definition kInline.h:984
KINLINE poly redtailBba_Ring(poly p, int end_pos, kStrategy strat)
Definition kInline.h:1224
int kFindDivisibleByInT_Z(const kStrategy strat, const LObject *L, const int start=0)
Definition kstd2.cc:209
LObject * LSet
Definition kutil.h:61
int redHomog(LObject *h, kStrategy strat)
Definition kstd2.cc:1150
int posInT17_c(const TSet set, const int length, LObject &p)
Definition kutil.cc:5384
poly redtailBbaShift(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
Definition kutil.cc:12980
denominator_list next
Definition kutil.h:66
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
Definition kutil.cc:11358
int posInT15(const TSet set, const int length, LObject &p)
Definition kutil.cc:5184
void enterSMoraNF(LObject *p, int atS, kStrategy strat, int atR=-1)
Definition kstd1.cc:1682
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:10682
BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat)
Definition kutil.cc:6478
void HEckeTest(poly pp, kStrategy strat)
Definition kutil.cc:493
int redLazy(LObject *h, kStrategy strat)
Definition kstd2.cc:1905
void enterT(LObject *p, kStrategy strat, int atT=-1)
Definition kutil.cc:9143
void enterExtendedSpolySig(poly h, poly hSig, kStrategy strat)
Definition kutil.cc:4316
void enterpairsSig(poly h, poly hSig, int from, int k, int ec, int pos, kStrategy strat, int atR=-1)
Definition kutil.cc:4513
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
Definition kutil.cc:12927
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin bin)
Definition kInline.h:959
void initBba(kStrategy strat)
Definition kstd1.cc:1690
void exitBuchMora(kStrategy strat)
Definition kutil.cc:9837
void messageStatSBA(int hilbcount, kStrategy strat)
Definition kutil.cc:7517
int redRiloc(LObject *h, kStrategy strat)
Definition kstd1.cc:385
void initEcartNormal(TObject *h)
Definition kutil.cc:1293
static void kDeleteLcm(LObject *P)
Definition kutil.h:876
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
Definition kutil.cc:4663
void updateS(BOOLEAN toT, kStrategy strat)
Definition kutil.cc:8557
int posInL0(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5611
int redSigRing(LObject *h, kStrategy strat)
Definition kstd2.cc:1536
int * intset
Definition kutil.h:54
void initSLSba(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:7781
TObject * kFindDivisibleByInS_T(kStrategy strat, int end_pos, LObject *L, TObject *T, long ecart=LONG_MAX)
Definition kutil.cc:6697
void initSba(ideal F, kStrategy strat)
Definition kstd1.cc:1750
int ksReducePolyTail(LObject *PR, TObject *PW, poly Current, poly spNoether=NULL)
Definition kspoly.cc:1350
void initSyzRules(kStrategy strat)
Definition kutil.cc:7933
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:9936
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
Definition kutil.cc:10459
void cleanT(kStrategy strat)
Definition kutil.cc:557
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:1060
int posInT110(const TSet set, const int length, LObject &p)
Definition kutil.cc:5029
BOOLEAN kTest_S(kStrategy strat)
Definition kutil.cc:1049
KINLINE TObject ** initR()
Definition kInline.h:95
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
Definition kstd2.cc:2307
ideal bbaShift(ideal F, ideal Q, intvec *w, bigintmat *hilb, kStrategy strat)
Definition kstd2.cc:4577
void reorderS(int *suc, kStrategy strat)
Definition kutil.cc:4610
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether=NULL)
Definition kInline.h:1174
void enterExtendedSpoly(poly h, kStrategy strat)
Definition kutil.cc:4232
void enterSMora(LObject *p, int atS, kStrategy strat, int atR=-1)
Definition kstd1.cc:1629
void enterpairs(poly h, int k, int ec, int pos, kStrategy strat, int atR=-1)
Definition kutil.cc:4487
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR=-1)
Definition kutil.cc:4457
int redSig(LObject *h, kStrategy strat)
Definition kstd2.cc:1369
KINLINE poly redtailBba_Z(poly p, int end_pos, kStrategy strat)
Definition kInline.h:1229
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether=NULL)
Definition kInline.h:1184
int posInL10(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kstd1.cc:1360
KINLINE poly redtailBba(poly p, int end_pos, kStrategy strat, BOOLEAN normalize=FALSE)
Definition kInline.h:1212
void updateResult(ideal r, ideal Q, kStrategy strat)
Definition kutil.cc:10051
int posInT0(const TSet set, const int length, LObject &p)
Definition kutil.cc:4885
#define KINLINE
Definition kutil.h:50
int posInT19(const TSet set, const int length, LObject &p)
Definition kutil.cc:5510
poly redtailBba_NF(poly p, kStrategy strat)
Definition kutil.cc:7350
void exitSba(kStrategy strat)
Definition kutil.cc:10011
ring sbaRing(kStrategy strat, const ring r=currRing, BOOLEAN complete=TRUE, int sgn=1)
Definition kutil.cc:11064
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:12143
void kDebugPrint(kStrategy strat)
Output some debug info about a given strategy.
Definition kutil.cc:11478
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition kutil.cc:1208
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether=NULL, ring r=currRing)
Definition kInline.h:1194
void kStratInitChangeTailRing(kStrategy strat)
Definition kutil.cc:11036
BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.cc:6621
void initBuchMoraCrit(kStrategy strat)
Definition kutil.cc:9435
void initBuchMoraPosRing(kStrategy strat)
Definition kutil.cc:9664
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:728
void postReduceByMonSig(LObject *h, kStrategy strat)
Definition kutil.cc:10758
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:1203
int posInL11Ring(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5844
void messageSets(kStrategy strat)
Definition kutil.cc:7536
int redRing(LObject *h, kStrategy strat)
Definition kstd2.cc:988
void deleteInS(int i, kStrategy strat)
Definition kutil.cc:1132
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
Definition kutil.cc:11412
BOOLEAN sbaCheckGcdPair(LObject *h, kStrategy strat)
Definition kutil.cc:1688
int posInL110(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:6058
poly redtail(poly p, int end_pos, kStrategy strat)
Definition kutil.cc:6906
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:1315
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:3204
void initEcartBBA(TObject *h)
Definition kutil.cc:1301
class sTObject TObject
Definition kutil.h:58
ideal bba(ideal F, ideal Q, intvec *w, bigintmat *hilb, kStrategy strat)
Definition kstd2.cc:2614
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
Definition kInline.h:1235
void enterT_strong(LObject *p, kStrategy strat, int atT=-1)
Definition kutil.cc:9242
int posInLF5CRing(const LSet set, int start, const int length, LObject *L, const kStrategy strat)
Definition kutil.cc:5878
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:1446
void messageStat(int hilbcount, kStrategy strat)
Definition kutil.cc:7504
int redHoneyM(LObject *h, kStrategy strat)
void f5c(kStrategy strat, int &olddeg, int &minimcnt, int &hilbeledeg, int &hilbcount, int &srmax, int &lrmax, int &reduc, ideal Q, intvec *w, bigintmat *hilb)
Definition kstd2.cc:4265
void initSL(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:7679
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:1018
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
Definition kutil.cc:10847
BOOLEAN kTest_T(TObject *T, kStrategy strat, int tpos=-1, char TN='?')
Definition kutil.cc:789
void initSbaCrit(kStrategy strat)
Definition kutil.cc:9498
BOOLEAN newHEdge(kStrategy strat)
Definition kutil.cc:10379
BOOLEAN homogTest(polyset F, int Fmax)
class sLObject LObject
Definition kutil.h:59
poly redtailSba(LObject *L, int end_pos, kStrategy strat, BOOLEAN withT=FALSE, BOOLEAN normalize=FALSE)
Definition kstd2.cc:1785
BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
Definition kutil.cc:6562
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:77
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:71
poly * polyset
Definition polys.h:260
long(* pFDegProc)(poly p, ring r)
Definition ring.h:39
long(* pLDegProc)(poly p, int *length, ring r)
Definition ring.h:38
kBucket * kBucket_pt
Definition ring.h:26
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:45
#define rField_is_Ring(R)
Definition ring.h:491
#define R
Definition sirandom.c:27
#define Q
Definition sirandom.c:26
skStrategy * kStrategy
Definition structs.h:54
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
Definition syz3.cc:1027