My Project
Loading...
Searching...
No Matches
Functions
kpolys.cc File Reference
#include "kernel/mod2.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

◆ pCompareChain()

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

Returns TRUE if.

Definition at line 17 of file kpolys.cc.

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}
#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
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
#define pGetComp(p)
Component.
Definition: polys.h:37
#define R
Definition: sirandom.c:27

◆ pCompareChainPart()

BOOLEAN pCompareChainPart ( poly  p,
poly  p1,
poly  p2,
poly  lcm,
const ring  R 
)

Definition at line 71 of file kpolys.cc.

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}