My Project  debian-1:4.1.2-p1+ds-2
kInline.h
Go to the documentation of this file.
1 /****************************************
2 * Computer Algebra System SINGULAR *
3 ****************************************/
4 /***************************************************************
5  * File: kInline.h
6  * Purpose: implementation of std related inline routines
7  * Author: obachman (Olaf Bachmann)
8  * Created: 8/00
9  *******************************************************************/
10 #ifndef KINLINE_H
11 #define KINLINE_H
12 
13 #if !defined(NO_KINLINE) || defined(KUTIL_CC)
14 /* this file is a header file with inline routines,
15  * if NO_KINLINE is not defined (AND ONLY THEN!)
16  * otherwise it is an part of kutil.cc and a source file!
17  * (remark: NO_KINLINE is defined by KDEBUG, i.e. in the debug version)
18  */
19 
20 #include "omalloc/omalloc.h"
21 #include "misc/options.h"
23 #include "polys/kbuckets.h"
24 
25 #include "kernel/polys.h"
26 
27 #ifdef HAVE_SHIFTBBA
28 #include "polys/shiftop.h"
29 #endif
30 
31 
32 #define HAVE_TAIL_BIN
33 // This doesn't really work, fixme, if necessary
34 // #define HAVE_LM_BIN
35 
36 
37 
39 {
40  assume(i>= 0 && i<=sl);
41  assume(S_2_R[i] >= 0 && S_2_R[i] <= tl);
42  TObject* TT = R[S_2_R[i]];
43  assume(TT != NULL && TT->p == S[i]);
44  return TT;
45 }
46 
48 {
49  if (i >= 0 && i <= sl)
50  {
51  int sri= S_2_R[i];
52  if ((sri >= 0) && (sri <= tl))
53  {
54  TObject* t = R[sri];
55  if ((t != NULL) && (t->p == S[i]))
56  return t;
57  }
58  // last but not least, try kFindInT
59  sri = kFindInT(S[i], T, tl);
60  if (sri >= 0)
61  return &(T[sri]);
62  }
63  return NULL;
64 }
65 
67 {
68  if (tailRing == currRing)
69  return kNoether;
70  else
71  {
72  assume((kNoether == NULL && t_kNoether == NULL) ||
73  (kNoether != NULL && t_kNoether != NULL));
74  return t_kNoether;
75  }
76 }
77 
78 /***************************************************************
79  *
80  * Operation on TObjects
81  *
82  ***************************************************************/
83 
85 {
86  TSet T = (TSet)omAlloc0(setmaxT*sizeof(TObject));
87  for (int i=setmaxT-1; i>=0; i--)
88  {
89  T[i].tailRing = currRing;
90  T[i].i_r = -1;
91  }
92  return T;
93 }
94 
96 {
97  return (TObject**) omAlloc0(setmaxT*sizeof(TObject*));
98 }
99 
100 KINLINE unsigned long* initsevT()
101 {
102  return (unsigned long*) omAlloc0(setmaxT*sizeof(unsigned long));
103 }
104 
105 // initialization
106 KINLINE void sTObject::Set(ring r)
107 {
108  tailRing = r;
109 }
110 KINLINE void sTObject::Init(ring r)
111 {
112  memset(this, 0, sizeof(sTObject));
113  i_r = -1;
114  Set(r);
115 }
117 {
118  Init(r);
119 }
120 KINLINE void sTObject::Set(poly p_in, ring r)
121 {
122  if (r != currRing)
123  {
124  assume(r == tailRing);
125 #ifdef HAVE_SHIFTBBA
126  if (r->isLPring)
127  {
128  shift = si_max(p_mFirstVblock(p_in, r) - 1, 0);
129  if (!shift) p_Test(p_in, r);
130  }
131  else
132 #endif
133  {
134  p_Test(p_in, r);
135  }
136  t_p = p_in;
137  }
138  else
139  {
140 #ifdef HAVE_SHIFTBBA
141  if (currRing->isLPring)
142  {
143  shift = si_max(p_mFirstVblock(p_in, currRing) - 1, 0);
144  if (!shift) p_Test(p_in, currRing);
145  }
146  else
147 #endif
148  {
149  p_Test(p_in, currRing);
150  }
151  p = p_in;
152  }
153  pLength=::pLength(p_in);
154 }
155 
156 KINLINE sTObject::sTObject(poly p_in, ring r)
157 {
158  Init(r);
159  Set(p_in, r);
160 }
161 
162 KINLINE void sTObject::Set(poly p_in, ring c_r, ring t_r)
163 {
164  if (c_r != t_r)
165  {
166  assume(c_r == currRing && t_r == tailRing);
167 #ifdef HAVE_SHIFTBBA
168  if (c_r->isLPring)
169  {
170  shift = si_max(p_mFirstVblock(p_in, c_r) - 1, 0);
171  if (!shift) p_Test(p_in, currRing);
172  }
173  else
174 #endif
175  {
176  p_Test(p_in, currRing);
177  }
178  p = p_in;
179  pLength=::pLength(p_in);
180  }
181  else
182  {
183  Set(p_in, c_r);
184  }
185 }
186 
187 KINLINE sTObject::sTObject(poly p_in, ring c_r, ring t_r)
188 {
189  Init(t_r);
190  Set(p_in, c_r, t_r);
191 }
192 
194 {
195  *this = *T;
196  if (copy)
197  {
198  if (t_p != NULL)
199  {
200  t_p = p_Copy(t_p, tailRing);
202  }
203  else
204  {
205  p = p_Copy(p, currRing);
206  }
207  }
208 }
209 
211 {
212  if (t_p != NULL)
213  {
214  p_Delete(&t_p, tailRing);
215  if (p != NULL)
216  p_LmFree(p, currRing);
217  }
218  else
219  {
220  p_Delete(&p, currRing);
221  }
222 }
223 
225 {
226  p = NULL;
227  t_p = NULL;
228  ecart = 0;
229  length = 0;
230  pLength = 0;
231  FDeg = 0;
233 }
234 
235 KINLINE void sTObject::Copy()
236 {
237  if (t_p != NULL)
238  {
239  t_p = p_Copy(t_p, tailRing);
240  if (p != NULL) /* and t_p!=NULL*/
241  {
242  p = p_LmInit(p, currRing);
244  pNext(p) = pNext(t_p);
245  }
246  }
247  else
248  {
249  p = p_Copy(p, currRing);
250  }
251 }
252 
254 {
255  if (p == NULL && t_p != NULL)
257 
258  return p;
259 }
261 {
262  if (t_p == NULL)
263  {
264  if (p != NULL && tailRing != currRing)
265  {
267  return t_p;
268  }
269  return p;
270  }
271  return t_p;
272 }
273 KINLINE poly sTObject::GetLm(ring r)
274 {
275  assume(r == tailRing || r == currRing);
276  if (r == currRing)
277  return GetLmCurrRing();
278 
279  if (t_p == NULL && p != NULL)
281 
282  return t_p;
283 }
284 
285 KINLINE void sTObject::GetLm(poly &p_r, ring &r_r) const
286 {
287  if (t_p != NULL)
288  {
289  p_r = t_p;
290  r_r = tailRing;
291  }
292  else
293  {
294  p_r = p;
295  r_r = currRing;
296  }
297 }
298 
300 {
301  return (p == NULL && t_p == NULL);
302 }
303 
305 {
306  if (pLength <= 0) pLength = ::pLength(p != NULL ? p : t_p);
307  return pLength;
308 }
309 
311 {
312  if (p == NULL && t_p != NULL)
314 }
315 
316 KINLINE poly sTObject::Next()
317 {
318  assume(p != NULL || t_p != NULL);
319  if (t_p != NULL) return pNext(t_p);
320  return pNext(p);
321 }
322 
323 // Iterations
325 {
326  assume(p != NULL || t_p != NULL);
327  if (t_p != NULL)
328  {
330  if (p != NULL)
331  {
332  p_LmFree(p, currRing);
333  p = NULL;
334  }
335  }
336  else
337  {
339  }
341 }
342 
343 
344 // arithmetic
345 KINLINE void sTObject::Mult_nn(number n)
346 {
347  if (t_p != NULL)
348  {
349  t_p = p_Mult_nn(t_p, n, tailRing);
350  if (p != NULL) pSetCoeff0(p, pGetCoeff(t_p));
351  }
352  else
353  {
354  p = p_Mult_nn(p, n, currRing, tailRing);
355  }
356 }
357 
359 {
360  if (t_p != NULL)
361  {
362  pNormalize(t_p);
363  if (p != NULL) pSetCoeff0(p, pGetCoeff(t_p));
364  }
365  else
366  {
367  pNormalize(p);
368  }
370 }
371 
373 {
374  if (bucket != NULL)
376 }
377 
379 {
380  if (t_p != NULL)
381  {
383  if (p != NULL) pSetCoeff0(p, pGetCoeff(t_p));
384  }
385  else
386  {
388  }
389 }
390 
392 sTObject::ShallowCopyDelete(ring new_tailRing, omBin new_tailBin,
393  pShallowCopyDeleteProc p_shallow_copy_delete,
394  BOOLEAN set_max)
395 {
396  if (new_tailBin == NULL) new_tailBin = new_tailRing->PolyBin;
397  if (t_p != NULL)
398  {
399  t_p = p_shallow_copy_delete(t_p, tailRing, new_tailRing, new_tailBin);
400  if (p != NULL)
401  pNext(p) = pNext(t_p);
402  if (new_tailRing == currRing)
403  {
404  if (p == NULL) p = t_p;
405  else p_LmFree(t_p, tailRing);
406  t_p = NULL;
407  }
408  }
409  else if (p != NULL) /* && t_p==NULL */
410  {
411  if (pNext(p) != NULL)
412  {
413  pNext(p) = p_shallow_copy_delete(pNext(p),
414  tailRing, new_tailRing, new_tailBin);
415  }
416  if (new_tailRing != currRing)
417  {
418  t_p = k_LmInit_currRing_2_tailRing(p, new_tailRing);
419  pNext(t_p) = pNext(p);
420  }
421  }
422  if (max_exp != NULL)
423  {
424  max_exp = p_shallow_copy_delete(max_exp,tailRing,new_tailRing,new_tailBin);
425  }
426  else if (set_max && pNext(t_p) != NULL)
427  {
428  max_exp = p_GetMaxExpP(pNext(t_p), new_tailRing);
429  }
430  tailRing = new_tailRing;
431 }
432 
433 KINLINE long sTObject::pFDeg() const
434 {
435  if (p != NULL) return p_FDeg(p, currRing);
436  return tailRing->pFDeg(t_p, tailRing);
437 }
438 KINLINE long sTObject::pTotalDeg() const
439 {
440  if (p != NULL) return p_Totaldegree(p, currRing);
441  return p_Totaldegree(t_p,tailRing);
442 }
444 {
445  FDeg = this->pFDeg();
446  return FDeg;
447 }
448 KINLINE long sTObject::GetpFDeg() const
449 {
450  assume(FDeg == this->pFDeg());
451  return FDeg;
452 }
454 {
455  return tailRing->pLDeg(GetLmTailRing(), &length, tailRing);
456 }
458 {
459  FDeg = this->pFDeg();
460  long d = this->pLDeg();
461  ecart = d - FDeg;
462  return d;
463 }
464 
465 //extern void pCleardenom(poly p);
466 // extern void pNorm(poly p);
467 
468 // manipulations
470 {
471  assume(p != NULL);
472  if (TEST_OPT_CONTENTSB)
473  {
474  number n;
475  if (t_p != NULL)
476  {
479  }
480  else
481  {
483  }
484  if (!nIsOne(n))
485  {
487  denom->n=nInvers(n);
488  denom->next=DENOMINATOR_LIST;
489  DENOMINATOR_LIST=denom;
490  }
491  nDelete(&n);
492  }
493  else
494  {
495  if (t_p != NULL)
496  {
499  }
500  else
501  {
503  }
504  }
505 }
506 
507 KINLINE void sTObject::pNorm() // pNorm seems to be a _bad_ method name...
508 {
509  assume(p != NULL);
510  if (! is_normalized)
511  {
512  p_Norm(p, currRing);
513  if (t_p != NULL)
516  }
517 }
518 
519 
520 
521 /***************************************************************
522  *
523  * Operation on LObjects
524  *
525  ***************************************************************/
526 // Initialization
528 {
529  sTObject::Clear();
530  sev = 0;
531 }
532 // Initialization
534 {
536  if (bucket != NULL)
538 }
539 
540 KINLINE void sLObject::Init(ring r)
541 {
542  memset(this, 0, sizeof(sLObject));
543  i_r1 = -1;
544  i_r2 = -1;
545  i_r = -1;
546  Set(r);
547 }
549 {
550  Init(r);
551 }
552 KINLINE sLObject::sLObject(poly p_in, ring r)
553 {
554  Init(r);
555  Set(p_in, r);
556 }
557 
558 KINLINE sLObject::sLObject(poly p_in, ring c_r, ring t_r)
559 {
560  Init(t_r);
561  Set(p_in, c_r, t_r);
562 }
563 
564 KINLINE void sLObject::PrepareRed(BOOLEAN use_bucket)
565 {
566  if (bucket == NULL)
567  {
568  unsigned l = GetpLength();
569  if (use_bucket && (l > 1))
570  {
571  poly tp = GetLmTailRing();
572  assume(l == ::pLength(tp));
574  kBucketInit(bucket, pNext(tp), l-1);
575  pNext(tp) = NULL;
576  if (p != NULL) pNext(p) = NULL;
577  pLength = 0;
578  }
579  }
580 }
581 
582 KINLINE void sLObject::SetLmTail(poly lm, poly p_tail, int p_Length, int use_bucket, ring _tailRing)
583 {
584 
585  Set(lm, _tailRing);
586  if (use_bucket)
587  {
588  bucket = kBucketCreate(_tailRing);
589  kBucketInit(bucket, p_tail, p_Length);
590  pNext(lm) = NULL;
591  pLength = 0;
592  }
593  else
594  {
595  pNext(lm) = p_tail;
596  pLength = p_Length + 1;
597  }
598 }
599 
600 KINLINE void sLObject::Tail_Mult_nn(number n)
601 {
602  if (bucket != NULL)
603  {
605  }
606  else
607  {
608  poly _p = (t_p != NULL ? t_p : p);
609  assume(_p != NULL);
610  pNext(_p) = __p_Mult_nn(pNext(_p), n, tailRing);
611  }
612 }
613 
614 KINLINE void sLObject::Tail_Minus_mm_Mult_qq(poly m, poly q, int lq,
615  poly spNoether)
616 {
617  if (bucket != NULL)
618  {
619  kBucket_Minus_m_Mult_p(bucket, m, q, &lq, spNoether);
620  }
621  else
622  {
623  if (lq<=0) lq= ::pLength(q);
624  poly _p = (t_p != NULL ? t_p : p);
625  assume(_p != NULL);
626 
627  int lp=pLength-1;
628  pNext(_p) = p_Minus_mm_Mult_qq( pNext(_p), m, q, lp, lq,
629  spNoether, tailRing );
630  pLength=lp+1;
631 // tailRing->p_Procs->p_Minus_mm_Mult_qq(pNext(_p), m, q, shorter,spNoether, tailRing, last);
632 // pLength += lq - shorter;
633  }
634 }
635 
637 {
639  if (bucket != NULL)
640  {
641  poly _p = kBucketExtractLm(bucket);
642  if (_p == NULL)
643  {
645  p = t_p = NULL;
646  return;
647  }
648  Set(_p, tailRing);
649  }
650  else
651  {
652  pLength--;
653  }
654 }
655 
657 {
658  poly ret = GetLmTailRing();
659  poly pn;
660 
661  assume(p != NULL || t_p != NULL);
662 
663  if (bucket != NULL)
664  {
665  pn = kBucketExtractLm(bucket);
666  if (pn == NULL)
668  }
669  else
670  {
671  pn = pNext(ret);
672  }
673  pLength--;
674  pNext(ret) = NULL;
675  if (p != NULL && t_p != NULL)
676  p_LmFree(p, currRing);
677 
678  Set(pn, tailRing);
679  return ret;
680 }
681 
683 {
684  //kTest_L(this);
685  poly tp = GetLmTailRing();
686  assume(tp != NULL);
687 
688  if (bucket != NULL)
689  {
690  kBucketClear(bucket, &pNext(tp), &pLength);
692  pLength++;
693  }
694  return tp;
695 }
696 
697 
698 KINLINE poly sLObject::GetP(omBin lmBin)
699 {
700  //kTest_L(this);
701  if (p == NULL)
702  {
704  (lmBin!=NULL?lmBin:currRing->PolyBin));
705  FDeg = pFDeg();
706  }
707  else if (lmBin != NULL && lmBin != currRing->PolyBin)
708  {
710  FDeg = pFDeg();
711  }
712 
713  if (bucket != NULL)
714  {
717  pLength++;
718  if (t_p != NULL) pNext(t_p) = pNext(p);
719  }
720  //kTest_L(this);
721  return p;
722 }
723 
724 KINLINE void
725 sLObject::ShallowCopyDelete(ring new_tailRing,
726  pShallowCopyDeleteProc p_shallow_copy_delete)
727 {
728  if (bucket != NULL)
729  kBucketShallowCopyDelete(bucket, new_tailRing, new_tailRing->PolyBin,
730  p_shallow_copy_delete);
731  sTObject::ShallowCopyDelete(new_tailRing,
732  new_tailRing->PolyBin,p_shallow_copy_delete,
733  FALSE);
734 }
735 
737 {
738  if (t_p != NULL)
739  {
741  }
742  else
743  {
745  }
746 }
747 
748 KINLINE void sLObject::Copy()
749 {
750  if (bucket != NULL)
751  {
753  kBucket_pt new_bucket = kBucketCreate(tailRing);
754  kBucketInit(new_bucket,
755  p_Copy(bucket->buckets[i], tailRing),
756  bucket->buckets_length[i]);
757  bucket = new_bucket;
758  if (t_p != NULL) pNext(t_p) = NULL;
759  if (p != NULL) pNext(p) = NULL;
760  }
761  TObject::Copy();
762 }
763 
765 {
766  poly tp = GetLmTailRing();
767  assume(tp != NULL);
768  if (bucket != NULL)
769  {
771  pNext(tp) = bucket->buckets[i];
772  long ldeg = tailRing->pLDeg(tp, &length, tailRing);
773  pNext(tp) = NULL;
774  return ldeg;
775  }
776  else
777  return tailRing->pLDeg(tp, &length, tailRing);
778 }
779 KINLINE long sLObject::pLDeg(BOOLEAN deg_last)
780 {
781  if (! deg_last || bucket != NULL) return sLObject::pLDeg();
782 
783  long ldeg;
784  ldeg = tailRing->pLDeg(GetLmTailRing(), &length, tailRing);
785 #ifndef SING_NDEBUG
786  if ( pLength == 0)
789 #else
790  pLength=length;
791 #endif
792  return ldeg;
793 }
794 
796 {
797  FDeg = this->pFDeg();
798  long d = this->pLDeg();
799  ecart = d - FDeg;
800  return d;
801 }
803 {
804  FDeg = this->pFDeg();
805  long d = this->pLDeg(use_last);
806  ecart = d - FDeg;
807  return d;
808 }
810 {
811  if (bucket == NULL)
812  return sTObject::GetpLength();
814  return bucket->buckets_length[i] + 1;
815 }
816 KINLINE int sLObject::SetLength(BOOLEAN length_pLength)
817 {
818  if (length_pLength)
819  {
820  length = this->GetpLength();
821  }
822  else
823  this->pLDeg();
824  return length;
825 }
827 {
828  poly tp = GetLmTailRing();
829  assume(tp != NULL);
830  if (bucket != NULL)
831  {
833  pNext(tp) = bucket->buckets[i];
834  long m = p_MinComp(tp, tailRing);
835  pNext(tp) = NULL;
836  return m;
837  }
838  else
839  return p_MinComp(tp, tailRing);
840 }
841 KINLINE long sLObject::Comp()
842 {
843  poly pp;
844  ring r;
845  GetLm(pp, r);
846  assume(pp != NULL);
847  return p_GetComp(pp, r);
848 }
849 
851 {
852  memset(this, 0, sizeof(*this));
853  memcpy(this, &t, sizeof(sTObject));
854  return *this;
855 }
856 
858 {
859  if (p1 == NULL) return NULL;
860  if (i_r1 == -1) i_r1 = kFindInT(p1, s->T, s->tl);
861  assume(i_r1 >= 0 && i_r1 <= s->tl);
862  TObject* T = s->R[i_r1];
863  assume(T->p == p1);
864  return T;
865 }
866 
868 {
869  if (p1 == NULL) return NULL;
870  assume(p2 != NULL);
871  if (i_r2 == -1) i_r2 = kFindInT(p2, strat->T, strat->tl);
872  assume(i_r2 >= 0 && i_r2 <= strat->tl);
873  TObject* T = strat->R[i_r2];
874  assume(T->p == p2);
875  return T;
876 }
877 
878 KINLINE void sLObject::T_1_2(const skStrategy* strat,
879  TObject* &T_1, TObject* &T_2)
880 {
881  if (p1 == NULL)
882  {
883  T_1 = NULL;
884  T_2 = NULL;
885  return;
886  }
887  assume(p1 != NULL && p2 != NULL);
888  if (i_r1 == -1) i_r1 = kFindInT(p1, strat->T, strat->tl);
889  if (i_r2 == -1) i_r2 = kFindInT(p2, strat->T, strat->tl);
890  assume(i_r1 >= 0 && i_r1 <= strat->tl);
891  assume(i_r2 >= 0 && i_r2 <= strat->tl);
892  T_1 = strat->R[i_r1];
893  T_2 = strat->R[i_r2];
894  assume(T_1->p == p1);
895  assume(T_2->p == p2);
896  return;
897 }
898 
899 /***************************************************************
900  *
901  * Conversion of polys
902  *
903  ***************************************************************/
904 
905 KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
906 {
907 
908  poly t_p = p_LmInit(p, currRing, tailRing, tailBin);
909  pNext(t_p) = pNext(p);
910  pSetCoeff0(t_p, pGetCoeff(p));
911  return t_p;
912 }
913 
914 KINLINE poly k_LmInit_tailRing_2_currRing(poly t_p, ring tailRing, omBin lmBin)
915 {
916  poly p = p_LmInit(t_p, tailRing, currRing, lmBin);
917  pNext(p) = pNext(t_p);
918  pSetCoeff0(p, pGetCoeff(t_p));
919  return p;
920 }
921 
922 // this should be made more efficient
923 KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
924 {
925  poly np = k_LmInit_currRing_2_tailRing(p, tailRing, tailBin);
926  p_LmFree(p, currRing);
927  return np;
928 }
929 
930 KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin lmBin)
931 {
932  poly np = k_LmInit_tailRing_2_currRing(p, tailRing, lmBin);
933  p_LmFree(p, tailRing);
934  return np;
935 }
936 
937 KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing)
938 {
939  return k_LmInit_currRing_2_tailRing(p, tailRing, tailRing->PolyBin);
940 }
941 
942 KINLINE poly k_LmInit_tailRing_2_currRing(poly p, ring tailRing)
943 {
944  return k_LmInit_tailRing_2_currRing(p, tailRing, currRing->PolyBin);
945 }
946 
947 KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing)
948 {
949  return k_LmShallowCopyDelete_currRing_2_tailRing(p, tailRing, tailRing->PolyBin);
950 }
951 
952 KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing)
953 {
954  return k_LmShallowCopyDelete_tailRing_2_currRing(p, tailRing, currRing->PolyBin);
955 }
956 
957 /***************************************************************
958  *
959  * Lcm business
960  *
961  ***************************************************************/
962 // get m1 = LCM(LM(p1), LM(p2))/LM(p1)
963 // m2 = LCM(LM(p1), LM(p2))/LM(p2)
964 KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r,
965  poly &m1, poly &m2, const ring m_r)
966 {
967  p_LmCheckPolyRing(p1, p_r);
968  p_LmCheckPolyRing(p2, p_r);
969 
970  int i;
971  long x;
972  m1 = p_Init(m_r,m_r->PolyBin);
973  m2 = p_Init(m_r,m_r->PolyBin);
974 
975  for (i = p_r->N; i; i--)
976  {
977  x = p_GetExpDiff(p1, p2, i, p_r);
978  if (x > 0)
979  {
980  if (x > (long) m_r->bitmask) goto false_return;
981  p_SetExp(m2,i,x, m_r);
982  p_SetExp(m1,i,0, m_r);
983  }
984  else
985  {
986  if (-x > (long) m_r->bitmask) goto false_return;
987  p_SetExp(m1,i,-x, m_r);
988  p_SetExp(m2,i,0, m_r);
989  }
990  }
991 
992  p_Setm(m1, m_r);
993  p_Setm(m2, m_r);
994  return TRUE;
995 
996  false_return:
997  p_LmFree(m1, m_r);
998  p_LmFree(m2, m_r);
999  m1 = m2 = NULL;
1000  return FALSE;
1001 }
1002 
1003 #ifdef HAVE_RINGS
1004 // get m1 = LCM(LM(p1), LM(p2))/LM(p1)
1005 // m2 = LCM(LM(p1), LM(p2))/LM(p2) in tailRing
1006 // lcm = LCM(LM(p1), LM(p2)) in leadRing
1007 KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing,
1008  poly &m1, poly &m2, poly &lcm, const ring tailRing)
1009 {
1010  p_LmCheckPolyRing(p1, leadRing);
1011  p_LmCheckPolyRing(p2, leadRing);
1012 
1013  int i;
1014  int x;
1015  int e1;
1016  int e2;
1017  int s;
1018  m1 = p_Init(tailRing,tailRing->PolyBin);
1019  m2 = p_Init(tailRing,tailRing->PolyBin);
1020  lcm = p_Init(leadRing,leadRing->PolyBin);
1021 
1022  for (i = leadRing->N; i>=0; i--)
1023  {
1024  e1 = p_GetExp(p1,i,leadRing);
1025  e2 = p_GetExp(p2,i,leadRing);
1026  x = e1 - e2;
1027  if (x > 0)
1028  {
1029  p_SetExp(m2,i,x, tailRing);
1030  //p_SetExp(m1,i,0, tailRing); // done by p_Init
1031  s = e1;
1032  }
1033  else if (x<0)
1034  {
1035  p_SetExp(m1,i,-x, tailRing);
1036  //p_SetExp(m2,i,0, tailRing); // done by p_Init
1037  s = e2;
1038  }
1039  else
1040  s = e1; // e1==e2
1041  p_SetExp(lcm,i,s, leadRing);
1042  }
1043 
1044  p_Setm(m1, tailRing);
1045  p_Setm(m2, tailRing);
1046  p_Setm(lcm, leadRing);
1047 }
1048 #endif
1049 
1050 /***************************************************************
1051  *
1052  * Misc things
1053  *
1054  ***************************************************************/
1056 {
1057  BOOLEAN ret;
1058  number mult, rest;
1059  TObject red = *PW;
1060  red.Copy();
1061  rest = n_QuotRem(pGetCoeff(Red->p), pGetCoeff(red.p),
1062  &mult, currRing->cf);
1063  red.Mult_nn(rest);
1064 
1065  assume(PR->GetLmCurrRing() != red.GetLmCurrRing());
1066  ret = ksReducePolyLC(Red, &red, NULL, &mult);
1067  red.Delete();
1068  red.Clear();
1069 
1070  return ret;
1071 }
1072 
1073 KINLINE int ksReducePolyTail_Z(LObject* PR, TObject* PW, LObject* Red)
1074 {
1075  BOOLEAN ret;
1076  number coef;
1077 
1078  assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
1079  ret = ksReducePoly(Red, PW, NULL, &coef);
1080 
1081  if (!ret)
1082  {
1083  if (! n_IsOne(coef, currRing->cf))
1084  {
1085  PR->Mult_nn(coef);
1086  // HANNES: mark for Normalize
1087  }
1088  n_Delete(&coef, currRing->cf);
1089  }
1090  return ret;
1091 }
1092 
1093 KINLINE int ksReducePolyTail(LObject* PR, TObject* PW, LObject* Red)
1094 {
1095  BOOLEAN ret;
1096  number coef;
1097 
1098  assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
1099  Red->HeadNormalize();
1100  ret = ksReducePoly(Red, PW, NULL, &coef);
1101 
1102  if (!ret)
1103  {
1104  if (! n_IsOne(coef, currRing->cf))
1105  {
1106  PR->Mult_nn(coef);
1107  // HANNES: mark for Normalize
1108  }
1109  n_Delete(&coef, currRing->cf);
1110  }
1111  return ret;
1112 }
1113 
1114 /***************************************************************
1115  *
1116  * Routines for backwards-Compatibility
1117  *
1118  *
1119  ***************************************************************/
1120 KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
1121 {
1122  LObject L(p2);
1123  TObject T(p1);
1125  ksReducePoly(&L, &T, spNoether);
1126 
1127  return L.GetLmCurrRing();
1128 }
1129 
1130 KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether)
1131 {
1132  LObject L(p_Copy(p2, currRing));
1133  TObject T(p1);
1135  ksReducePoly(&L, &T, spNoether);
1136 
1137  return L.GetLmCurrRing();
1138 }
1139 
1140 KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
1141 {
1142  LObject L(r);
1143  L.p1 = p1;
1144  L.p2 = p2;
1145 
1146  ksCreateSpoly(&L, spNoether);
1147  return L.GetLmCurrRing();
1148 }
1149 
1150 void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r)
1151 {
1152  LObject L(q, currRing, r);
1153  TObject T(p1, currRing, r);
1154 
1155  ksReducePolyTail(&L, &T, q2, spNoether);
1156 }
1157 
1158 KINLINE poly redtailBba (poly p,int pos,kStrategy strat,BOOLEAN normalize)
1159 {
1160  LObject L(p);
1161  return redtailBba(&L, pos, strat,FALSE, normalize);
1162 }
1163 
1164 KINLINE poly redtailBbaBound (poly p,int pos,kStrategy strat,int bound,BOOLEAN normalize)
1166  LObject L(p, currRing, strat->tailRing); // ? L(p); ??
1167  return redtailBbaBound(&L, pos, strat,bound, FALSE, normalize);
1168 }
1169 
1170 #ifdef HAVE_RINGS
1171 KINLINE poly redtailBba_Z (poly p,int pos,kStrategy strat)
1173  LObject L(p, currRing, strat->tailRing);
1174  return redtailBba_Z(&L, pos, strat);
1175 }
1176 #endif
1177 
1178 KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k,
1179  kStrategy strat)
1180 {
1181  assume(p_sev == pGetShortExpVector(p));
1182  if (strat->noClearS) return;
1183  #ifdef HAVE_RINGS
1185  {
1186  if (!pLmShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at]))
1187  return;
1188  if(!n_DivBy(pGetCoeff(strat->S[*at]), pGetCoeff(p), currRing->cf))
1189  return;
1190  }
1191  else
1192  #endif
1193  {
1194  if (!pLmShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at])) return;
1195  }
1196  deleteInS((*at),strat);
1197  (*at)--;
1198  (*k)--;
1199 }
1200 
1201 // dummy function for function pointer strat->rewCrit being usable in all
1202 // possible choices for criteria
1203 KINLINE BOOLEAN arriRewDummy(poly /*sig*/, unsigned long /*not_sevSig*/, poly /*lm*/, kStrategy /*strat*/, int /*start=0*/)
1204 {
1205  return FALSE;
1206 }
1207 
1208 #endif // defined(KINLINE) || defined(KUTIL_CC)
1209 #endif // KINLINE_H
clearS
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
Definition: kInline.h:1172
skStrategy::S_2_T
KINLINE TObject * S_2_T(int i)
Definition: kInline.h:38
FALSE
#define FALSE
Definition: auxiliary.h:96
sTObject::is_normalized
char is_normalized
Definition: kutil.h:82
k_LmShallowCopyDelete_currRing_2_tailRing
KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
Definition: kInline.h:920
sLObject::i_r2
int i_r2
Definition: kutil.h:187
sTObject::pLDeg
KINLINE long pLDeg()
Definition: kInline.h:452
k_LmInit_tailRing_2_currRing
KINLINE poly k_LmInit_tailRing_2_currRing(poly t_p, ring tailRing, omBin lmBin)
Definition: kInline.h:911
skStrategy
Definition: kutil.h:266
omalloc.h
kBucketCanonicalize
int kBucketCanonicalize(kBucket_pt bucket)
Canonicalizes Bpoly, i.e. converts polys of buckets into one poly in one bucket: Returns number of bu...
p_LmDeleteAndNext
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition: p_polys.h:711
sTObject::Delete
KINLINE void Delete()
Definition: kInline.h:209
p_GetComp
#define p_GetComp(p, r)
Definition: monomials.h:61
nNormalize
#define nNormalize(n)
Definition: numbers.h:29
sLObject::sev
unsigned long sev
Definition: kutil.h:181
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition: p_polys.h:456
sTObject::pFDeg
KINLINE long pFDeg() const
Definition: kInline.h:432
sTObject::SetpFDeg
KINLINE long SetpFDeg()
Definition: kInline.h:442
k
int k
Definition: cfEzgcd.cc:92
TObject
class sTObject TObject
Definition: kutil.h:52
x
Variable x
Definition: cfModGcd.cc:4023
sLObject::ShallowCopyDelete
KINLINE void ShallowCopyDelete(ring new_tailRing, pShallowCopyDeleteProc p_shallow_copy_delete)
Definition: kInline.h:723
sTObject::FDeg
long FDeg
Definition: kutil.h:72
sLObject::Tail_Mult_nn
KINLINE void Tail_Mult_nn(number n)
Definition: kInline.h:598
sLObject::Copy
KINLINE void Copy()
Definition: kInline.h:746
lq
Definition: lq.h:38
sLObject::LmExtractAndIter
KINLINE poly LmExtractAndIter()
Definition: kInline.h:654
initT
KINLINE TSet initT()
Definition: kInline.h:83
sTObject::length
int length
Definition: kutil.h:73
skStrategy::R
TObject ** R
Definition: kutil.h:337
skStrategy::S
polyset S
Definition: kutil.h:301
initsevT
KINLINE unsigned long * initsevT()
Definition: kInline.h:99
p_LmInit
static poly p_LmInit(poly p, const ring r)
Definition: p_polys.h:1257
polys.h
p_Minus_mm_Mult_qq
static poly p_Minus_mm_Mult_qq(poly p, const poly m, const poly q, int &lp, int lq, const poly spNoether, const ring r)
Definition: p_polys.h:994
skStrategy::tailRing
ring tailRing
Definition: kutil.h:340
sLObject::Tail_Minus_mm_Mult_qq
KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether)
Definition: kInline.h:612
sTObject::Copy
KINLINE void Copy()
Definition: kInline.h:234
sLObject::HeadNormalize
KINLINE void HeadNormalize()
Definition: kInline.h:377
sTObject::LmDeleteAndIter
KINLINE void LmDeleteAndIter()
Definition: kInline.h:323
sTObject
Definition: kutil.h:63
sLObject::sLObject
KINLINE sLObject(ring tailRing=currRing)
Definition: kInline.h:546
TEST_OPT_CONTENTSB
#define TEST_OPT_CONTENTSB
Definition: options.h:123
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:454
sLObject
Definition: kutil.h:177
p_Test
#define p_Test(p, r)
Definition: p_polys.h:154
p_LmShallowCopyDelete
static poly p_LmShallowCopyDelete(poly p, const ring r)
Definition: p_polys.h:1315
pGetShortExpVector
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl....
Definition: polys.h:146
options.h
skStrategy::sevS
unsigned long * sevS
Definition: kutil.h:317
sTObject::sTObject
KINLINE sTObject(ring tailRing=currRing)
Definition: kInline.h:115
n_IsOne
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:467
__p_Mult_nn
#define __p_Mult_nn(p, n, r)
Definition: p_polys.h:915
sLObject::pLDeg
KINLINE long pLDeg()
Definition: kInline.h:762
sTObject::pCleardenom
KINLINE void pCleardenom()
Definition: kInline.h:468
sTObject::Set
KINLINE void Set(ring r=currRing)
Definition: kInline.h:105
n_QuotRem
static FORCE_INLINE number n_QuotRem(number a, number b, number *q, const coeffs r)
Definition: coeffs.h:702
p_SetExp
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition: p_polys.h:475
sLObject::LmDeleteAndIter
KINLINE void LmDeleteAndIter()
Definition: kInline.h:634
skStrategy::t_kNoether
poly t_kNoether
Definition: kutil.h:328
k_LmInit_currRing_2_tailRing
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
Definition: kInline.h:902
p_LmCheckPolyRing
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
Definition: pDebug.cc:114
sTObject::GetpLength
KINLINE int GetpLength()
Definition: kInline.h:303
redtailBba_Z
KINLINE poly redtailBba_Z(poly p, int pos, kStrategy strat)
Definition: kInline.h:1165
shiftop.h
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:796
ksCreateSpoly
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
Definition: kspoly.cc:1153
sTObject::Clear
KINLINE void Clear()
Definition: kInline.h:223
sTObject::t_p
poly t_p
Definition: kutil.h:69
denominator_list
denominator_list_s * denominator_list
Definition: kutil.h:58
p_MinComp
static long p_MinComp(poly p, ring lmRing, ring tailRing)
Definition: p_polys.h:303
kBucketExtractLm
poly kBucketExtractLm(kBucket_pt bucket)
Definition: kbuckets.cc:510
TRUE
#define TRUE
Definition: auxiliary.h:100
skStrategy::s_2_t
KINLINE TObject * s_2_t(int i)
Definition: kInline.h:47
i
int i
Definition: cfEzgcd.cc:125
sTObject::ShallowCopyDelete
KINLINE void ShallowCopyDelete(ring new_tailRing, omBin new_tailBin, pShallowCopyDeleteProc p_shallow_copy_delete, BOOLEAN set_max=TRUE)
Definition: kInline.h:391
ksReducePoly
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
Definition: kspoly.cc:186
sLObject::T_2
KINLINE TObject * T_2(const skStrategy *strat)
Definition: kInline.h:865
nIsOne
#define nIsOne(n)
Definition: numbers.h:24
skStrategy::sl
int sl
Definition: kutil.h:345
kBucketDestroy
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:215
DENOMINATOR_LIST
VAR denominator_list DENOMINATOR_LIST
Definition: kutil.cc:87
skStrategy::T
TSet T
Definition: kutil.h:321
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:87
kBucketNormalize
void kBucketNormalize(kBucket_pt bucket)
apply n_Normalize to all coefficients
kBucketInit
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition: kbuckets.cc:492
sTObject::IsNull
KINLINE BOOLEAN IsNull() const
Definition: kInline.h:298
kBucket_Minus_m_Mult_p
void kBucket_Minus_m_Mult_p(kBucket_pt bucket, poly m, poly p, int *l, poly spNoether)
Bpoly == Bpoly - m*p; where m is a monom Does not destroy p and m assume (*l <= 0 || pLength(p) == *l...
Definition: kbuckets.cc:715
ksReducePolyTail
KINLINE int ksReducePolyTail(LObject *PR, TObject *PW, LObject *Red)
Definition: kInline.h:1088
rField_is_Ring
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:478
kBucket_Mult_n
void kBucket_Mult_n(kBucket_pt bucket, number n)
Multiply Bucket by number ,i.e. Bpoly == n*Bpoly.
Definition: kbuckets.cc:597
denominator_list_s
Definition: kutil.h:60
skStrategy::kNoetherTail
KINLINE poly kNoetherTail()
Definition: kInline.h:66
TSet
TObject * TSet
Definition: kutil.h:54
kBucketShallowCopyDelete
void kBucketShallowCopyDelete(kBucket_pt bucket, ring new_tailRing, omBin new_tailBin, pShallowCopyDeleteProc p_shallow_copy_delete)
For changing the ring of the Bpoly to new_tailBin.
Definition: kbuckets.cc:534
sLObject::Comp
KINLINE long Comp()
Definition: kInline.h:839
sTObject::max_exp
poly max_exp
Definition: kutil.h:70
k_GetLeadTerms
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:960
sLObject::PrepareRed
KINLINE void PrepareRed(BOOLEAN use_bucket)
Definition: kInline.h:562
setmaxT
#define setmaxT
Definition: kutil.h:32
sLObject::SetLmTail
KINLINE void SetLmTail(poly lm, poly new_p, int length, int use_bucket, ring r)
Definition: kInline.h:580
omAlloc
#define omAlloc(size)
Definition: omAllocDecl.h:208
p_polys.h
p_Last
poly p_Last(const poly p, int &l, const ring r)
Definition: p_polys.cc:4523
k_LmShallowCopyDelete_tailRing_2_currRing
KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin lmBin)
Definition: kInline.h:927
p_ProjectiveUnique
void p_ProjectiveUnique(poly ph, const ring r)
Definition: p_polys.cc:3086
sTObject::pNorm
KINLINE void pNorm()
Definition: kInline.h:506
sTObject::SetDegStuffReturnLDeg
KINLINE long SetDegStuffReturnLDeg()
Definition: kInline.h:456
ksReducePolyTailLC_Z
KINLINE int ksReducePolyTailLC_Z(LObject *PR, TObject *PW, LObject *Red)
Definition: kInline.h:1050
T
STATIC_VAR jList * T
Definition: janet.cc:30
p_Init
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1242
pp
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:248
p_GetMaxExpP
poly p_GetMaxExpP(poly p, const ring r)
return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0,...
Definition: p_polys.cc:1126
sTObject::pLength
int pLength
Definition: kutil.h:73
kBucketClear
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:520
sLObject::Normalize
KINLINE void Normalize()
Definition: kInline.h:357
arriRewDummy
KINLINE BOOLEAN arriRewDummy(poly, unsigned long, poly, kStrategy, int)
Definition: kInline.h:1197
skStrategy::S_2_R
int * S_2_R
Definition: kutil.h:339
sTObject::i_r
int i_r
Definition: kutil.h:73
sLObject::p1
poly p1
Definition: kutil.h:182
ksOldSpolyRed
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
Definition: kInline.h:1114
sTObject::GetLmCurrRing
KINLINE poly GetLmCurrRing()
Definition: kInline.h:252
kFindInT
int kFindInT(poly p, TSet T, int tlength)
returns index of p in TSet, or -1 if not found
Definition: kutil.cc:710
kbuckets.h
p_LmFree
static void p_LmFree(poly p, ring)
Definition: p_polys.h:669
omBin
omBin_t * omBin
Definition: omStructs.h:11
p_Delete
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:845
sTObject::shift
int shift
Definition: kutil.h:79
redtailBba
KINLINE poly redtailBba(poly p, int pos, kStrategy strat, BOOLEAN normalize)
Definition: kInline.h:1152
normalize
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
Definition: syz3.cc:1025
si_max
static int si_max(const int a, const int b)
Definition: auxiliary.h:140
bound
static CanonicalForm bound(const CFMatrix &M)
Definition: cf_linsys.cc:460
mult
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:647
redtailBbaBound
KINLINE poly redtailBbaBound(poly p, int pos, kStrategy strat, int bound, BOOLEAN normalize)
Definition: kInline.h:1158
sTObject::ecart
int ecart
Definition: kutil.h:73
p_mFirstVblock
int p_mFirstVblock(poly p, const ring ri)
Definition: shiftop.cc:473
nInvers
#define nInvers(a)
Definition: numbers.h:32
sLObject::p2
poly p2
Definition: kutil.h:182
sLObject::T_1
KINLINE TObject * T_1(const skStrategy *strat)
Definition: kInline.h:855
KINLINE
#define KINLINE
Definition: kutil.h:44
sTObject::GetLmTailRing
KINLINE poly GetLmTailRing()
Definition: kInline.h:259
kBucketDeleteAndDestroy
void kBucketDeleteAndDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:222
p_Length
p_Length
Definition: p_Procs_Impl.h:117
sLObject::GetTP
KINLINE poly GetTP()
Definition: kInline.h:680
sLObject::GetpLength
KINLINE int GetpLength()
Definition: kInline.h:807
pSetCoeff0
#define pSetCoeff0(p, n)
Definition: monomials.h:56
p_GetExpDiff
static long p_GetExpDiff(poly p1, poly p2, int i, ring r)
Definition: p_polys.h:622
m
int m
Definition: cfEzgcd.cc:121
skStrategy::kNoether
poly kNoether
Definition: kutil.h:325
skStrategy::tl
int tl
Definition: kutil.h:347
sTObject::SetLmCurrRing
KINLINE void SetLmCurrRing()
Definition: kInline.h:309
n_DivBy
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z:...
Definition: coeffs.h:774
assume
#define assume(x)
Definition: mod2.h:384
NULL
#define NULL
Definition: omList.c:11
sTObject::Mult_nn
KINLINE void Mult_nn(number n)
Definition: kInline.h:344
skStrategy::noClearS
char noClearS
Definition: kutil.h:400
pLmShortDivisibleBy
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
Definition: polys.h:140
l
int l
Definition: cfEzgcd.cc:93
lcm
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:709
sLObject::SetShortExpVector
KINLINE void SetShortExpVector()
Definition: kInline.h:734
nDelete
#define nDelete(n)
Definition: numbers.h:15
sTObject::p
poly p
Definition: kutil.h:68
kBucket
Definition: kbuckets.h:177
p_Setm
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:223
LObject
class sLObject LObject
Definition: kutil.h:53
sLObject::i_r1
int i_r1
Definition: kutil.h:187
sLObject::bucket
kBucket_pt bucket
Definition: kutil.h:186
denominator_list_s::next
denominator_list next
Definition: kutil.h:60
ksReducePolyTail_Z
KINLINE int ksReducePolyTail_Z(LObject *PR, TObject *PW, LObject *Red)
Definition: kInline.h:1068
ksOldSpolyTail
void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r)
Definition: kInline.h:1144
p_Totaldegree
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1428
p
int p
Definition: cfModGcd.cc:4019
pShallowCopyDeleteProc
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:43
kBucketCreate
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:208
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
sTObject::pTotalDeg
KINLINE long pTotalDeg() const
Definition: kInline.h:437
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
sLObject::MinComp
KINLINE long MinComp()
Definition: kInline.h:824
rIsSyzIndexRing
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:714
sLObject::operator=
KINLINE sLObject & operator=(const sTObject &)
Definition: kInline.h:848
sLObject::Clear
KINLINE void Clear()
Definition: kInline.h:525
sTObject::Next
KINLINE poly Next()
Definition: kInline.h:315
sLObject::Init
KINLINE void Init(ring tailRing=currRing)
Definition: kInline.h:538
pNormalize
#define pNormalize(p)
Definition: polys.h:301
p_Norm
void p_Norm(poly p1, const ring r)
Definition: p_polys.cc:3676
sTObject::tailRing
ring tailRing
Definition: kutil.h:71
deleteInS
void deleteInS(int i, kStrategy strat)
Definition: kutil.cc:1095
ksReducePolyLC
int ksReducePolyLC(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
Definition: kspoly.cc:434
k_GetStrongLeadTerms
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring tailRing)
Definition: kInline.h:1003
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:41
copy
CFArray copy(const CFList &list)
write elements of list into an array
Definition: facFqBivarUtil.cc:364
denominator_list_s::n
number n
Definition: kutil.h:60
Copy
static number Copy(number a, const coeffs r)
Definition: flintcf_Q.cc:199
sTObject::GetLm
KINLINE poly GetLm(ring r)
Definition: kInline.h:272
p_GetShortExpVector
unsigned long p_GetShortExpVector(const poly p, const ring r)
Definition: p_polys.cc:4682
initR
KINLINE TObject ** initR()
Definition: kInline.h:94
p_FDeg
static long p_FDeg(const poly p, const ring r)
Definition: p_polys.h:368
sLObject::T_1_2
KINLINE void T_1_2(const skStrategy *strat, TObject *&T_1, TObject *&T_2)
Definition: kInline.h:876
sTObject::GetpFDeg
KINLINE long GetpFDeg() const
Definition: kInline.h:447
pNext
#define pNext(p)
Definition: monomials.h:33
sLObject::SetLength
KINLINE int SetLength(BOOLEAN lengt_pLength=FALSE)
Definition: kInline.h:814
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:209
p_Mult_nn
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:902
sLObject::GetP
KINLINE poly GetP(omBin lmBin=(omBin) NULL)
Definition: kInline.h:696
ksOldCreateSpoly
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
Definition: kInline.h:1134
sLObject::SetDegStuffReturnLDeg
KINLINE long SetDegStuffReturnLDeg()
Definition: kInline.h:793
sLObject::Delete
KINLINE void Delete()
Definition: kInline.h:531
ksOldSpolyRedNew
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether)
Definition: kInline.h:1124
p_Cleardenom_n
void p_Cleardenom_n(poly ph, const ring r, number &c)
Definition: p_polys.cc:2897
sLObject::CanonicalizeP
KINLINE void CanonicalizeP()
Definition: kInline.h:371
sTObject::Init
KINLINE void Init(ring r=currRing)
Definition: kInline.h:109