Loading...
Searching...
No Matches
kpolys.cc
Go to the documentation of this file.
#include "kernel/mod2.h"
#include "kernel/polys.h"
/* 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
*/
BOOLEAN pCompareChain (poly p,poly p1,poly p2,poly lcm, const ring R)
{
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;
}
#ifdef HAVE_RATGRING
BOOLEAN pCompareChainPart (poly p,poly p1,poly p2,poly lcm, const ring R)
{
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;
}
#endif
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
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
pCompareChainPart
BOOLEAN pCompareChainPart(poly p, poly p1, poly p2, poly lcm, const ring R)
Definition kpolys.cc:71
pCompareChain
BOOLEAN pCompareChain(poly p, poly p1, poly p2, poly lcm, const ring R)
Returns TRUE if.
Definition kpolys.cc:17
lcm
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition minpoly.cc:709
mod2.h
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
polys.h
Compatibility layer for legacy polynomial operations (over currRing).
pGetComp
#define pGetComp(p)
Component.
Definition polys.h:38
R
#define R
Definition sirandom.c:27