source: git/kernel/kutil.h @ 9efc0e

spielwiese
Last change on this file since 9efc0e was cce4a2f, checked in by Hans Schönemann <hannes@…>, 15 years ago
*hannes: ALLOW_PROD_CRIT git-svn-id: file:///usr/local/Singular/svn/trunk@11433 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 22.1 KB
Line 
1#ifndef KUTIL_H
2#define KUTIL_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: kutil.h,v 1.40 2009-02-22 10:39:42 Singular Exp $ */
7/*
8* ABSTRACT: kernel: utils for kStd
9*/
10
11
12#include <string.h>
13#include <mylimits.h>
14
15#include "structs.h"
16#include "omalloc.h"
17#include "ring.h"
18#include "structs.h"
19#include "pShallowCopyDelete.h"
20
21#if 1
22#define setmax 16
23#define setmaxL ((4096-12)/sizeof(LObject))
24#define setmaxLinc ((4096)/sizeof(LObject))
25
26#define setmaxT 64
27#define setmaxTinc 32
28#else
29#define setmax 16
30#define setmaxL 16
31#define setmaxLinc 16
32#define setmaxT 16
33#define setmaxTinc 16
34#endif
35
36// define if you want std computations as in Singular version < 2
37// This disbales RedThrough, tailReductions against T (bba),
38// sets posInT = posInT15 (bba, strat->honey), and enables redFirst with LDeg
39// NOTE: the same effect can be achieved with option(oldStd)
40// #define HAVE_OLD_STD
41
42#ifdef HAVE_OLD_STD
43#define K_TEST_OPT_REDTHROUGH 0
44#define K_TEST_OPT_OLDSTD 1
45#else
46#define K_TEST_OPT_REDTHROUGH TEST_OPT_REDTHROUGH
47#define K_TEST_OPT_OLDSTD     TEST_OPT_OLDSTD
48#endif
49
50#undef NO_KINLINE
51#if !defined(KDEBUG) && !defined(NO_INLINE)
52#define KINLINE inline
53#else
54#define KINLINE
55#define NO_KINLINE 1
56#endif
57
58typedef int* intset;
59typedef int64  wlen_type;
60typedef wlen_type* wlen_set;
61
62typedef class sTObject TObject;
63typedef class sLObject LObject;
64typedef TObject * TSet;
65typedef LObject * LSet;
66
67class sTObject
68{
69public:
70  poly p;       // Lm(p) \in currRing Tail(p) \in tailRing
71  poly t_p;     // t_p \in tailRing: as monomials Lm(t_p) == Lm(p)
72  poly max;     // p_GetMaxExpP(pNext(p))
73  ring tailRing;
74  long FDeg;    // pFDeg(p)
75  int ecart,
76    length,     // as of pLDeg
77    pLength,    // either == 0, or == pLength(p)
78    i_r;        // index of TObject in R set, or -1 if not in T
79  BOOLEAN is_normalized; // true, if pNorm was called on p, false otherwise
80
81  // initialization
82  KINLINE void Init(ring r = currRing);
83  KINLINE sTObject(ring tailRing = currRing);
84  KINLINE sTObject(poly p, ring tailRing = currRing);
85  KINLINE sTObject(poly p, ring c_r, ring tailRing);
86  KINLINE sTObject(sTObject* T, int copy);
87
88  KINLINE void Set(ring r=currRing);
89  KINLINE void Set(poly p_in, ring r=currRing);
90  KINLINE void Set(poly p_in, ring c_r, ring t_r);
91
92  // Frees the polys of T
93  KINLINE void Delete();
94  // Sets polys to NULL
95  KINLINE void Clear();
96  // makes a copy of the poly of T
97  KINLINE void Copy();
98
99  // ring-dependent Lm access: these might result in allocation of monomials
100  KINLINE poly GetLmCurrRing();
101  KINLINE poly GetLmTailRing();
102  KINLINE poly GetLm(ring r);
103  // this returns Lm and ring r (preferably from tailRing), but does not
104  // allocate a new poly
105  KINLINE void GetLm(poly &p, ring &r) const;
106
107#ifdef OLIVER_PRIVAT_LT
108  // routines for calc. with rings
109  KINLINE poly GetLtCurrRing();
110  KINLINE poly GetLtTailRing();
111  KINLINE poly GetLt(ring r);
112  KINLINE void GetLt(poly &p, ring &r) const;
113#endif
114
115  KINLINE BOOLEAN IsNull() const;
116
117  KINLINE int GetpLength();
118
119  // makes sure that T.p exists
120  KINLINE void SetLmCurrRing();
121
122  // Iterations
123  // simply get the next monomial
124  KINLINE poly Next();
125  KINLINE void LmDeleteAndIter();
126
127  // deg stuff
128  // computes pFDeg
129  KINLINE long pFDeg() const;
130  // computes and sets FDeg
131  KINLINE long SetpFDeg();
132  // gets stored FDeg
133  KINLINE long GetpFDeg() const;
134
135  // computes pLDeg
136  KINLINE long pLDeg();
137  // sets length, FDeg, returns LDeg
138  KINLINE long SetDegStuffReturnLDeg();
139
140  // arithmetic
141  KINLINE void Mult_nn(number n);
142  KINLINE void ShallowCopyDelete(ring new_tailRing, omBin new_tailBin,
143                                 pShallowCopyDeleteProc p_shallow_copy_delete,
144                                 BOOLEAN set_max = TRUE);
145  // manipulations
146  KINLINE void pNorm();
147  KINLINE void pCleardenom();
148
149#ifdef KDEBUG
150  void wrp();
151#endif
152};
153
154#ifndef NDEBUG
155extern int strat_nr;
156extern int strat_fac_debug;
157#endif
158
159class sLObject : public sTObject
160{
161
162public:
163  unsigned long sev;
164  poly  p1,p2; /*- the pair p comes from,
165                 lm(pi) in currRing, tail(pi) in tailring -*/
166
167  poly  lcm;   /*- the lcm of p1,p2 -*/
168  poly last;   // pLast(p) during reductions
169  kBucket_pt bucket;
170  int   i_r1, i_r2;
171
172  // initialization
173  KINLINE void Init(ring tailRing = currRing);
174  KINLINE sLObject(ring tailRing = currRing);
175  KINLINE sLObject(poly p, ring tailRing = currRing);
176  KINLINE sLObject(poly p, ring c_r, ring tailRing);
177
178  // Frees the polys of L
179  KINLINE void Delete();
180  KINLINE void Clear();
181
182  // Iterations
183  KINLINE void LmDeleteAndIter();
184  KINLINE poly LmExtractAndIter();
185
186  // spoly related things
187  // preparation for reduction if not spoly
188  KINLINE void PrepareRed(BOOLEAN use_bucket);
189  KINLINE void SetLmTail(poly lm, poly new_p, int length,
190                         int use_bucket, ring r, poly last);
191  KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether);
192  KINLINE void Tail_Mult_nn(number n);
193  // deletes bucket, makes sure that p and t_p exists
194  KINLINE poly GetP(omBin lmBin = NULL);
195  // similar, except that only t_p exists
196  KINLINE poly GetTP();
197
198  // does not delete bucket, just canonicalizes it
199  // returned poly is such that Lm(p) \in currRing, Tail(p) \in tailRing
200  KINLINE poly CanonicalizeP();
201
202  // makes a copy of the poly of L
203  KINLINE void Copy();
204  // gets the poly and makes a copy of it
205  KINLINE poly CopyGetP();
206
207  KINLINE int GetpLength();
208  KINLINE long pLDeg(BOOLEAN use_last);
209  KINLINE long pLDeg();
210  KINLINE int SetLength(BOOLEAN lengt_pLength = FALSE);
211  KINLINE long SetDegStuffReturnLDeg();
212  KINLINE long SetDegStuffReturnLDeg(BOOLEAN use_last);
213
214  // returns minimal component of p
215  KINLINE long MinComp();
216  // returns component of p
217  KINLINE long Comp();
218
219  KINLINE void ShallowCopyDelete(ring new_tailRing,
220                                 pShallowCopyDeleteProc p_shallow_copy_delete);
221
222  // sets sev
223  KINLINE void SetShortExpVector();
224
225  // enable assignment from TObject
226  KINLINE sLObject& operator=(const sTObject&);
227
228  // get T's corresponding to p1, p2: they might return NULL
229  KINLINE TObject* T_1(const skStrategy* strat);
230  KINLINE TObject* T_2(const skStrategy* strat);
231  KINLINE void     T_1_2(const skStrategy* strat,
232                         TObject* &T_1, TObject* &T_2);
233
234  // simplify coefficients
235  KINLINE void Normalize();
236  KINLINE void HeadNormalize();
237};
238
239
240extern int HCord;
241
242class skStrategy;
243typedef skStrategy * kStrategy;
244class skStrategy
245{
246public:
247  kStrategy next;
248  int (*red)(LObject * L,kStrategy strat);
249  void (*initEcart)(LObject * L);
250  int (*posInT)(const TSet T,const int tl,LObject &h);
251  int (*posInL)(const LSet set, const int length,
252                LObject* L,const kStrategy strat);
253  void (*enterS)(LObject h, int pos,kStrategy strat, int atR/* =-1*/ );
254  void (*initEcartPair)(LObject * h, poly f, poly g, int ecartF, int ecartG);
255  int (*posInLOld)(const LSet Ls,const int Ll,
256                   LObject* Lo,const kStrategy strat);
257  pFDegProc pOrigFDeg;
258  pLDegProc pOrigLDeg;
259  pFDegProc pOrigFDeg_TailRing;
260  pLDegProc pOrigLDeg_TailRing;
261
262  LObject P;
263  ideal Shdl;
264  ideal D; /*V(S) is in D(D)*/
265  ideal M; /*set of minimal generators*/
266  polyset S;
267  intset ecartS;
268  intset lenS;
269  wlen_set lenSw; /* for tgb.ccc */
270  intset fromQ;
271  unsigned long* sevS;
272  unsigned long* sevT;
273  TSet T;
274  LSet L;
275  LSet    B;
276  poly    kHEdge;
277  poly    kNoether;
278  poly    t_kHEdge; // same polys in tailring
279  KINLINE poly    kNoetherTail();
280  poly    t_kNoether;
281  BOOLEAN * NotUsedAxis;
282  BOOLEAN * pairtest;/*used for enterOnePair*/
283  poly tail;
284  leftv kIdeal;
285  intvec * kModW;
286  intvec * kHomW;
287  // procedure for ShalloCopy from tailRing  to currRing
288  pShallowCopyDeleteProc p_shallow_copy_delete;
289  // pointers to Tobjects R[i] is ith Tobject which is generated
290  TObject**  R;
291  // S_2_R[i] yields Tobject which corresponds to S[i]
292  int*      S_2_R;
293  ring tailRing;
294  omBin lmBin;
295  omBin tailBin;
296#ifndef NDEBUG
297  int nr;
298#endif
299  int cp,c3;
300  int cv; // in shift bases: counting V criterion
301  int sl,mu;
302  int tl,tmax;
303  int Ll,Lmax;
304  int Bl,Bmax;
305  int ak,LazyDegree,LazyPass;
306  int syzComp;
307  int HCord;
308  int lastAxis;
309  int newIdeal;
310  int minim;
311  BOOLEAN interpt;
312  BOOLEAN homog;
313#ifdef HAVE_PLURAL
314  BOOLEAN z2homog; // Z_2 - homogeneous input allows product criterion in commutative and SCA cases!
315#endif
316  BOOLEAN kHEdgeFound;
317  BOOLEAN honey,sugarCrit;
318  BOOLEAN Gebauer,noTailReduction;
319  BOOLEAN fromT;
320  BOOLEAN noetherSet;
321  BOOLEAN update;
322  BOOLEAN posInLOldFlag;
323  BOOLEAN use_buckets;
324  BOOLEAN interred_flag;
325  // if set, pLDeg(p, l) == (pFDeg(pLast(p), pLength)
326  BOOLEAN LDegLast;
327  // if set, then L.length == L.pLength
328  BOOLEAN length_pLength;
329  // if set, then posInL does not depend on L.length
330  BOOLEAN posInLDependsOnLength;
331  /*FALSE, if posInL == posInL10*/
332#ifdef HAVE_PLURAL
333  // set this flag to 1 to stop the product criteria
334  // use ALLOW_PROD_CRIT(strat) to test
335  BOOLEAN no_prod_crit;
336#define ALLOW_PROD_CRIT(A) (!(A)->no_prod_crit)
337#else
338#define ALLOW_PROD_CRIT(A) (1)
339#endif
340  char    redTailChange;
341  char    news;
342  char    newt;/*used for messageSets*/
343  char    noClearS;
344  char    completeReduce_retry;
345
346  skStrategy();
347  ~skStrategy();
348
349  // return TObject corresponding to S[i]: assume that it exists
350  // i.e. no error checking is done
351  KINLINE TObject* S_2_T(int i);
352  // like S_2_T, except that NULL is returned if it can not be found
353  KINLINE TObject* s_2_t(int i);
354};
355
356void deleteHC(poly *p, int *e, int *l, kStrategy strat);
357void deleteHC(LObject* L, kStrategy strat, BOOLEAN fromNext = FALSE);
358void deleteInS (int i,kStrategy strat);
359void cleanT (kStrategy strat);
360static inline LSet initL (int nr=setmaxL)
361{ return (LSet)omAlloc(nr*sizeof(LObject)); };
362void deleteInL(LSet set, int *length, int j,kStrategy strat);
363void enterL (LSet *set,int *length, int *LSetmax, LObject p,int at);
364void enterSBba (LObject p,int atS,kStrategy strat, int atR = -1);
365void initEcartPairBba (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
366void initEcartPairMora (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
367int posInS (const kStrategy strat, const int length, const poly p, 
368            const int ecart_p);
369int posInT0 (const TSet set,const int length,LObject &p);
370int posInT1 (const TSet set,const int length,LObject &p);
371int posInT2 (const TSet set,const int length,LObject &p);
372int posInT11 (const TSet set,const int length,LObject &p);
373int posInT110 (const TSet set,const int length,LObject &p);
374int posInT13 (const TSet set,const int length,LObject &p);
375int posInT15 (const TSet set,const int length,LObject &p);
376int posInT17 (const TSet set,const int length,LObject &p);
377int posInT19 (const TSet set,const int length,LObject &p);
378int posInT_EcartpLength(const TSet set,const int length,LObject &p);
379
380#ifdef HAVE_MORE_POS_IN_T
381int posInT_EcartFDegpLength(const TSet set,const int length,LObject &p);
382int posInT_FDegpLength(const TSet set,const int length,LObject &p);
383int posInT_pLength(const TSet set,const int length,LObject &p);
384#endif
385
386
387void reorderS (int* suc,kStrategy strat);
388int posInL0 (const LSet set, const int length,
389             LObject* L,const kStrategy strat);
390int posInL11 (const LSet set, const int length,
391             LObject* L,const kStrategy strat);
392int posInL13 (const LSet set, const int length,
393             LObject* L,const kStrategy strat);
394int posInL15 (const LSet set, const int length,
395             LObject* L,const kStrategy strat);
396int posInL17 (const LSet set, const int length,
397             LObject* L,const kStrategy strat);
398int posInL10 (const LSet set, const int length,
399             LObject* L,const kStrategy strat);
400KINLINE poly redtailBba (poly p,int pos,kStrategy strat,BOOLEAN normalize=FALSE);
401poly redtailBba (LObject *L, int pos,kStrategy strat,
402                 BOOLEAN withT = FALSE,BOOLEAN normalize=FALSE);
403poly redtailBba (TObject *T, int pos,kStrategy strat);
404poly redtail (poly p,int pos,kStrategy strat);
405poly redtail (LObject *L,int pos,kStrategy strat);
406poly redNF (poly h,int & max_ind,kStrategy strat);
407int redNF0 (LObject *P,kStrategy strat);
408poly redNFTail (poly h,const int sl,kStrategy strat);
409int redHoney (LObject* h, kStrategy strat);
410#ifdef HAVE_RINGS
411int redRing (LObject* h,kStrategy strat);
412void enterExtendedSpoly(poly h,kStrategy strat);
413void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR = -1);
414poly kCreateZeroPoly(long exp[], long cabsind, poly* t_p, ring leadRing, ring tailRing);
415#endif
416#ifdef HAVE_RING2TOM
417long ind2(long arg);
418long ind_fact_2(long arg);
419long twoPow(long arg);
420ideal createG0();
421#endif
422int redLazy (LObject* h,kStrategy strat);
423int redHomog (LObject* h,kStrategy strat);
424void enterpairs (poly h, int k, int ec, int pos,kStrategy strat, int atR = -1);
425void entersets (LObject h);
426void pairs ();
427void message (int i,int* reduc,int* olddeg,kStrategy strat,int red_result);
428void messageStat (int srmax,int lrmax,int hilbcount,kStrategy strat);
429#ifdef KDEBUG
430void messageSets (kStrategy strat);
431#else
432#define messageSets(s)  ((void) 0)
433#endif
434
435void initEcartNormal (LObject* h);
436void initEcartBBA (LObject* h);
437void initS (ideal F, ideal Q,kStrategy strat);
438void initSL (ideal F, ideal Q,kStrategy strat);
439void updateS(BOOLEAN toT,kStrategy strat);
440void enterT (LObject p,kStrategy strat, int atT = -1);
441void cancelunit (LObject* p,BOOLEAN inNF=FALSE);
442void HEckeTest (poly pp,kStrategy strat);
443void initBuchMoraCrit(kStrategy strat);
444void initHilbCrit(ideal F, ideal Q, intvec **hilb,kStrategy strat);
445void initBuchMoraPos(kStrategy strat);
446void initBuchMora (ideal F, ideal Q,kStrategy strat);
447void exitBuchMora (kStrategy strat);
448void updateResult(ideal r,ideal Q,kStrategy strat);
449void completeReduce (kStrategy strat, BOOLEAN withT=FALSE);
450void kFreeStrat(kStrategy strat);
451BOOLEAN homogTest(polyset F, int Fmax);
452BOOLEAN newHEdge(polyset S, kStrategy strat);
453// returns index of p in TSet, or -1 if not found
454int kFindInT(poly p, TSet T, int tlength);
455
456// return -1 if no divisor is found
457//        number of first divisor, otherwise
458int kFindDivisibleByInT(const TSet &T, const unsigned long* sevT,
459                        const int tl, const LObject* L, const int start=0);
460// same with S
461int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject* L);
462
463int kFindNextDivisibleByInS(const kStrategy strat, int start,int max_ind, LObject* L);
464TObject*
465kFindDivisibleByInS(kStrategy strat, int pos, LObject* L, TObject *T,
466                    long ecart = LONG_MAX);
467
468/***************************************************************
469 *
470 * stuff to be inlined
471 *
472 ***************************************************************/
473
474KINLINE TSet initT ();
475KINLINE TObject** initR();
476KINLINE unsigned long* initsevT();
477KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin bin);
478KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing, omBin bin);
479KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin bin);
480KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing,  omBin bin);
481
482KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing);
483KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing);
484KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing);
485KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing);
486
487// if exp bound is not violated, return TRUE and
488//                               get m1 = LCM(LM(p1), LM(p2))/LM(p1)
489//                                   m2 = LCM(LM(p1), LM(p2))/LM(p2)
490// return FALSE and m1 == NULL, m2 == NULL     , otherwise
491KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r,
492                               poly &m1, poly &m2, const ring m_r);
493#ifdef HAVE_RINGS
494KINLINE BOOLEAN k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing,
495                               poly &m1, poly &m2, poly &lcm, const ring taiRing);
496#endif
497#ifdef KDEBUG
498// test strat
499BOOLEAN kTest(kStrategy strat);
500// test strat, and test that S is contained in T
501BOOLEAN kTest_TS(kStrategy strat);
502// test LObject
503BOOLEAN kTest_L(LObject* L, ring tailRing = NULL,
504                 BOOLEAN testp = FALSE, int lpos = -1,
505                 TSet T = NULL, int tlength = -1);
506// test TObject
507BOOLEAN kTest_T(TObject* T, ring tailRing = NULL, int tpos = -1, char TN = '?');
508// test set strat->SevS
509BOOLEAN kTest_S(kStrategy strat);
510#else
511#define kTest(A)        ((void)0)
512#define kTest_TS(A)     ((void)0)
513#define kTest_T(T)      ((void)0)
514#define kTest_S(T)      ((void)0)
515#define kTest_L(T)      ((void)0)
516#endif
517
518
519/***************************************************************
520 *
521 * From kstd2.cc
522 *
523 ***************************************************************/
524poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing);
525ideal bba (ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat);
526poly kNF2 (ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce);
527ideal kNF2 (ideal F,ideal Q,ideal q, kStrategy strat, int lazyReduce);
528void initBba(ideal F,kStrategy strat);
529
530/***************************************************************
531 *
532 * From kSpolys.cc
533 *
534 ***************************************************************/
535// Reduces PR with PW
536// Assumes PR != NULL, PW != NULL, Lm(PW) divides Lm(PR)
537// Changes: PR
538// Const:   PW
539// If coef != NULL, then *coef is a/gcd(a,b), where a = LC(PR), b = LC(PW)
540// If strat != NULL, tailRing is changed if reduction would violate exp bound
541// of tailRing
542// Returns: 0 everything ok, no tailRing change
543//          1 tailRing has successfully changed (strat != NULL)
544//          2 no reduction performed, tailRing needs to be changed first
545//            (strat == NULL)
546//         -1 tailRing change could not be performed due to exceeding exp
547//            bound of currRing
548int ksReducePoly(LObject* PR,
549                 TObject* PW,
550                 poly spNoether = NULL,
551                 number *coef = NULL,
552                 kStrategy strat = NULL);
553
554// Reduces PR at Current->next with PW
555// Assumes PR != NULL, Current contained in PR
556//         Current->next != NULL, LM(PW) devides LM(Current->next)
557// Changes: PR
558// Const:   PW
559// Return: see ksReducePoly
560int ksReducePolyTail(LObject* PR,
561                     TObject* PW,
562                     poly Current,
563                     poly spNoether = NULL);
564
565KINLINE int ksReducePolyTail(LObject* PR, TObject* PW, LObject* Red);
566
567// Creates S-Poly of Pair
568// Const:   Pair->p1, Pair->p2
569// Changes: Pair->p == S-Poly of p1, p2
570// Assume:  Pair->p1 != NULL && Pair->p2
571void ksCreateSpoly(LObject* Pair, poly spNoether = NULL,
572                   int use_buckets=0, ring tailRing=currRing,
573                   poly m1 = NULL, poly m2 = NULL, TObject** R = NULL);
574
575/*2
576* creates the leading term of the S-polynomial of p1 and p2
577* do not destroy p1 and p2
578* remarks:
579*   1. the coefficient is 0 (nNew)
580*   2. pNext is undefined
581*/
582poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing);
583
584
585/*
586* input - output: a, b
587* returns:
588*   a := a/gcd(a,b), b := b/gcd(a,b)
589*   and return value
590*       0  ->  a != 1,  b != 1
591*       1  ->  a == 1,  b != 1
592*       2  ->  a != 1,  b == 1
593*       3  ->  a == 1,  b == 1
594*   this value is used to control the spolys
595*/
596int ksCheckCoeff(number *a, number *b);
597
598// old stuff
599KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether = NULL);
600KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether = NULL);
601KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether = NULL, ring r = currRing);
602KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r = currRing);
603
604/***************************************************************
605 *
606 * Routines related for ring changes during std computations
607 *
608 ***************************************************************/
609// return TRUE and set m1, m2 to k_GetLcmTerms,
610//             if spoly creation of strat->P does not violate
611//             exponent bound of strat->tailRing
612//      FALSE, otherwise
613BOOLEAN kCheckSpolyCreation(LObject* L, kStrategy strat, poly &m1, poly &m2);
614#ifdef HAVE_RINGS
615// return TRUE if gcdpoly creation of R[atR] and S[atS] does not violate
616//             exponent bound of strat->tailRing
617//      FALSE, otherwise
618BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat);
619#endif
620// change strat->tailRing and adjust all data in strat, L, and T:
621// new tailRing has larger exponent bound
622// do nothing and return FALSE if exponent bound increase would result in
623// larger exponent bound that that of currRing
624BOOLEAN kStratChangeTailRing(kStrategy strat,
625                             LObject* L = NULL, TObject* T = NULL,
626                             // take this as new_expbound: if 0
627                             // new expbound is 2*expbound of tailRing
628                             unsigned long new_expbound = 0);
629// initiate a change of the tailRing of strat -- should be called
630// right before main loop in bba
631void kStratInitChangeTailRing(kStrategy strat);
632
633KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k,
634  kStrategy strat);
635#include "kInline.cc"
636
637/* shiftgb stuff */
638#include "shiftgb.h"
639
640poly pMove2CurrTail(poly p, kStrategy strat);
641
642poly pMoveCurrTail2poly(poly p, kStrategy strat);
643
644poly pCopyL2p(LObject h, kStrategy strat);
645
646void enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV);
647
648void initBuchMoraShift (ideal F,ideal Q,kStrategy strat);
649
650void enterOnePairManyShifts (int i, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV); // ok
651
652void enterOnePairSelfShifts (poly qq, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int uptodeg, int lV);
653
654void enterOnePairShift (poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS, int uptodeg, int lV); // ok
655
656void enterpairsShift (poly h,int k,int ecart,int pos,kStrategy strat, int atR,int uptodeg, int lV);
657
658void initenterpairsShift (poly h,int k,int ecart,int isFromQ,kStrategy strat, int atR,int uptodeg, int lV); 
659
660void updateSShift(kStrategy strat,int uptodeg,int lV);
661
662void initBbaShift(ideal F,kStrategy strat);
663
664poly redtailBbaShift (LObject* L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize);
665
666int redFirstShift (LObject* h,kStrategy strat); // ok
667
668ideal freegb(ideal I, int uptodeg, int lVblock);
669
670ideal bbaShift(ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat, int uptodeg, int lV);
671#endif
Note: See TracBrowser for help on using the repository browser.