Loading...
Searching...
No Matches
singularWishlist.h
Go to the documentation of this file.
#ifndef SINGULARWISHLIST_H
#define SINGULARWISHLIST_H
#include "polys/monomials/p_polys.h"
#include "libpolys/polys/simpleideals.h"
static inline BOOLEAN _p_LeadmonomDivisibleByNoComp(poly a, poly b, const ring r)
{
int i=r->VarL_Size - 1;
unsigned long divmask = r->divmask;
unsigned long la, lb;
if (r->VarL_LowIndex >= 0)
{
i += r->VarL_LowIndex;
do
{
la = a->exp[i];
lb = b->exp[i];
if ((la > lb) ||
(((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
{
pDivAssume(p_DebugLmDivisibleByNoComp(a, b, r) == FALSE);
return FALSE;
}
i--;
}
while (i>=r->VarL_LowIndex);
}
else
{
do
{
la = a->exp[r->VarL_Offset[i]];
lb = b->exp[r->VarL_Offset[i]];
if ((la > lb) ||
(((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
{
pDivAssume(p_DebugLmDivisibleByNoComp(a, b, r) == FALSE);
return FALSE;
}
i--;
}
while (i>=0);
}
pDivAssume(p_DebugLmDivisibleByNoComp(a, b, r) == TRUE);
return TRUE;
}
/**
* p_LmDivisibleBy checks also the divisibility of coefficients
**/
static inline BOOLEAN p_LeadmonomDivisibleBy(poly a, poly b, const ring r)
{
p_LmCheckPolyRing1(b, r);
pIfThen1(a != NULL, p_LmCheckPolyRing1(b, r));
if (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r))
return _p_LeadmonomDivisibleByNoComp(a, b, r);
return FALSE;
}
/**
* id_ShallowDelete deletes the monomials of the polynomials stored inside of it
**/
static inline void idShallowDelete (ideal *h)
{
if (*h != NULL)
{
int k;
k=(*h)->nrows*(*h)->ncols;
if (k>0)
omFreeSize((ADDRESS)((*h)->m),sizeof(poly)*k);
omFreeBin((ADDRESS)*h, sip_sideal_bin);
*h=NULL;
}
return;
}
static inline void deleteOrdering(ring r)
{
if (r->order != NULL)
{
int i=rBlocks(r);
assume(r->block0 != NULL && r->block1 != NULL && r->wvhdl != NULL);
/* delete order */
omFreeSize((ADDRESS)r->order,i*sizeof(rRingOrder_t));
omFreeSize((ADDRESS)r->block0,i*sizeof(int));
omFreeSize((ADDRESS)r->block1,i*sizeof(int));
/* delete weights */
for (int j=0; j<i; j++)
omfree(r->wvhdl[j]);
omFreeSize((ADDRESS)r->wvhdl,i*sizeof(int *));
}
else
assume(r->block0 == NULL && r->block1 == NULL && r->wvhdl == NULL);
}
void z_Write(number p, ring r);
void id_Write(const ideal I, const ring r);
#endif
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
i
int i
Definition cfEzgcd.cc:132
k
int k
Definition cfEzgcd.cc:99
p
int p
Definition cfModGcd.cc:4086
b
CanonicalForm b
Definition cfModGcd.cc:4111
j
int j
Definition facHensel.cc:110
h
STATIC_VAR Poly * h
Definition janet.cc:971
assume
#define assume(x)
Definition mod2.h:389
p_GetComp
#define p_GetComp(p, r)
Definition monomials.h:64
pIfThen1
#define pIfThen1(cond, check)
Definition monomials.h:179
p_LmCheckPolyRing1
#define p_LmCheckPolyRing1(p, r)
Definition monomials.h:177
omfree
#define omfree(addr)
Definition omAllocDecl.h:237
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260
omFreeBin
#define omFreeBin(addr, bin)
Definition omAllocDecl.h:259
NULL
#define NULL
Definition omList.c:12
p_DebugLmDivisibleByNoComp
BOOLEAN p_DebugLmDivisibleByNoComp(poly a, poly b, ring r)
Definition pDebug.cc:144
p_polys.h
pDivAssume
#define pDivAssume(x)
Definition p_polys.h:1303
rBlocks
static int rBlocks(const ring r)
Definition ring.h:574
rRingOrder_t
rRingOrder_t
order stuff
Definition ring.h:69
sip_sideal_bin
VAR omBin sip_sideal_bin
Definition simpleideals.cc:27
simpleideals.h
_p_LeadmonomDivisibleByNoComp
static BOOLEAN _p_LeadmonomDivisibleByNoComp(poly a, poly b, const ring r)
Definition singularWishlist.h:7
idShallowDelete
static void idShallowDelete(ideal *h)
id_ShallowDelete deletes the monomials of the polynomials stored inside of it
Definition singularWishlist.h:66
id_Write
void id_Write(const ideal I, const ring r)
deleteOrdering
static void deleteOrdering(ring r)
Definition singularWishlist.h:80
z_Write
void z_Write(number p, ring r)
p_LeadmonomDivisibleBy
static BOOLEAN p_LeadmonomDivisibleBy(poly a, poly b, const ring r)
p_LmDivisibleBy checks also the divisibility of coefficients
Definition singularWishlist.h:53