source: git/kernel/kutil.h @ f92547

spielwiese
Last change on this file since f92547 was f92547, checked in by Oliver Wienand <wienand@…>, 18 years ago
*oliver kspoly.cc: --> kscheckcoef * modified for zero divisors --> ksCreateShortSPoly * create correct short s poly for rings * in case of rings, also calculate coeff kstd2.cc: --> bba * use different enterpairs method in case of rings * small changes (replaced p_ISet by p_NSet) kutil.cc, kutil.h: --> new enterpairs derivate, also downstreams are new derivates of functions --> function to create extended s poly for rings --> nComp fct, will be nGreater later, maybe --> stub for chainCritRing polys.cc: --> chainCrit correct for rings, but not optimized numbers.cc, rmodulo2m.cc, rmodulo2m.h: --> gcd, ncd for zero divisor (att, not really a gcd or ncd) --> IntDiv (att, just takes a machine div, allows to divide by zero div) --> Greater (att, compares zero divisor exponent) git-svn-id: file:///usr/local/Singular/svn/trunk@9026 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 20.1 KB
Line 
1#ifndef KUTIL_H
2#define KUTIL_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: kutil.h,v 1.15 2006-03-20 20:33:57 wienand 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
166  poly  lcm;   /*- the lcm of p1,p2 -*/
167  poly last;   // pLast(p) during reductions
168  kBucket_pt bucket;
169  int   i_r1, i_r2;
170
171  // initialization
172  KINLINE void Init(ring tailRing = currRing);
173  KINLINE sLObject(ring tailRing = currRing);
174  KINLINE sLObject(poly p, ring tailRing = currRing);
175  KINLINE sLObject(poly p, ring c_r, ring tailRing);
176
177  // Frees the polys of L
178  KINLINE void Delete();
179  KINLINE void Clear();
180
181  // Iterations
182  KINLINE void LmDeleteAndIter();
183  KINLINE poly LmExtractAndIter();
184
185  // spoly related things
186  // preparation for reduction if not spoly
187  KINLINE void PrepareRed(BOOLEAN use_bucket);
188  KINLINE void SetLmTail(poly lm, poly new_p, int length,
189                         int use_bucket, ring r, poly last);
190  KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether);
191  KINLINE void Tail_Mult_nn(number n);
192  // deletes bucket, makes sure that p and t_p exists
193  KINLINE poly GetP(omBin lmBin = NULL);
194  // similar, except that only t_p exists
195  KINLINE poly GetTP();
196
197  // does not delete bucket, just canonicalizes it
198  // returned poly is such that Lm(p) \in currRing, Tail(p) \in tailRing
199  KINLINE poly CanonicalizeP();
200
201  // makes a copy of the poly of L
202  KINLINE void Copy();
203  // gets the poly and makes a copy of it
204  KINLINE poly CopyGetP();
205
206  KINLINE int GetpLength();
207  KINLINE long pLDeg(BOOLEAN use_last);
208  KINLINE long pLDeg();
209  KINLINE int SetLength(BOOLEAN lengt_pLength = FALSE);
210  KINLINE long SetDegStuffReturnLDeg();
211  KINLINE long SetDegStuffReturnLDeg(BOOLEAN use_last);
212
213  // returns minimal component of p
214  KINLINE long MinComp();
215  // returns component of p
216  KINLINE long Comp();
217
218  KINLINE void ShallowCopyDelete(ring new_tailRing,
219                                 pShallowCopyDeleteProc p_shallow_copy_delete);
220
221  // sets sev
222  KINLINE void SetShortExpVector();
223
224  // enable assignment from TObject
225  KINLINE sLObject& operator=(const sTObject&);
226
227  // get T's corresponding to p1, p2: they might return NULL
228  KINLINE TObject* T_1(const skStrategy* strat);
229  KINLINE TObject* T_2(const skStrategy* strat);
230  KINLINE void     T_1_2(const skStrategy* strat,
231                         TObject* &T_1, TObject* &T_2);
232
233  // simplify coefficients
234  KINLINE void Normalize();
235  KINLINE void HeadNormalize();
236};
237
238
239extern int HCord;
240
241class skStrategy;
242typedef skStrategy * kStrategy;
243class skStrategy
244{
245public:
246  kStrategy next;
247  int (*red)(LObject * L,kStrategy strat);
248  void (*initEcart)(LObject * L);
249  int (*posInT)(const TSet T,const int tl,LObject &h);
250  int (*posInL)(const LSet set, const int length,
251                LObject* L,const kStrategy strat);
252  void (*enterS)(LObject h, int pos,kStrategy strat, int atR/* =-1*/ );
253  void (*initEcartPair)(LObject * h, poly f, poly g, int ecartF, int ecartG);
254  int (*posInLOld)(const LSet Ls,const int Ll,
255                   LObject* Lo,const kStrategy strat);
256  pFDegProc pOrigFDeg;
257  pLDegProc pOrigLDeg;
258  pFDegProc pOrigFDeg_TailRing;
259  pLDegProc pOrigLDeg_TailRing;
260
261  LObject P;
262  ideal Shdl;
263  ideal D; /*V(S) is in D(D)*/
264  ideal M; /*set of minimal generators*/
265  polyset S;
266  intset ecartS;
267  intset lenS;
268  wlen_set lenSw; /* for tgb.ccc */
269  intset fromQ;
270  unsigned long* sevS;
271  unsigned long* sevT;
272  TSet T;
273  LSet L;
274  LSet    B;
275  poly    kHEdge;
276  poly    kNoether;
277  poly    t_kHEdge; // same polys in tailring
278  KINLINE poly    kNoetherTail();
279  poly    t_kNoether;
280  BOOLEAN * NotUsedAxis;
281  poly tail;
282  leftv kIdeal;
283  intvec * kModW;
284  intvec * kHomW;
285  // procedure for ShalloCopy from tailRing  to currRing
286  pShallowCopyDeleteProc p_shallow_copy_delete;
287  // pointers to Tobjects R[i] is ith Tobject which is generated
288  TObject**  R;
289  // S_2_R[i] yields Tobject which corresponds to S[i]
290  int*      S_2_R;
291  ring tailRing;
292  omBin lmBin;
293  omBin tailBin;
294#ifndef NDEBUG
295  int nr;
296#endif
297  int cp,c3;
298  int sl,mu;
299  int tl,tmax;
300  int Ll,Lmax;
301  int Bl,Bmax;
302  int ak,LazyDegree,LazyPass;
303  int syzComp;
304  int HCord;
305  int lastAxis;
306  int newIdeal;
307  int minim;
308  BOOLEAN interpt;
309  BOOLEAN homog;
310  BOOLEAN kHEdgeFound;
311  BOOLEAN honey,sugarCrit;
312  BOOLEAN Gebauer,noTailReduction;
313  BOOLEAN fromT;
314  BOOLEAN noetherSet;
315  BOOLEAN update;
316  BOOLEAN posInLOldFlag;
317  BOOLEAN use_buckets;
318  BOOLEAN interred_flag;
319  BOOLEAN *pairtest;/*used for enterOnePair*/
320  // if set, pLDeg(p, l) == (pFDeg(pLast(p), pLength)
321  BOOLEAN LDegLast;
322  // if set, then L.length == L.pLength
323  BOOLEAN length_pLength;
324  // if set, then posInL does not depend on L.length
325  BOOLEAN posInLDependsOnLength;
326  /*FALSE, if posInL == posInL10*/
327  char    redTailChange;
328  char    news;
329  char    newt;/*used for messageSets*/
330
331  skStrategy();
332  ~skStrategy();
333
334  // return TObject corresponding to S[i]: assume that it exists
335  // i.e. no error checking is done
336  KINLINE TObject* S_2_T(int i);
337  // like S_2_T, except that NULL is returned if it can not be found
338  KINLINE TObject* s_2_t(int i);
339};
340
341void deleteHC(poly *p, int *e, int *l, kStrategy strat);
342void deleteHC(LObject* L, kStrategy strat, BOOLEAN fromNext = FALSE);
343void deleteInS (int i,kStrategy strat);
344void cleanT (kStrategy strat);
345static inline LSet initL ()
346{ return (LSet)omAlloc(setmaxL*sizeof(LObject)); };
347void deleteInL(LSet set, int *length, int j,kStrategy strat);
348void enterL (LSet *set,int *length, int *LSetmax, LObject p,int at);
349void enterSBba (LObject p,int atS,kStrategy strat, int atR = -1);
350void initEcartPairBba (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
351void initEcartPairMora (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
352int posInS (kStrategy strat,int length,poly p, int ecart_p);
353int posInT0 (const TSet set,const int length,LObject &p);
354int posInT1 (const TSet set,const int length,LObject &p);
355int posInT2 (const TSet set,const int length,LObject &p);
356int posInT11 (const TSet set,const int length,LObject &p);
357int posInT110 (const TSet set,const int length,LObject &p);
358int posInT13 (const TSet set,const int length,LObject &p);
359int posInT15 (const TSet set,const int length,LObject &p);
360int posInT17 (const TSet set,const int length,LObject &p);
361int posInT19 (const TSet set,const int length,LObject &p);
362int posInT_EcartpLength(const TSet set,const int length,LObject &p);
363
364#ifdef HAVE_MORE_POS_IN_T
365int posInT_EcartFDegpLength(const TSet set,const int length,LObject &p);
366int posInT_FDegpLength(const TSet set,const int length,LObject &p);
367int posInT_pLength(const TSet set,const int length,LObject &p);
368#endif
369
370
371void reorderS (int* suc,kStrategy strat);
372int posInL0 (const LSet set, const int length,
373             LObject* L,const kStrategy strat);
374int posInL11 (const LSet set, const int length,
375             LObject* L,const kStrategy strat);
376int posInL13 (const LSet set, const int length,
377             LObject* L,const kStrategy strat);
378int posInL15 (const LSet set, const int length,
379             LObject* L,const kStrategy strat);
380int posInL17 (const LSet set, const int length,
381             LObject* L,const kStrategy strat);
382int posInL10 (const LSet set, const int length,
383             LObject* L,const kStrategy strat);
384KINLINE poly redtailBba (poly p,int pos,kStrategy strat);
385poly redtailBba (LObject *L, int pos,kStrategy strat, BOOLEAN withT = FALSE);
386poly redtailBba (TObject *T, int pos,kStrategy strat, BOOLEAN withT = FALSE);
387poly redtail (poly p,int pos,kStrategy strat);
388poly redtail (LObject *L,int pos,kStrategy strat);
389poly redNF (poly h,kStrategy strat);
390int redNF0 (LObject *P,kStrategy strat);
391poly redNFTail (poly h,const int sl,kStrategy strat);
392int redHoney (LObject* h, kStrategy strat);
393#ifdef HAVE_RING2TOM
394int redRing2toM (LObject* h,kStrategy strat);
395long twoPow(long arg);
396void enterExtendedSpoly(poly h,kStrategy strat);
397void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR = -1);
398#endif
399int redLazy (LObject* h,kStrategy strat);
400int redHomog (LObject* h,kStrategy strat);
401void enterpairs (poly h, int k, int ec, int pos,kStrategy strat, int atR = -1);
402void entersets (LObject h);
403void pairs ();
404void message (int i,int* reduc,int* olddeg,kStrategy strat,int red_result);
405void messageStat (int srmax,int lrmax,int hilbcount,kStrategy strat);
406#ifdef KDEBUG
407void messageSets (kStrategy strat);
408#else
409#define messageSets(s)  ((void) 0)
410#endif
411
412void initEcartNormal (LObject* h);
413void initEcartBBA (LObject* h);
414void initS (ideal F, ideal Q,kStrategy strat);
415void initSL (ideal F, ideal Q,kStrategy strat);
416void updateS(BOOLEAN toT,kStrategy strat);
417void enterT (LObject p,kStrategy strat, int atT = -1);
418void cancelunit (LObject* p);
419void HEckeTest (poly pp,kStrategy strat);
420void initBuchMoraCrit(kStrategy strat);
421void initHilbCrit(ideal F, ideal Q, intvec **hilb,kStrategy strat);
422void initBuchMoraPos(kStrategy strat);
423void initBuchMora (ideal F, ideal Q,kStrategy strat);
424void exitBuchMora (kStrategy strat);
425void updateResult(ideal r,ideal Q,kStrategy strat);
426void completeReduce (kStrategy strat);
427void kFreeStrat(kStrategy strat);
428BOOLEAN homogTest(polyset F, int Fmax);
429BOOLEAN newHEdge(polyset S, kStrategy strat);
430// returns index of p in TSet, or -1 if not found
431int kFindInT(poly p, TSet T, int tlength);
432
433// return -1 if no divisor is found
434//        number of first divisor, otherwise
435int kFindDivisibleByInT(const TSet &T, const unsigned long* sevT,
436                        const int tl, const LObject* L, const int start=0);
437// same with S
438int kFindDivisibleByInS(const polyset &S, const unsigned long* sev,
439                        const int sl, LObject* L);
440
441TObject*
442kFindDivisibleByInS(kStrategy strat, int pos, LObject* L, TObject *T,
443                    long ecart = LONG_MAX);
444
445/*Obsolete since changes to pLmDiv
446#ifdef HAVE_RING2TOM
447// same for rings
448int kRingFindDivisibleByInT(const TSet &T, const unsigned long* sevT,
449                        const int tl, const LObject* L, const int start=0);
450int kRingFindDivisibleByInS(const polyset &S, const unsigned long* sev,
451                        const int sl, LObject* L);
452
453
454TObject*
455kRingFindDivisibleByInS(kStrategy strat, int pos, LObject* L, TObject *T,
456                    long ecart = LONG_MAX);
457#endif
458*/
459/***************************************************************
460 *
461 * stuff to be inlined
462 *
463 ***************************************************************/
464
465KINLINE TSet initT ();
466KINLINE TObject** initR();
467KINLINE unsigned long* initsevT();
468KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin bin);
469KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing, omBin bin);
470KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin bin);
471KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing,  omBin bin);
472
473KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing);
474KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing);
475KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing);
476KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing);
477
478// if exp bound is not violated, return TRUE and
479//                               get m1 = LCM(LM(p1), LM(p2))/LM(p1)
480//                                   m2 = LCM(LM(p1), LM(p2))/LM(p2)
481// return FALSE and m1 == NULL, m2 == NULL     , otherwise
482KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r,
483                               poly &m1, poly &m2, const ring m_r);
484#ifdef KDEBUG
485// test strat
486BOOLEAN kTest(kStrategy strat);
487// test strat, and test that S is contained in T
488BOOLEAN kTest_TS(kStrategy strat);
489// test LObject
490BOOLEAN kTest_L(LObject* L, ring tailRing = NULL,
491                 BOOLEAN testp = FALSE, int lpos = -1,
492                 TSet T = NULL, int tlength = -1);
493// test TObject
494BOOLEAN kTest_T(TObject* T, ring tailRing = NULL, int tpos = -1, char TN = '?');
495// test set strat->SevS
496BOOLEAN kTest_S(kStrategy strat);
497#else
498#define kTest(A)        ((void)0)
499#define kTest_TS(A)     ((void)0)
500#define kTest_T(T)      ((void)0)
501#define kTest_S(T)      ((void)0)
502#define kTest_L(T)      ((void)0)
503#endif
504
505
506/***************************************************************
507 *
508 * From kstd2.cc
509 *
510 ***************************************************************/
511poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing);
512ideal bba (ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat);
513poly kNF2 (ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce);
514ideal kNF2 (ideal F,ideal Q,ideal q, kStrategy strat, int lazyReduce);
515void initBba(ideal F,kStrategy strat);
516
517/***************************************************************
518 *
519 * From kSpolys.cc
520 *
521 ***************************************************************/
522// Reduces PR with PW
523// Assumes PR != NULL, PW != NULL, Lm(PW) divides Lm(PR)
524// Changes: PR
525// Const:   PW
526// If coef != NULL, then *coef is a/gcd(a,b), where a = LC(PR), b = LC(PW)
527// If strat != NULL, tailRing is changed if reduction would violate exp bound
528// of tailRing
529// Returns: 0 everything ok, no tailRing change
530//          1 tailRing has successfully changed (strat != NULL)
531//          2 no reduction performed, tailRing needs to be changed first
532//            (strat == NULL)
533//         -1 tailRing change could not be performed due to exceeding exp
534//            bound of currRing
535int ksReducePoly(LObject* PR,
536                 TObject* PW,
537                 poly spNoether = NULL,
538                 number *coef = NULL,
539                 kStrategy strat = NULL);
540
541#ifdef HAVE_RING2TOM
542// same for rings
543int ksRingReducePoly(LObject* PR,
544                 TObject* PW,
545                 poly spNoether = NULL,
546                 number *coef = NULL,
547                 kStrategy strat = NULL);
548#endif
549
550// Reduces PR at Current->next with PW
551// Assumes PR != NULL, Current contained in PR
552//         Current->next != NULL, LM(PW) devides LM(Current->next)
553// Changes: PR
554// Const:   PW
555// Return: see ksReducePoly
556int ksReducePolyTail(LObject* PR,
557                     TObject* PW,
558                     poly Current,
559                     poly spNoether = NULL);
560
561KINLINE int ksReducePolyTail(LObject* PR, TObject* PW, LObject* Red);
562
563// Creates S-Poly of Pair
564// Const:   Pair->p1, Pair->p2
565// Changes: Pair->p == S-Poly of p1, p2
566// Assume:  Pair->p1 != NULL && Pair->p2
567void ksCreateSpoly(LObject* Pair, poly spNoether = NULL,
568                   int use_buckets=0, ring tailRing=currRing,
569                   poly m1 = NULL, poly m2 = NULL, TObject** R = NULL);
570
571/*2
572* creates the leading term of the S-polynomial of p1 and p2
573* do not destroy p1 and p2
574* remarks:
575*   1. the coefficient is 0 (nNew)
576*   2. pNext is undefined
577*/
578poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing);
579
580
581/*
582* input - output: a, b
583* returns:
584*   a := a/gcd(a,b), b := b/gcd(a,b)
585*   and return value
586*       0  ->  a != 1,  b != 1
587*       1  ->  a == 1,  b != 1
588*       2  ->  a != 1,  b == 1
589*       3  ->  a == 1,  b == 1
590*   this value is used to control the spolys
591*/
592int ksCheckCoeff(number *a, number *b);
593
594// old stuff
595KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether = NULL);
596KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether = NULL);
597KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether = NULL, ring r = currRing);
598KINLINE void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r = currRing);
599
600/***************************************************************
601 *
602 * Routines related for ring changes during std computations
603 *
604 ***************************************************************/
605// return TRUE and set m1, m2 to k_GetLcmTerms,
606//             if spoly creation of strat->P does not violate
607//             exponent bound of strat->tailRing
608//      FALSE, otherwise
609BOOLEAN kCheckSpolyCreation(LObject* L, kStrategy strat, poly &m1, poly &m2);
610// change strat->tailRing and adjust all data in strat, L, and T:
611// new tailRing has larger exponent bound
612// do nothing and return FALSE if exponent bound increase would result in
613// larger exponent bound that that of currRing
614BOOLEAN kStratChangeTailRing(kStrategy strat,
615                             LObject* L = NULL, TObject* T = NULL,
616                             // take this as new_expbound: if 0
617                             // new expbound is 2*expbound of tailRing
618                             unsigned long new_expbound = 0);
619// initiate a change of the tailRing of strat -- should be called
620// right before main loop in bba
621void kStratInitChangeTailRing(kStrategy strat);
622
623#include "kInline.cc"
624
625
626#endif
Note: See TracBrowser for help on using the repository browser.