source: git/polys/pInline2.h @ e4e36c

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