singularWishlist.h
Go to the documentation of this file.
1 #ifndef SINGULARWISHLIST_H
2 #define SINGULARWISHLIST_H
3 
5 
6 /* #ifndef NDEBUG */
7 /* void z_Write(number p, ring r) */
8 /* { */
9 /* poly g = p_One(r); */
10 /* p_SetCoeff(g,p,r); */
11 /* p_Write(g,r); */
12 /* return; */
13 /* } */
14 /* #endif */
15 
16 static inline BOOLEAN _p_LeadmonomDivisibleByNoComp(poly a, poly b, const ring r)
17 {
18  int i=r->VarL_Size - 1;
19  unsigned long divmask = r->divmask;
20  unsigned long la, lb;
21 
22  if (r->VarL_LowIndex >= 0)
23  {
24  i += r->VarL_LowIndex;
25  do
26  {
27  la = a->exp[i];
28  lb = b->exp[i];
29  if ((la > lb) ||
30  (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
31  {
33  return FALSE;
34  }
35  i--;
36  }
37  while (i>=r->VarL_LowIndex);
38  }
39  else
40  {
41  do
42  {
43  la = a->exp[r->VarL_Offset[i]];
44  lb = b->exp[r->VarL_Offset[i]];
45  if ((la > lb) ||
46  (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
47  {
49  return FALSE;
50  }
51  i--;
52  }
53  while (i>=0);
54  }
56  return TRUE;
57 }
58 
59 /**
60  * p_LmDivisibleBy checks also the divisibility of coefficients
61  **/
62 static inline BOOLEAN p_LeadmonomDivisibleBy(poly a, poly b, const ring r)
63 {
64  p_LmCheckPolyRing1(b, r);
65 
66  pIfThen1(a != NULL, p_LmCheckPolyRing1(b, r));
67  if (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r))
68  return _p_LeadmonomDivisibleByNoComp(a, b, r);
69  return FALSE;
70 }
71 
72 /**
73  * id_ShallowDelete deletes the monomials of the polynomials stored inside of it
74  **/
75 inline void idShallowDelete (ideal *h)
76 {
77  if (*h != NULL)
78  {
79  int k;
80  k=(*h)->nrows*(*h)->ncols;
81  if (k>0)
82  omFreeSize((ADDRESS)((*h)->m),sizeof(poly)*k);
84  *h=NULL;
85  }
86  return;
87 }
88 
89 #endif
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
omBin sip_sideal_bin
Definition: simpleideals.cc:30
#define p_GetComp(p, r)
Definition: monomials.h:72
BOOLEAN p_DebugLmDivisibleByNoComp(poly a, poly b, ring r)
Definition: pDebug.cc:140
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define TRUE
Definition: auxiliary.h:144
void * ADDRESS
Definition: auxiliary.h:161
int k
Definition: cfEzgcd.cc:93
static BOOLEAN _p_LeadmonomDivisibleByNoComp(poly a, poly b, const ring r)
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:185
#define pIfThen1(cond, check)
Definition: monomials.h:187
#define NULL
Definition: omList.c:10
#define pDivAssume(x)
Definition: p_polys.h:1211
polyrec * poly
Definition: hilb.h:10
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
const poly b
Definition: syzextra.cc:213
static BOOLEAN p_LeadmonomDivisibleBy(poly a, poly b, const ring r)
p_LmDivisibleBy checks also the divisibility of coefficients
void idShallowDelete(ideal *h)
id_ShallowDelete deletes the monomials of the polynomials stored inside of it