My Project
singularWishlist.h
Go to the documentation of this file.
1 #ifndef SINGULARWISHLIST_H
2 #define SINGULARWISHLIST_H
3 
6 
7 static inline BOOLEAN _p_LeadmonomDivisibleByNoComp(poly a, poly b, const ring r)
8 {
9  int i=r->VarL_Size - 1;
10  unsigned long divmask = r->divmask;
11  unsigned long la, lb;
12 
13  if (r->VarL_LowIndex >= 0)
14  {
15  i += r->VarL_LowIndex;
16  do
17  {
18  la = a->exp[i];
19  lb = b->exp[i];
20  if ((la > lb) ||
21  (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
22  {
24  return FALSE;
25  }
26  i--;
27  }
28  while (i>=r->VarL_LowIndex);
29  }
30  else
31  {
32  do
33  {
34  la = a->exp[r->VarL_Offset[i]];
35  lb = b->exp[r->VarL_Offset[i]];
36  if ((la > lb) ||
37  (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
38  {
40  return FALSE;
41  }
42  i--;
43  }
44  while (i>=0);
45  }
47  return TRUE;
48 }
49 
50 /**
51  * p_LmDivisibleBy checks also the divisibility of coefficients
52  **/
53 static inline BOOLEAN p_LeadmonomDivisibleBy(poly a, poly b, const ring r)
54 {
56 
57  pIfThen1(a != NULL, p_LmCheckPolyRing1(b, r));
58  if (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r))
59  return _p_LeadmonomDivisibleByNoComp(a, b, r);
60  return FALSE;
61 }
62 
63 /**
64  * id_ShallowDelete deletes the monomials of the polynomials stored inside of it
65  **/
66 static inline void idShallowDelete (ideal *h)
67 {
68  if (*h != NULL)
69  {
70  int k;
71  k=(*h)->nrows*(*h)->ncols;
72  if (k>0)
73  omFreeSize((ADDRESS)((*h)->m),sizeof(poly)*k);
75  *h=NULL;
76  }
77  return;
78 }
79 
80 static inline void deleteOrdering(ring r)
81 {
82  if (r->order != NULL)
83  {
84  int i=rBlocks(r);
85  assume(r->block0 != NULL && r->block1 != NULL && r->wvhdl != NULL);
86  /* delete order */
87  omFreeSize((ADDRESS)r->order,i*sizeof(rRingOrder_t));
88  omFreeSize((ADDRESS)r->block0,i*sizeof(int));
89  omFreeSize((ADDRESS)r->block1,i*sizeof(int));
90  /* delete weights */
91  for (int j=0; j<i; j++)
92  omfree(r->wvhdl[j]);
93  omFreeSize((ADDRESS)r->wvhdl,i*sizeof(int *));
94  }
95  else
96  assume(r->block0 == NULL && r->block1 == NULL && r->wvhdl == NULL);
97 }
98 
99 
100 void z_Write(number p, ring r);
101 void id_Write(const ideal I, const ring r);
102 
103 
104 #endif
int BOOLEAN
Definition: auxiliary.h:87
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
void * ADDRESS
Definition: auxiliary.h:119
int i
Definition: cfEzgcd.cc:132
int k
Definition: cfEzgcd.cc:99
int p
Definition: cfModGcd.cc:4080
CanonicalForm b
Definition: cfModGcd.cc:4105
int j
Definition: facHensel.cc:110
STATIC_VAR Poly * h
Definition: janet.cc:971
#define assume(x)
Definition: mod2.h:387
#define p_GetComp(p, r)
Definition: monomials.h:64
#define pIfThen1(cond, check)
Definition: monomials.h:179
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:177
#define omfree(addr)
Definition: omAllocDecl.h:237
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
#define NULL
Definition: omList.c:12
BOOLEAN p_DebugLmDivisibleByNoComp(poly a, poly b, ring r)
Definition: pDebug.cc:139
#define pDivAssume(x)
Definition: p_polys.h:1242
static int rBlocks(ring r)
Definition: ring.h:573
rRingOrder_t
order stuff
Definition: ring.h:68
VAR omBin sip_sideal_bin
Definition: simpleideals.cc:27
static BOOLEAN _p_LeadmonomDivisibleByNoComp(poly a, poly b, const ring r)
static void idShallowDelete(ideal *h)
id_ShallowDelete deletes the monomials of the polynomials stored inside of it
void id_Write(const ideal I, const ring r)
static void deleteOrdering(ring r)
void z_Write(number p, ring r)
static BOOLEAN p_LeadmonomDivisibleBy(poly a, poly b, const ring r)
p_LmDivisibleBy checks also the divisibility of coefficients