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

Function kFindDivisibleByInT_Z

kernel/GBEngine/kstd2.cc:213–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213int kFindDivisibleByInT_Z(const kStrategy strat, const LObject* L, const int start)
214{
215 unsigned long not_sev = ~L->sev;
216 int j = start;
217 int o = -1;
218
219 const TSet T=strat->T;
220 const unsigned long* sevT=strat->sevT;
221 number rest, orest, mult;
222 if (L->p!=NULL)
223 {
224 const ring r=currRing;
225 const poly p=L->p;
226 orest = pGetCoeff(p);
227
228 pAssume(~not_sev == p_GetShortExpVector(p, r));
229
230 loop
231 {
232 if (j > strat->tl) return o;
233#if defined(PDEBUG) || defined(PDIV_DEBUG)
234 if (p_LmShortDivisibleBy(T[j].p, sevT[j],p, not_sev, r))
235#else
236 if (!(sevT[j] & not_sev) && p_LmDivisibleBy(T[j].p, p, r))
237#endif
238 {
239 mult= n_QuotRem(pGetCoeff(p), pGetCoeff(T[j].p), &rest, r->cf);
240 if (!n_IsZero(mult, r->cf) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf))
241 {
242 o = j;
243 orest = rest;
244 }
245 }
246 j++;
247 }
248 }
249 else
250 {
251 const ring r=strat->tailRing;

Callers 2

redRing_ZFunction · 0.85
redtailBbaAlsoLC_ZFunction · 0.85

Calls 8

p_GetShortExpVectorFunction · 0.85
p_LmShortDivisibleByFunction · 0.85
p_LmDivisibleByFunction · 0.85
n_QuotRemFunction · 0.85
n_IsZeroFunction · 0.85
n_GreaterFunction · 0.85
n_EucNormFunction · 0.85
ifFunction · 0.50

Tested by

no test coverage detected