Loading...
Searching...
No Matches
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.
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.

- 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 17 of file kpolys.cc.

{
int k, j;
if (lcm==NULL) return FALSE;
for (j=(R->N); j; j--)
if ( p_GetExp(p,j, R) > p_GetExp(lcm,j, R)) return FALSE;
if ( pGetComp(p) != pGetComp(lcm)) return FALSE;
for (j=(R->N); j; j--)
{
if (p_GetExp(p1,j, R)!=p_GetExp(lcm,j, R))
{
if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
{
for (k=(R->N); k>j; k--)
{
if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
&& (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
return TRUE;
}
for (k=j-1; k; k--)
{
if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
&& (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
return TRUE;
}
return FALSE;
}
}
else if (p_GetExp(p2,j, R)!=p_GetExp(lcm,j, R))
{
if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
{
for (k=(R->N); k>j; k--)
{
if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
&& (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
return TRUE;
}
for (k=j-1; k!=0 ; k--)
{
if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
&& (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
return TRUE;
}
return FALSE;
}
}
}
return FALSE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
k
int k
Definition cfEzgcd.cc:99
p
int p
Definition cfModGcd.cc:4086
j
int j
Definition facHensel.cc:110
lcm
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition minpoly.cc:709
NULL
#define NULL
Definition omList.c:12
p_GetExp
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:471
pGetComp
#define pGetComp(p)
Component.
Definition polys.h:38
R
#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.

{
int k, j;
if (lcm==NULL) return FALSE;
for (j=R->real_var_end; j>=R->real_var_start; j--)
if ( p_GetExp(p,j, R) > p_GetExp(lcm,j, R)) return FALSE;
if ( pGetComp(p) != pGetComp(lcm)) return FALSE;
for (j=R->real_var_end; j>=R->real_var_start; j--)
{
if (p_GetExp(p1,j, R)!=p_GetExp(lcm,j, R))
{
if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
{
for (k=(R->N); k>j; k--)
for (k=R->real_var_end; k>j; k--)
{
if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
&& (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
return TRUE;
}
for (k=j-1; k>=R->real_var_start; k--)
{
if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
&& (p_GetExp(p2,k, R)!=p_GetExp(lcm,k, R)))
return TRUE;
}
return FALSE;
}
}
else if (p_GetExp(p2,j, R)!=p_GetExp(lcm,j, R))
{
if (p_GetExp(p,j, R)!=p_GetExp(lcm,j, R))
{
for (k=R->real_var_end; k>j; k--)
{
if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
&& (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
return TRUE;
}
for (k=j-1; k>=R->real_var_start; k--)
{
if ((p_GetExp(p,k, R)!=p_GetExp(lcm,k, R))
&& (p_GetExp(p1,k, R)!=p_GetExp(lcm,k, R)))
return TRUE;
}
return FALSE;
}
}
}
return FALSE;
}