jengelh-datetimespielwiese
Last change
on this file since fa167e was
fa167e,
checked in by Yue Ren <ren@…>, 9 years ago
|
new: pReduce(poly g, const number p)
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | #ifndef SINGULARWISHLIST_H |
---|
2 | #define SINGULARWISHLIST_H |
---|
3 | |
---|
4 | #include <libpolys/polys/monomials/p_polys.h> |
---|
5 | |
---|
6 | static inline BOOLEAN _p_LeadmonomDivisibleByNoComp(poly a, poly b, const ring r) |
---|
7 | { |
---|
8 | int i=r->VarL_Size - 1; |
---|
9 | unsigned long divmask = r->divmask; |
---|
10 | unsigned long la, lb; |
---|
11 | |
---|
12 | if (r->VarL_LowIndex >= 0) |
---|
13 | { |
---|
14 | i += r->VarL_LowIndex; |
---|
15 | do |
---|
16 | { |
---|
17 | la = a->exp[i]; |
---|
18 | lb = b->exp[i]; |
---|
19 | if ((la > lb) || |
---|
20 | (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))) |
---|
21 | { |
---|
22 | pDivAssume(p_DebugLmDivisibleByNoComp(a, b, r) == FALSE); |
---|
23 | return FALSE; |
---|
24 | } |
---|
25 | i--; |
---|
26 | } |
---|
27 | while (i>=r->VarL_LowIndex); |
---|
28 | } |
---|
29 | else |
---|
30 | { |
---|
31 | do |
---|
32 | { |
---|
33 | la = a->exp[r->VarL_Offset[i]]; |
---|
34 | lb = b->exp[r->VarL_Offset[i]]; |
---|
35 | if ((la > lb) || |
---|
36 | (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))) |
---|
37 | { |
---|
38 | pDivAssume(p_DebugLmDivisibleByNoComp(a, b, r) == FALSE); |
---|
39 | return FALSE; |
---|
40 | } |
---|
41 | i--; |
---|
42 | } |
---|
43 | while (i>=0); |
---|
44 | } |
---|
45 | pDivAssume(p_DebugLmDivisibleByNoComp(a, b, r) == TRUE); |
---|
46 | return TRUE; |
---|
47 | } |
---|
48 | |
---|
49 | static inline BOOLEAN p_LeadmonomDivisibleBy(poly a, poly b, const ring r) |
---|
50 | { |
---|
51 | p_LmCheckPolyRing1(b, r); |
---|
52 | |
---|
53 | pIfThen1(a != NULL, p_LmCheckPolyRing1(b, r)); |
---|
54 | if (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r)) |
---|
55 | return _p_LeadmonomDivisibleByNoComp(a, b, r); |
---|
56 | return FALSE; |
---|
57 | } |
---|
58 | |
---|
59 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.