spielwiese
Last change
on this file since 5a3ae8 was
5a3ae8,
checked in by Hans Schoenemann <hannes@…>, 13 years ago
|
p_SetCompP -> p_polys.h
|
-
Property mode set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[35aab3] | 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 |
---|
[341696] | 9 | * Version: $Id$ |
---|
[35aab3] | 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 | |
---|
[6bec87] | 20 | #include <polys/monomials/p_polys.h> |
---|
[20b794] | 21 | #include <polys/monomials/ring.h> |
---|
[35aab3] | 22 | |
---|
| 23 | // returns minimal column number in the modul element a (or 0) |
---|
| 24 | BOOLEAN 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 | ***************************************************************/ |
---|
| 41 | PINLINE0 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 | */ |
---|
| 63 | PINLINE0 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) |
---|
[48884f2] | 77 | * respect syzComp |
---|
[35aab3] | 78 | */ |
---|
[48884f2] | 79 | poly pLast(poly a, int &l); |
---|
[35aab3] | 80 | |
---|
| 81 | #endif // PINLINE_CC |
---|
| 82 | |
---|
Note: See
TracBrowser
for help on using the repository browser.