source: git/kernel/pInline2.h @ 06662e

spielwiese
Last change on this file since 06662e was 959263, checked in by Hans Schoenemann <hannes@…>, 14 years ago
removed pIncrComp,pDecrComp git-svn-id: file:///usr/local/Singular/svn/trunk@12950 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 17.3 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 "numbers.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: case ro_isTemp:  case ro_is:
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 int 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  int exp=(p->exp[pos] >> bitmask) & iBitmask;
122  return exp;
123#else
124  return (int)
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 int p_SetExp(poly p, const int e, const unsigned long iBitmask, const int VarOffset)
135{
136  pAssume2(e>=0);
137  pAssume2((unsigned long) 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 = ((unsigned long)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 int 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  int bitmask = BitMask(iBitmask, hbyte >> 6);
173
174  int exp=(p->exp[pos] >> bitpos) & bitmask;
175  return exp;
176
177}
178
179PINLINE2 int p_SetExp(poly p, const int e, const unsigned long iBitmask, const int VarOffset)
180{
181  pAssume2(e>=0);
182  pAssume2((unsigned long) 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  unsigned long ee = ((unsigned long)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 int 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 int p_SetExp(poly p, const int 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 int 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 int p_SetExp(poly p, const int v, const int 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  int 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  int 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  int p_AddExp(poly p, int v, int 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  int p_SubExp(poly p, int v, int ee, ring r)
264{
265  p_LmCheckPolyRing2(p, r);
266  int e = p_GetExp(p,v,r);
267  pAssume2(e >= ee);
268  e -= ee;
269  return p_SetExp(p,v,e,r);
270}
271PINLINE2  int p_MultExp(poly p, int v, int ee, ring r)
272{
273  p_LmCheckPolyRing2(p, r);
274  int e = p_GetExp(p,v,r);
275  e *= ee;
276  return p_SetExp(p,v,e,r);
277}
278
279PINLINE2 int 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 int 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 && r->PolyBin->sizeW == bin->sizeW);
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(poly p, ring r)
368{
369  return p_GetMaxExp(p_GetMaxExpL(p, r), r);
370}
371
372PINLINE2 unsigned long
373p_GetMaxExp(const unsigned long l, const ring r, const int number_of_exps)
374{
375  unsigned long bitmask = r->bitmask;
376  unsigned long max = (l & bitmask);
377  unsigned long j = number_of_exps - 1;
378
379  if (j > 0)
380  {
381    unsigned long i = r->BitsPerExp;
382    long e;
383    loop
384    {
385      e = ((l >> i) & bitmask);
386      if ((unsigned long) e > max)
387        max = e;
388      j--;
389      if (j==0) break;
390      i += r->BitsPerExp;
391    }
392  }
393  return max;
394}
395
396PINLINE2 unsigned long p_GetMaxExp(const unsigned long l, const ring r)
397{
398  return p_GetMaxExp(l, r, r->ExpPerLong);
399}
400
401PINLINE2 unsigned long
402p_GetTotalDegree(const unsigned long l, const ring r, const int number_of_exps)
403{
404  const unsigned long bitmask = r->bitmask;
405  unsigned long sum = (l & bitmask);
406  unsigned long j = number_of_exps - 1;
407
408  if (j > 0)
409  {
410    unsigned long i = r->BitsPerExp;
411    loop
412    {
413      sum += ((l >> i) & bitmask);
414      j--;
415      if (j==0) break;
416      i += r->BitsPerExp;
417    }
418  }
419  return sum;
420}
421
422PINLINE2 unsigned long
423p_GetTotalDegree(const unsigned long l, const ring r)
424{
425  return p_GetTotalDegree(l, r, r->ExpPerLong);
426}
427
428/***************************************************************
429 *
430 * Dispatcher to r->p_Procs, they do the tests/checks
431 *
432 ***************************************************************/
433// returns a copy of p
434PINLINE2 poly p_Copy(poly p, const ring r)
435{
436#ifdef PDEBUG
437  poly pp= r->p_Procs->p_Copy(p, r);
438  p_Test(pp,r);
439  return pp;
440#else
441  return r->p_Procs->p_Copy(p, r);
442#endif
443}
444
445PINLINE2 poly p_Copy(poly p, const ring lmRing, const ring tailRing)
446{
447#ifndef PDEBUG
448  if (tailRing == lmRing)
449    return tailRing->p_Procs->p_Copy(p, tailRing);
450#endif
451  if (p != NULL)
452  {
453    poly pres = p_Head(p, lmRing);
454    pNext(pres) = tailRing->p_Procs->p_Copy(pNext(p), tailRing);
455    return pres;
456  }
457  else
458    return NULL;
459}
460
461// deletes *p, and sets *p to NULL
462PINLINE2 void p_Delete(poly *p, const ring r)
463{
464  r->p_Procs->p_Delete(p, r);
465}
466
467PINLINE2 void p_Delete(poly *p,  const ring lmRing, const ring tailRing)
468{
469#ifndef PDEBUG
470  if (tailRing == lmRing)
471  {
472    tailRing->p_Procs->p_Delete(p, tailRing);
473    return;
474  }
475#endif
476  if (*p != NULL)
477  {
478    if (pNext(*p) != NULL)
479      tailRing->p_Procs->p_Delete(&pNext(*p), tailRing);
480    p_LmDelete(p, lmRing);
481  }
482}
483
484PINLINE2 poly p_ShallowCopyDelete(poly p, const ring r, omBin bin)
485{
486  p_LmCheckPolyRing2(p, r);
487  pAssume2(r->PolyBin->sizeW == bin->sizeW);
488  return r->p_Procs->p_ShallowCopyDelete(p, r, bin);
489}
490
491// returns p+q, destroys p and q
492PINLINE2 poly p_Add_q(poly p, poly q, const ring r)
493{
494  int shorter;
495  return r->p_Procs->p_Add_q(p, q, shorter, r);
496}
497
498PINLINE2 poly p_Add_q(poly p, poly q, int &lp, int lq, const ring r)
499{
500  int shorter;
501  poly res = r->p_Procs->p_Add_q(p, q, shorter, r);
502  lp = (lp + lq) - shorter;
503  return res;
504}
505
506// returns p*n, destroys p
507PINLINE2 poly p_Mult_nn(poly p, number n, const ring r)
508{
509  if (n_IsOne(n, r))
510    return p;
511  else
512    return r->p_Procs->p_Mult_nn(p, n, r);
513}
514
515PINLINE2 poly p_Mult_nn(poly p, number n, const ring lmRing,
516                        const ring tailRing)
517{
518#ifndef PDEBUG
519  if (lmRing == tailRing)
520  {
521    return p_Mult_nn(p, n, tailRing);
522  }
523#endif
524  poly pnext = pNext(p);
525  pNext(p) = NULL;
526  p = lmRing->p_Procs->p_Mult_nn(p, n, lmRing);
527  pNext(p) = tailRing->p_Procs->p_Mult_nn(pnext, n, tailRing);
528  return p;
529}
530
531// returns p*n, does not destroy p
532PINLINE2 poly pp_Mult_nn(poly p, number n, const ring r)
533{
534  if (n_IsOne(n, r))
535    return p_Copy(p, r);
536  else
537    return r->p_Procs->pp_Mult_nn(p, n, r);
538}
539
540// returns Copy(p)*m, does neither destroy p nor m
541PINLINE2 poly pp_Mult_mm(poly p, poly m, const ring r)
542{
543  if (p_LmIsConstant(m, r))
544    return pp_Mult_nn(p, pGetCoeff(m), r);
545  else
546  {
547    poly last;
548    return r->p_Procs->pp_Mult_mm(p, m, r, last);
549  }
550}
551
552// returns p*m, destroys p, const: m
553PINLINE2 poly p_Mult_mm(poly p, poly m, const ring r)
554{
555  if (p_LmIsConstant(m, r))
556    return p_Mult_nn(p, pGetCoeff(m), r);
557  else
558    return r->p_Procs->p_Mult_mm(p, m, r);
559}
560
561// return p - m*Copy(q), destroys p; const: p,m
562PINLINE2 poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, const ring r)
563{
564#ifdef HAVE_PLURAL
565  if (rIsPluralRing(r))
566  {
567    int lp, lq;
568    poly spNoether;
569    return nc_p_Minus_mm_Mult_qq(p, m, q, lp, lq, spNoether, r);
570  }
571#endif
572
573  int shorter;
574  poly last;
575
576  return r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, NULL, r, last); // !!!
577}
578
579PINLINE2 poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq,
580                                 poly spNoether, const ring r)
581{
582#ifdef HAVE_PLURAL
583  if (rIsPluralRing(r))
584     return nc_p_Minus_mm_Mult_qq(p, m, q, lp, lq, spNoether, r);
585#endif
586
587  int shorter;
588  poly last,res;
589  res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, spNoether, r, last);
590  lp = (lp + lq) - shorter;
591  return res;
592}
593
594PINLINE2 poly pp_Mult_Coeff_mm_DivSelect(poly p, const poly m, const ring r)
595{
596  int shorter;
597  return r->p_Procs->pp_Mult_Coeff_mm_DivSelect(p, m, shorter, r);
598}
599
600PINLINE2 poly pp_Mult_Coeff_mm_DivSelect(poly p, int &lp, const poly m, const ring r)
601{
602  int shorter;
603  poly pp = r->p_Procs->pp_Mult_Coeff_mm_DivSelect(p, m, shorter, r);
604  lp -= shorter;
605  return pp;
606}
607
608// returns -p, destroys p
609PINLINE2 poly p_Neg(poly p, const ring r)
610{
611  return r->p_Procs->p_Neg(p, r);
612}
613
614extern poly  _p_Mult_q(poly p, poly q, const int copy, const ring r);
615// returns p*q, destroys p and q
616PINLINE2 poly p_Mult_q(poly p, poly q, const ring r)
617{
618  if (p == NULL)
619  {
620    r->p_Procs->p_Delete(&q, r);
621    return NULL;
622  }
623  if (q == NULL)
624  {
625    r->p_Procs->p_Delete(&p, r);
626    return NULL;
627  }
628
629  if (pNext(p) == NULL)
630  {
631#ifdef HAVE_PLURAL
632    if (rIsPluralRing(r))
633      q = nc_mm_Mult_p(p, q, r);
634    else
635#endif /* HAVE_PLURAL */
636      q = r->p_Procs->p_Mult_mm(q, p, r);
637
638    r->p_Procs->p_Delete(&p, r);
639    return q;
640  }
641
642  if (pNext(q) == NULL)
643  {
644  // NEEDED
645#ifdef HAVE_PLURAL
646/*    if (rIsPluralRing(r))
647      p = gnc_p_Mult_mm(p, q, r); // ???
648    else*/
649#endif /* HAVE_PLURAL */
650      p = r->p_Procs->p_Mult_mm(p, q, r);
651
652    r->p_Procs->p_Delete(&q, r);
653    return p;
654  }
655#ifdef HAVE_PLURAL
656  if (rIsPluralRing(r))
657    return _nc_p_Mult_q(p, q, r);
658  else
659#endif
660  return _p_Mult_q(p, q, 0, r);
661}
662
663// returns p*q, does neither destroy p nor q
664PINLINE2 poly pp_Mult_qq(poly p, poly q, const ring r)
665{
666  poly last;
667  if (p == NULL || q == NULL) return NULL;
668
669  if (pNext(p) == NULL)
670  {
671#ifdef HAVE_PLURAL
672    if (rIsPluralRing(r))
673      return nc_mm_Mult_pp(p, q, r);
674#endif
675    return r->p_Procs->pp_Mult_mm(q, p, r, last);
676  }
677
678  if (pNext(q) == NULL)
679  {
680    return r->p_Procs->pp_Mult_mm(p, q, r, last);
681  }
682
683  poly qq = q;
684  if (p == q)
685    qq = p_Copy(q, r);
686
687  poly res;
688#ifdef HAVE_PLURAL
689  if (rIsPluralRing(r))
690    res = _nc_pp_Mult_qq(p, qq, r);
691  else
692#endif
693    res = _p_Mult_q(p, qq, 1, r);
694
695  if (qq != q)
696    p_Delete(&qq, r);
697  return res;
698}
699
700// returns p + m*q destroys p, const: q, m
701PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq,
702                                const ring r)
703{
704#ifdef HAVE_PLURAL
705  if (rIsPluralRing(r))
706    return nc_p_Plus_mm_Mult_qq(p, m, q, lp, lq, r);
707#endif
708
709// this should be implemented more efficiently
710  poly res, last;
711  int shorter;
712  number n_old = pGetCoeff(m);
713  number n_neg = n_Copy(n_old, r);
714  n_neg = n_Neg(n_neg, r);
715  pSetCoeff0(m, n_neg);
716  res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, NULL, r, last);
717  lp = (lp + lq) - shorter;
718  pSetCoeff0(m, n_old);
719  n_Delete(&n_neg, r);
720  return res;
721}
722
723PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, const ring r)
724{
725  int lp = 0, lq = 0;
726  return p_Plus_mm_Mult_qq(p, m, q, lp, lq, r);
727}
728
729PINLINE2 poly p_Merge_q(poly p, poly q, const ring r)
730{
731  return r->p_Procs->p_Merge_q(p, q, r);
732}
733
734PINLINE2 poly p_SortAdd(poly p, const ring r, BOOLEAN revert)
735{
736  if (revert) p = pReverse(p);
737  return sBucketSortAdd(p, r);
738}
739
740PINLINE2 poly p_SortMerge(poly p, const ring r, BOOLEAN revert)
741{
742  if (revert) p = pReverse(p);
743  return sBucketSortMerge(p, r);
744}
745
746/***************************************************************
747 *
748 * I/O
749 *
750 ***************************************************************/
751PINLINE2 char*     p_String(poly p, ring p_ring)
752{
753  return p_String(p, p_ring, p_ring);
754}
755PINLINE2 char*     p_String0(poly p, ring p_ring)
756{
757  return p_String0(p, p_ring, p_ring);
758}
759PINLINE2 void      p_Write(poly p, ring p_ring)
760{
761  p_Write(p, p_ring, p_ring);
762}
763PINLINE2 void      p_Write0(poly p, ring p_ring)
764{
765  p_Write0(p, p_ring, p_ring);
766}
767PINLINE2 void      p_wrp(poly p, ring p_ring)
768{
769  p_wrp(p, p_ring, p_ring);
770}
771#endif // !defined(NO_PINLINE2) || defined(POLYS_IMPL_CC)
772#endif // PINLINE2_H
Note: See TracBrowser for help on using the repository browser.