source: git/polys/pInline2.h @ 4e654a2

spielwiese
Last change on this file since 4e654a2 was aa2b525, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
ADD/FIX: use omSizeWOfBin(bin_ptr) instead of ((bin_ptr)->sizeW) (due to xalloc)
  • Property mode set to 100644
File size: 17.2 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/***************************************************************
5 *  File:    pInline2.h
6 *  Purpose: implementation of poly procs which are of constant time
7 *  Author:  obachman (Olaf Bachmann)
8 *  Created: 8/00
9 *  Version: $Id$
10 *******************************************************************/
11#ifndef PINLINE2_H
12#define PINLINE2_H
13
14/***************************************************************
15 *
16 * Primitives for accessing and setting fields of a poly
17 *
18 ***************************************************************/
19#if !defined(NO_PINLINE2) || defined(PINLINE2_CC)
20
21#include "structs.h"
22#include <omalloc.h>
23#include <coeffs.h>
24#include "p_Procs.h"
25#include "sbuckets.h"
26#ifdef HAVE_PLURAL
27#include <gring.h>
28#include <ring.h>
29#endif
30
31PINLINE2 number p_SetCoeff(poly p, number n, ring r)
32{
33  p_LmCheckPolyRing2(p, r);
34  n_Delete(&(p->coef), r);
35  (p)->coef=n;
36  return n;
37}
38
39// order
40PINLINE2 long p_GetOrder(poly p, ring r)
41{
42  p_LmCheckPolyRing2(p, r);
43  if (r->typ==NULL) return ((p)->exp[r->pOrdIndex]);
44  int i=0;
45  loop
46  {
47    switch(r->typ[i].ord_typ)
48    {
49      case ro_wp_neg:
50        return (((long)((p)->exp[r->pOrdIndex]))-POLY_NEGWEIGHT_OFFSET);
51      case ro_syzcomp:
52      case ro_syz: 
53      case ro_cp:
54        i++;
55        break;
56      //case ro_dp:
57      //case ro_wp:
58      default:
59        return ((p)->exp[r->pOrdIndex]);
60    }
61  }
62}
63
64// Setm
65PINLINE2 void p_Setm(poly p, const ring r)
66{
67  p_CheckRing2(r);
68  r->p_Setm(p, r);
69}
70
71// component
72PINLINE2  unsigned long p_SetComp(poly p, unsigned long c, ring r)
73{
74  p_LmCheckPolyRing2(p, r);
75  pAssume2(rRing_has_Comp(r));
76  __p_GetComp(p,r) = c;
77  return c;
78}
79PINLINE2 unsigned long p_AddComp(poly p, unsigned long v, ring r)
80{
81  p_LmCheckPolyRing2(p, r);
82  pAssume2(rRing_has_Comp(r));
83  return __p_GetComp(p,r) += v;
84}
85PINLINE2 unsigned long p_SubComp(poly p, unsigned long v, ring r)
86{
87  p_LmCheckPolyRing2(p, r);
88  pAssume2(rRing_has_Comp(r));
89  pPolyAssume2(__p_GetComp(p,r) >= v,p,r);
90  return __p_GetComp(p,r) -= v;
91}
92PINLINE2 int p_Comp_k_n(poly a, poly b, int k, ring r)
93{
94  if ((a==NULL) || (b==NULL) ) return FALSE;
95  p_LmCheckPolyRing2(a, r);
96  p_LmCheckPolyRing2(b, r);
97  pAssume2(k > 0 && k <= r->N);
98  int i=k;
99  for(;i<=r->N;i++)
100  {
101    if (p_GetExp(a,i,r) != p_GetExp(b,i,r)) return FALSE;
102    //    if (a->exp[(r->VarOffset[i] & 0xffffff)] != b->exp[(r->VarOffset[i] & 0xffffff)]) return FALSE;
103  }
104  return TRUE;
105}
106
107#ifndef HAVE_EXPSIZES
108
109/// get a single variable exponent
110/// @Note:
111/// the integer VarOffset encodes:
112/// 1. the position of a variable in the exponent vector p->exp (lower 24 bits)
113/// 2. number of bits to shift to the right in the upper 8 bits (which takes at most 6 bits for 64 bit)
114/// Thus VarOffset always has 2 zero higher bits!
115PINLINE2 long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
116{
117  pAssume2((VarOffset >> (24 + 6)) == 0);
118#if 0
119  int pos=(VarOffset & 0xffffff);
120  int bitpos=(VarOffset >> 24);
121  unsigned long exp=(p->exp[pos] >> bitmask) & iBitmask;
122  return exp;
123#else
124  return (long)
125         ((p->exp[(VarOffset & 0xffffff)] >> (VarOffset >> 24))
126          & iBitmask);
127#endif
128}
129
130
131/// set a single variable exponent
132/// @Note:
133/// VarOffset encodes the position in p->exp @see p_GetExp
134PINLINE2 unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
135{
136  pAssume2(e>=0);
137  pAssume2(e<=iBitmask);
138  pAssume2((VarOffset >> (24 + 6)) == 0);
139
140  // shift e to the left:
141  register int shift = VarOffset >> 24;
142  unsigned long ee = e << shift /*(VarOffset >> 24)*/;
143  // find the bits in the exponent vector
144  register int offset = (VarOffset & 0xffffff);
145  // clear the bits in the exponent vector:
146  p->exp[offset]  &= ~( iBitmask << shift );
147  // insert e with |
148  p->exp[ offset ] |= ee;
149  return e;
150}
151
152
153#else // #ifdef HAVE_EXPSIZES // EXPERIMENTAL!!!
154
155PINLINE2 unsigned long BitMask(unsigned long bitmask, int twobits)
156{
157  // bitmask = 00000111111111111
158  // 0 must give bitmask!
159  // 1, 2, 3 - anything like 00011..11
160  pAssume2((twobits >> 2) == 0);
161  static const unsigned long _bitmasks[4] = {-1, 0x7fff, 0x7f, 0x3};
162  return bitmask & _bitmasks[twobits];
163}
164
165
166/// @Note: we may add some more info (6 ) into VarOffset and thus encode
167PINLINE2 long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
168{
169  int pos  =(VarOffset & 0xffffff);
170  int hbyte= (VarOffset >> 24); // the highest byte
171  int bitpos = hbyte & 0x3f; // last 6 bits
172  long bitmask = BitMask(iBitmask, hbyte >> 6);
173
174  long exp=(p->exp[pos] >> bitpos) & bitmask;
175  return exp;
176
177}
178
179PINLINE2 long p_SetExp(poly p, const long e, const unsigned long iBitmask, const int VarOffset)
180{
181  pAssume2(e>=0);
182  pAssume2(e <= BitMask(iBitmask, VarOffset >> 30));
183
184  // shift e to the left:
185  register int hbyte = VarOffset >> 24;
186  int bitmask = BitMask(iBitmask, hbyte >> 6);
187  register int shift = hbyte & 0x3f;
188  long ee = e << shift;
189  // find the bits in the exponent vector
190  register int offset = (VarOffset & 0xffffff);
191  // clear the bits in the exponent vector:
192  p->exp[offset]  &= ~( bitmask << shift );
193  // insert e with |
194  p->exp[ offset ] |= ee;
195  return e;
196}
197
198#endif // #ifndef HAVE_EXPSIZES
199
200
201PINLINE2 long p_GetExp(const poly p, const ring r, const int VarOffset)
202{
203  p_LmCheckPolyRing2(p, r);
204  pAssume2(VarOffset != -1);
205  return p_GetExp(p, r->bitmask, VarOffset);
206}
207
208PINLINE2 long p_SetExp(poly p, const long e, const ring r, const int VarOffset)
209{
210  p_LmCheckPolyRing2(p, r);
211  pAssume2(VarOffset != -1);
212  return p_SetExp(p, e, r->bitmask, VarOffset);
213}
214
215
216
217/// get v^th exponent for a monomial
218PINLINE2 long p_GetExp(const poly p, const int v, const ring r)
219{
220  p_LmCheckPolyRing2(p, r);
221  pAssume2(v>0 && v <= r->N);
222  pAssume2(r->VarOffset[v] != -1);
223  return p_GetExp(p, r->bitmask, r->VarOffset[v]);
224}
225
226
227/// set v^th exponent for a monomial
228PINLINE2 long p_SetExp(poly p, const int v, const long e, const ring r)
229{
230  p_LmCheckPolyRing2(p, r);
231  pAssume2(v>0 && v <= r->N);
232  pAssume2(r->VarOffset[v] != -1);
233  return p_SetExp(p, e, r->bitmask, r->VarOffset[v]);
234}
235
236
237
238
239
240// the following should be implemented more efficiently
241PINLINE2  long p_IncrExp(poly p, int v, ring r)
242{
243  p_LmCheckPolyRing2(p, r);
244  int e = p_GetExp(p,v,r);
245  e++;
246  return p_SetExp(p,v,e,r);
247}
248PINLINE2  long p_DecrExp(poly p, int v, ring r)
249{
250  p_LmCheckPolyRing2(p, r);
251  int e = p_GetExp(p,v,r);
252  pAssume2(e > 0);
253  e--;
254  return p_SetExp(p,v,e,r);
255}
256PINLINE2  long p_AddExp(poly p, int v, long ee, ring r)
257{
258  p_LmCheckPolyRing2(p, r);
259  int e = p_GetExp(p,v,r);
260  e += ee;
261  return p_SetExp(p,v,e,r);
262}
263PINLINE2  long p_SubExp(poly p, int v, long ee, ring r)
264{
265  p_LmCheckPolyRing2(p, r);
266  long e = p_GetExp(p,v,r);
267  pAssume2(e >= ee);
268  e -= ee;
269  return p_SetExp(p,v,e,r);
270}
271PINLINE2  long p_MultExp(poly p, int v, long ee, ring r)
272{
273  p_LmCheckPolyRing2(p, r);
274  long e = p_GetExp(p,v,r);
275  e *= ee;
276  return p_SetExp(p,v,e,r);
277}
278
279PINLINE2 long p_GetExpSum(poly p1, poly p2, int i, ring r)
280{
281  p_LmCheckPolyRing2(p1, r);
282  p_LmCheckPolyRing2(p2, r);
283  return p_GetExp(p1,i,r) + p_GetExp(p2,i,r);
284}
285PINLINE2 long p_GetExpDiff(poly p1, poly p2, int i, ring r)
286{
287  return p_GetExp(p1,i,r) - p_GetExp(p2,i,r);
288}
289
290
291/***************************************************************
292 *
293 * Allocation/Initalization/Deletion
294 *
295 ***************************************************************/
296PINLINE2 poly p_New(ring r, omBin bin)
297{
298  p_CheckRing2(r);
299  pAssume2(bin != NULL && omSizeWOfBin(r->PolyBin) == omSizeWOfBin(bin));
300  poly p;
301  omTypeAllocBin(poly, p, bin);
302  p_SetRingOfLm(p, r);
303  return p;
304}
305
306PINLINE2 poly p_New(ring r)
307{
308  return p_New(r, r->PolyBin);
309}
310
311PINLINE2 void p_LmFree(poly p, ring r)
312{
313  p_LmCheckPolyRing2(p, r);
314  omFreeBinAddr(p);
315}
316PINLINE2 void p_LmFree(poly *p, ring r)
317{
318  p_LmCheckPolyRing2(*p, r);
319  poly h = *p;
320  *p = pNext(h);
321  omFreeBinAddr(h);
322}
323PINLINE2 poly p_LmFreeAndNext(poly p, ring r)
324{
325  p_LmCheckPolyRing2(p, r);
326  poly pnext = pNext(p);
327  omFreeBinAddr(p);
328  return pnext;
329}
330PINLINE2 void p_LmDelete(poly p, ring r)
331{
332  p_LmCheckPolyRing2(p, r);
333  n_Delete(&pGetCoeff(p), r);
334  omFreeBinAddr(p);
335}
336PINLINE2 void p_LmDelete(poly *p, ring r)
337{
338  p_LmCheckPolyRing2(*p, r);
339  poly h = *p;
340  *p = pNext(h);
341  n_Delete(&pGetCoeff(h), r);
342  omFreeBinAddr(h);
343}
344PINLINE2 poly p_LmDeleteAndNext(poly p, ring r)
345{
346  p_LmCheckPolyRing2(p, r);
347  poly pnext = pNext(p);
348  n_Delete(&pGetCoeff(p), r);
349  omFreeBinAddr(p);
350  return pnext;
351}
352
353/***************************************************************
354 *
355 * Misc routines
356 *
357 ***************************************************************/
358PINLINE2 int p_Cmp(poly p1, poly p2, ring r)
359{
360  if (p2==NULL)
361    return 1;
362  if (p1==NULL)
363    return -1;
364  return p_LmCmp(p1,p2,r);
365}
366
367PINLINE2 unsigned long p_GetMaxExp(const poly p, const ring r)
368{
369  return p_GetMaxExp(p_GetMaxExpL(p, r), r);
370}
371
372PINLINE2 unsigned long p_GetMaxExp(const unsigned long l, const ring r)
373{
374  unsigned long bitmask = r->bitmask;
375  unsigned long max = (l & bitmask);
376  unsigned long j = r->ExpPerLong - 1;
377
378  if (j > 0)
379  {
380    unsigned long i = r->BitsPerExp;
381    long e;
382    loop
383    {
384      e = ((l >> i) & bitmask);
385      if ((unsigned long) e > max)
386        max = e;
387      j--;
388      if (j==0) break;
389      i += r->BitsPerExp;
390    }
391  }
392  return max;
393}
394
395PINLINE2 unsigned long
396p_GetTotalDegree(const unsigned long l, const ring r, const int number_of_exps)
397{
398  const unsigned long bitmask = r->bitmask;
399  unsigned long sum = (l & bitmask);
400  unsigned long j = number_of_exps - 1;
401
402  if (j > 0)
403  {
404    unsigned long i = r->BitsPerExp;
405    loop
406    {
407      sum += ((l >> i) & bitmask);
408      j--;
409      if (j==0) break;
410      i += r->BitsPerExp;
411    }
412  }
413  return sum;
414}
415
416PINLINE2 unsigned long
417p_GetTotalDegree(const unsigned long l, const ring r)
418{
419  return p_GetTotalDegree(l, r, r->ExpPerLong);
420}
421
422/***************************************************************
423 *
424 * Dispatcher to r->p_Procs, they do the tests/checks
425 *
426 ***************************************************************/
427// returns a copy of p
428PINLINE2 poly p_Copy(poly p, const ring r)
429{
430#ifdef PDEBUG
431  poly pp= r->p_Procs->p_Copy(p, r);
432  p_Test(pp,r);
433  return pp;
434#else
435  return r->p_Procs->p_Copy(p, r);
436#endif
437}
438
439PINLINE2 poly p_Copy(poly p, const ring lmRing, const ring tailRing)
440{
441#ifndef PDEBUG
442  if (tailRing == lmRing)
443    return tailRing->p_Procs->p_Copy(p, tailRing);
444#endif
445  if (p != NULL)
446  {
447    poly pres = p_Head(p, lmRing);
448    pNext(pres) = tailRing->p_Procs->p_Copy(pNext(p), tailRing);
449    return pres;
450  }
451  else
452    return NULL;
453}
454
455// deletes *p, and sets *p to NULL
456PINLINE2 void p_Delete(poly *p, const ring r)
457{
458  r->p_Procs->p_Delete(p, r);
459}
460
461PINLINE2 void p_Delete(poly *p,  const ring lmRing, const ring tailRing)
462{
463#ifndef PDEBUG
464  if (tailRing == lmRing)
465  {
466    tailRing->p_Procs->p_Delete(p, tailRing);
467    return;
468  }
469#endif
470  if (*p != NULL)
471  {
472    if (pNext(*p) != NULL)
473      tailRing->p_Procs->p_Delete(&pNext(*p), tailRing);
474    p_LmDelete(p, lmRing);
475  }
476}
477
478PINLINE2 poly p_ShallowCopyDelete(poly p, const ring r, omBin bin)
479{
480  p_LmCheckPolyRing2(p, r);
481  pAssume2(omSizeWOfBin(r->PolyBin) == omSizeWOfBin(bin));
482  return r->p_Procs->p_ShallowCopyDelete(p, r, bin);
483}
484
485// returns p+q, destroys p and q
486PINLINE2 poly p_Add_q(poly p, poly q, const ring r)
487{
488  int shorter;
489  return r->p_Procs->p_Add_q(p, q, shorter, r);
490}
491
492PINLINE2 poly p_Add_q(poly p, poly q, int &lp, int lq, const ring r)
493{
494  int shorter;
495  poly res = r->p_Procs->p_Add_q(p, q, shorter, r);
496  lp = (lp + lq) - shorter;
497  return res;
498}
499
500// returns p*n, destroys p
501PINLINE2 poly p_Mult_nn(poly p, number n, const ring r)
502{
503  if (n_IsOne(n, r))
504    return p;
505  else
506    return r->p_Procs->p_Mult_nn(p, n, r);
507}
508
509PINLINE2 poly p_Mult_nn(poly p, number n, const ring lmRing,
510                        const ring tailRing)
511{
512#ifndef PDEBUG
513  if (lmRing == tailRing)
514  {
515    return p_Mult_nn(p, n, tailRing);
516  }
517#endif
518  poly pnext = pNext(p);
519  pNext(p) = NULL;
520  p = lmRing->p_Procs->p_Mult_nn(p, n, lmRing);
521  pNext(p) = tailRing->p_Procs->p_Mult_nn(pnext, n, tailRing);
522  return p;
523}
524
525// returns p*n, does not destroy p
526PINLINE2 poly pp_Mult_nn(poly p, number n, const ring r)
527{
528  if (n_IsOne(n, r))
529    return p_Copy(p, r);
530  else
531    return r->p_Procs->pp_Mult_nn(p, n, r);
532}
533
534// returns Copy(p)*m, does neither destroy p nor m
535PINLINE2 poly pp_Mult_mm(poly p, poly m, const ring r)
536{
537  if (p_LmIsConstant(m, r))
538    return pp_Mult_nn(p, pGetCoeff(m), r);
539  else
540  {
541    poly last;
542    return r->p_Procs->pp_Mult_mm(p, m, r, last);
543  }
544}
545
546// returns p*m, destroys p, const: m
547PINLINE2 poly p_Mult_mm(poly p, poly m, const ring r)
548{
549  if (p_LmIsConstant(m, r))
550    return p_Mult_nn(p, pGetCoeff(m), r);
551  else
552    return r->p_Procs->p_Mult_mm(p, m, r);
553}
554
555// return p - m*Copy(q), destroys p; const: p,m
556PINLINE2 poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, const ring r)
557{
558#ifdef HAVE_PLURAL
559  if (rIsPluralRing(r))
560  {
561    int lp, lq;
562    poly spNoether;
563    return nc_p_Minus_mm_Mult_qq(p, m, q, lp, lq, spNoether, r);
564  }
565#endif
566
567  int shorter;
568  poly last;
569
570  return r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, NULL, r, last); // !!!
571}
572
573PINLINE2 poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq,
574                                 poly spNoether, const ring r)
575{
576#ifdef HAVE_PLURAL
577  if (rIsPluralRing(r))
578     return nc_p_Minus_mm_Mult_qq(p, m, q, lp, lq, spNoether, r);
579#endif
580
581  int shorter;
582  poly last,res;
583  res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, spNoether, r, last);
584  lp = (lp + lq) - shorter;
585  return res;
586}
587
588PINLINE2 poly pp_Mult_Coeff_mm_DivSelect(poly p, const poly m, const ring r)
589{
590  int shorter;
591  return r->p_Procs->pp_Mult_Coeff_mm_DivSelect(p, m, shorter, r);
592}
593
594PINLINE2 poly pp_Mult_Coeff_mm_DivSelect(poly p, int &lp, const poly m, const ring r)
595{
596  int shorter;
597  poly pp = r->p_Procs->pp_Mult_Coeff_mm_DivSelect(p, m, shorter, r);
598  lp -= shorter;
599  return pp;
600}
601
602// returns -p, destroys p
603PINLINE2 poly p_Neg(poly p, const ring r)
604{
605  return r->p_Procs->p_Neg(p, r);
606}
607
608extern poly  _p_Mult_q(poly p, poly q, const int copy, const ring r);
609// returns p*q, destroys p and q
610PINLINE2 poly p_Mult_q(poly p, poly q, const ring r)
611{
612  if (p == NULL)
613  {
614    r->p_Procs->p_Delete(&q, r);
615    return NULL;
616  }
617  if (q == NULL)
618  {
619    r->p_Procs->p_Delete(&p, r);
620    return NULL;
621  }
622
623  if (pNext(p) == NULL)
624  {
625#ifdef HAVE_PLURAL
626    if (rIsPluralRing(r))
627      q = nc_mm_Mult_p(p, q, r);
628    else
629#endif /* HAVE_PLURAL */
630      q = r->p_Procs->p_Mult_mm(q, p, r);
631
632    r->p_Procs->p_Delete(&p, r);
633    return q;
634  }
635
636  if (pNext(q) == NULL)
637  {
638  // NEEDED
639#ifdef HAVE_PLURAL
640/*    if (rIsPluralRing(r))
641      p = gnc_p_Mult_mm(p, q, r); // ???
642    else*/
643#endif /* HAVE_PLURAL */
644      p = r->p_Procs->p_Mult_mm(p, q, r);
645
646    r->p_Procs->p_Delete(&q, r);
647    return p;
648  }
649#ifdef HAVE_PLURAL
650  if (rIsPluralRing(r))
651    return _nc_p_Mult_q(p, q, r);
652  else
653#endif
654  return _p_Mult_q(p, q, 0, r);
655}
656
657// returns p*q, does neither destroy p nor q
658PINLINE2 poly pp_Mult_qq(poly p, poly q, const ring r)
659{
660  poly last;
661  if (p == NULL || q == NULL) return NULL;
662
663  if (pNext(p) == NULL)
664  {
665#ifdef HAVE_PLURAL
666    if (rIsPluralRing(r))
667      return nc_mm_Mult_pp(p, q, r);
668#endif
669    return r->p_Procs->pp_Mult_mm(q, p, r, last);
670  }
671
672  if (pNext(q) == NULL)
673  {
674    return r->p_Procs->pp_Mult_mm(p, q, r, last);
675  }
676
677  poly qq = q;
678  if (p == q)
679    qq = p_Copy(q, r);
680
681  poly res;
682#ifdef HAVE_PLURAL
683  if (rIsPluralRing(r))
684    res = _nc_pp_Mult_qq(p, qq, r);
685  else
686#endif
687    res = _p_Mult_q(p, qq, 1, r);
688
689  if (qq != q)
690    p_Delete(&qq, r);
691  return res;
692}
693
694// returns p + m*q destroys p, const: q, m
695PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq,
696                                const ring r)
697{
698#ifdef HAVE_PLURAL
699  if (rIsPluralRing(r))
700    return nc_p_Plus_mm_Mult_qq(p, m, q, lp, lq, r);
701#endif
702
703// this should be implemented more efficiently
704  poly res, last;
705  int shorter;
706  number n_old = pGetCoeff(m);
707  number n_neg = n_Copy(n_old, r);
708  n_neg = n_Neg(n_neg, r);
709  pSetCoeff0(m, n_neg);
710  res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, NULL, r, last);
711  lp = (lp + lq) - shorter;
712  pSetCoeff0(m, n_old);
713  n_Delete(&n_neg, r);
714  return res;
715}
716
717PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, const ring r)
718{
719  int lp = 0, lq = 0;
720  return p_Plus_mm_Mult_qq(p, m, q, lp, lq, r);
721}
722
723PINLINE2 poly p_Merge_q(poly p, poly q, const ring r)
724{
725  return r->p_Procs->p_Merge_q(p, q, r);
726}
727
728PINLINE2 poly p_SortAdd(poly p, const ring r, BOOLEAN revert)
729{
730  if (revert) p = pReverse(p);
731  return sBucketSortAdd(p, r);
732}
733
734PINLINE2 poly p_SortMerge(poly p, const ring r, BOOLEAN revert)
735{
736  if (revert) p = pReverse(p);
737  return sBucketSortMerge(p, r);
738}
739
740/***************************************************************
741 *
742 * I/O
743 *
744 ***************************************************************/
745PINLINE2 char*     p_String(poly p, ring p_ring)
746{
747  return p_String(p, p_ring, p_ring);
748}
749PINLINE2 char*     p_String0(poly p, ring p_ring)
750{
751  return p_String0(p, p_ring, p_ring);
752}
753PINLINE2 void      p_Write(poly p, ring p_ring)
754{
755  p_Write(p, p_ring, p_ring);
756}
757PINLINE2 void      p_Write0(poly p, ring p_ring)
758{
759  p_Write0(p, p_ring, p_ring);
760}
761PINLINE2 void      p_wrp(poly p, ring p_ring)
762{
763  p_wrp(p, p_ring, p_ring);
764}
765#endif // !defined(NO_PINLINE2) || defined(POLYS_IMPL_CC)
766#endif // PINLINE2_H
Note: See TracBrowser for help on using the repository browser.