My Project
Loading...
Searching...
No Matches
kpolys.cc
Go to the documentation of this file.
1
2
3
4#include "kernel/mod2.h"
5
6#include "kernel/polys.h"
7
8/* Returns TRUE if
9 * LM(p) | LM(lcm)
10 * LC(p) | LC(lcm) only if ring
11 * Exists i, j:
12 * LE(p, i) != LE(lcm, i)
13 * LE(p1, i) != LE(lcm, i) ==> LCM(p1, p) != lcm
14 * LE(p, j) != LE(lcm, j)
15 * LE(p2, j) != LE(lcm, j) ==> LCM(p2, p) != lcm
16*/
17BOOLEAN pCompareChain (poly p,poly p1,poly p2,poly lcm, const ring R)
18{
19 int k, j;
20
21 if (lcm==NULL) return FALSE;
22
23 for (j=(R->N); j; j--)
24 if ( p_GetExp(p,j, R) > p_GetExp(lcm,j, R)) return FALSE;
25 if ( pGetComp(p) != pGetComp(lcm)) return FALSE;
26 for (j=(R->N); j; j--)
27 {
28 if (p_GetExp(p1,j, R)!=p_GetExp(lcm,j, R))
29 {
30 if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
31 {
32 for (k=(R->N); k>j; k--)
33 {
34 if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
35 && (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
36 return TRUE;
37 }
38 for (k=j-1; k; k--)
39 {
40 if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
41 && (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
42 return TRUE;
43 }
44 return FALSE;
45 }
46 }
47 else if (p_GetExp(p2,j, R)!=p_GetExp(lcm,j, R))
48 {
49 if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
50 {
51 for (k=(R->N); k>j; k--)
52 {
53 if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
54 && (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
55 return TRUE;
56 }
57 for (k=j-1; k!=0 ; k--)
58 {
59 if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
60 && (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
61 return TRUE;
62 }
63 return FALSE;
64 }
65 }
66 }
67 return FALSE;
68}
69
70#ifdef HAVE_RATGRING
71BOOLEAN pCompareChainPart (poly p,poly p1,poly p2,poly lcm, const ring R)
72{
73 int k, j;
74
75 if (lcm==NULL) return FALSE;
76
77 for (j=R->real_var_end; j>=R->real_var_start; j--)
78 if ( p_GetExp(p,j, R) > p_GetExp(lcm,j, R)) return FALSE;
79 if ( pGetComp(p) != pGetComp(lcm)) return FALSE;
80 for (j=R->real_var_end; j>=R->real_var_start; j--)
81 {
82 if (p_GetExp(p1,j, R)!=p_GetExp(lcm,j, R))
83 {
84 if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
85 {
86 for (k=(R->N); k>j; k--)
87 for (k=R->real_var_end; k>j; k--)
88 {
89 if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
90 && (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
91 return TRUE;
92 }
93 for (k=j-1; k>=R->real_var_start; k--)
94 {
95 if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
96 && (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
97 return TRUE;
98 }
99 return FALSE;
100 }
101 }
102 else if (p_GetExp(p2,j, R)!=p_GetExp(lcm,j, R))
103 {
104 if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
105 {
106 for (k=R->real_var_end; k>j; k--)
107 {
108 if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
109 && (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
110 return TRUE;
111 }
112 for (k=j-1; k>=R->real_var_start; k--)
113 {
114 if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
115 && (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
116 return TRUE;
117 }
118 return FALSE;
119 }
120 }
121 }
122 return FALSE;
123}
124#endif
125
int BOOLEAN
Definition: auxiliary.h:87
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
int k
Definition: cfEzgcd.cc:99
int p
Definition: cfModGcd.cc:4078
int j
Definition: facHensel.cc:110
BOOLEAN pCompareChainPart(poly p, poly p1, poly p2, poly lcm, const ring R)
Definition: kpolys.cc:71
BOOLEAN pCompareChain(poly p, poly p1, poly p2, poly lcm, const ring R)
Returns TRUE if.
Definition: kpolys.cc:17
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:709
#define NULL
Definition: omList.c:12
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition: p_polys.h:467
Compatibility layer for legacy polynomial operations (over currRing)
#define pGetComp(p)
Component.
Definition: polys.h:37
#define R
Definition: sirandom.c:27