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