Functions
kpolys.cc File Reference
#include <kernel/mod2.h>
#include <omalloc/omalloc.h>
#include <misc/auxiliary.h>
#include <kernel/polys.h>

Go to the source code of this file.

Functions

BOOLEAN pCompareChain (poly p, poly p1, poly p2, poly lcm, const ring R)
 Returns TRUE if. More...
 
BOOLEAN pCompareChainPart (poly p, poly p1, poly p2, poly lcm, const ring R)
 

Function Documentation

BOOLEAN pCompareChain ( poly  p,
poly  p1,
poly  p2,
poly  lcm,
const ring  R = currRing 
)

Returns TRUE if.

  • LM(p) | LM(lcm)
  • LC(p) | LC(lcm) only if ring
  • Exists i, j:
    • LE(p, i) != LE(lcm, i)
    • LE(p1, i) != LE(lcm, i) ==> LCM(p1, p) != lcm
    • LE(p, j) != LE(lcm, j)
    • LE(p2, j) != LE(lcm, j) ==> LCM(p2, p) != lcm

Definition at line 21 of file kpolys.cc.

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 }
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
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
const ring R
Definition: DebugPrint.cc:36
#define NULL
Definition: omList.c:10
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
BOOLEAN pCompareChainPart ( poly  p,
poly  p1,
poly  p2,
poly  lcm,
const ring  R 
)

Definition at line 75 of file kpolys.cc.

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 }
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
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
const ring R
Definition: DebugPrint.cc:36
#define NULL
Definition: omList.c:10
END_NAMESPACE const void * p2
Definition: syzextra.cc:202