[35aab3] | 1 | #ifndef POLYS_IMPL_H |
---|
| 2 | #define POLYS_IMPL_H |
---|
| 3 | /**************************************** |
---|
| 4 | * Computer Algebra System SINGULAR * |
---|
| 5 | ****************************************/ |
---|
[341696] | 6 | /* $Id$ */ |
---|
[35aab3] | 7 | |
---|
| 8 | /*************************************************************** |
---|
| 9 | * |
---|
| 10 | * File: polys-impl.h |
---|
| 11 | * Purpose: low-level and macro definition of polys |
---|
| 12 | * |
---|
| 13 | * If you touch anything here, you better know what you are doing. |
---|
| 14 | * What is here should not be used directly from other routines -- the |
---|
| 15 | * encapsulations in polys.h should be used, instead. |
---|
| 16 | * |
---|
| 17 | ***************************************************************/ |
---|
[3fe3da0] | 18 | #include <omalloc.h> |
---|
[01e7a1d] | 19 | #include <coeffs.h> |
---|
[35aab3] | 20 | |
---|
| 21 | #define POLYSIZE (sizeof(poly) + sizeof(number)) |
---|
| 22 | #define POLYSIZEW (POLYSIZE / sizeof(long)) |
---|
[e784726] | 23 | #if SIZEOF_LONG == 8 |
---|
| 24 | #define POLY_NEGWEIGHT_OFFSET (((long)0x80000000) << 32) |
---|
| 25 | #else |
---|
| 26 | #define POLY_NEGWEIGHT_OFFSET ((long)0x80000000) |
---|
| 27 | #endif |
---|
| 28 | |
---|
[35aab3] | 29 | |
---|
| 30 | /*************************************************************** |
---|
| 31 | * |
---|
| 32 | * Macros for low-level allocation |
---|
| 33 | * |
---|
| 34 | ***************************************************************/ |
---|
| 35 | #ifdef PDEBUG |
---|
| 36 | #define p_AllocBin(p, bin, r) \ |
---|
| 37 | do \ |
---|
| 38 | { \ |
---|
| 39 | omTypeAllocBin(poly, p, bin); \ |
---|
| 40 | p_SetRingOfLm(p, r); \ |
---|
| 41 | } \ |
---|
| 42 | while (0) |
---|
| 43 | #define p_FreeBinAddr(p, r) p_LmFree(p, r) |
---|
| 44 | #else |
---|
| 45 | #define p_AllocBin(p, bin, r) omTypeAllocBin(poly, p, bin) |
---|
| 46 | #define p_FreeBinAddr(p, r) omFreeBinAddr(p) |
---|
| 47 | #endif |
---|
| 48 | |
---|
| 49 | /*************************************************************** |
---|
| 50 | * |
---|
| 51 | * Misc macros |
---|
| 52 | * |
---|
| 53 | ***************************************************************/ |
---|
| 54 | #define rRing_has_Comp(r) (r->pCompIndex >= 0) |
---|
| 55 | |
---|
| 56 | #endif // POLYS_IMPL_H |
---|