MCPcopy Create free account
hub / github.com/Singular/Singular / pDivComp

Function pDivComp

kernel/GBEngine/kutil.cc:181–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181static inline int pDivComp(poly p, poly q)
182{
183 if ((currRing->pCompIndex < 0)
184 || (__p_GetComp(p,currRing) == __p_GetComp(q,currRing)))
185 {
186#ifdef HAVE_RATGRING
187 if (rIsRatGRing(currRing))
188 {
189 if (_p_LmDivisibleByPart(p,currRing,
190 q,currRing,
191 currRing->real_var_start, currRing->real_var_end))
192 return 0;
193 return pLmCmp(q,p); // ONLY FOR GLOBAL ORDER!
194 }
195#endif
196 BOOLEAN a=FALSE, b=FALSE;
197 int i;
198 unsigned long la, lb;
199 unsigned long divmask = currRing->divmask;
200 for (i=0; i<currRing->VarL_Size; i++)
201 {
202 la = p->exp[currRing->VarL_Offset[i]];
203 lb = q->exp[currRing->VarL_Offset[i]];
204 if (la != lb)
205 {
206 if (la < lb)
207 {
208 if (b) return 0;
209 if (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask))
210 return 0;
211 a = TRUE;
212 }
213 else
214 {
215 if (a) return 0;
216 if (((la & divmask) ^ (lb & divmask)) != ((la - lb) & divmask))
217 return 0;
218 b = TRUE;
219 }
220 }
221 }
222 if (a) { /*assume(pLmCmp(q,p)==1);*/ return 1; }
223 if (b) { /*assume(pLmCmp(q,p)==-1);*/return -1; }
224 /*assume(pLmCmp(q,p)==0);*/
225 }
226 return 0;
227}
228
229#ifdef HAVE_SHIFTBBA
230static inline int pLPDivComp(poly p, poly q)

Callers 3

enterOnePairNormalFunction · 0.85
kutil.ccFile · 0.85
enterOnePairLiftFunction · 0.85

Calls 2

rIsRatGRingFunction · 0.85
_p_LmDivisibleByPartFunction · 0.85

Tested by

no test coverage detected