# source:git/libpolys/polys/pInline0.h@5a3ae8

spielwiese
Last change on this file since 5a3ae8 was 5a3ae8, checked in by Hans Schoenemann <hannes@…>, 12 years ago
p_SetCompP -> p_polys.h
• Property mode set to `100644`
File size: 1.5 KB
Line
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/***************************************************************
5 *  File:    pInline.cc
6 *  Purpose: implementation of poly Level 0 functions
7 *  Author:  obachman (Olaf Bachmann)
8 *  Created: 8/00
9 *  Version: \$Id\$
10 *******************************************************************/
11#ifndef PINLINE0_H
12#define PINLINE0_H
13
14#if defined(DO_PINLINE0)
15#define PINLINE0 static inline
16#else
17#define PINLINE0
18#endif
19
20#include <polys/monomials/p_polys.h>
21#include <polys/monomials/ring.h>
22
23// returns minimal column number in the modul element a (or 0)
24BOOLEAN   p_IsConstantPoly(const poly p, const ring r)
25{
26  poly pp=p;
27  while(pp!=NULL)
28  {
29    if (! p_LmIsConstantComp(pp, r))
30      return FALSE;
31    pIter(pp);
32  }
33  return TRUE;
34}
35
36/***************************************************************
37 *
38 * poly things which are independent of ring
39 *
40 ***************************************************************/
41PINLINE0 poly pReverse(poly p)
42{
43  if (p == NULL || pNext(p) == NULL) return p;
44
45  poly q = pNext(p), // == pNext(p)
46    qn;
47  pNext(p) = NULL;
48  do
49  {
50    qn = pNext(q);
51    pNext(q) = p;
52    p = q;
53    q = qn;
54  }
55  while (qn != NULL);
56  return p;
57}
58
59
60/*2
61* returns the length of a (numbers of monomials)
62*/
63PINLINE0 int pLength(poly a)
64{
65  int l = 0;
66
67  while (a!=NULL)
68  {
69    pIter(a);
70    l++;
71  }
72  return l;
73}
74
75/*2
76* returns the length of a (numbers of monomials)
77* respect syzComp
78*/
79poly pLast(poly a, int &l);
80
81#endif // PINLINE_CC
82
Note: See TracBrowser for help on using the repository browser.