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

Function p_mLPshift

libpolys/polys/shiftop.cc:362–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360}
361
362void p_mLPshift(poly m, int sh, const ring ri)
363{
364 if (sh == 0 || m == NULL || p_LmIsConstantComp(m,ri)) return;
365
366 int lV = ri->isLPring;
367
368 assume(p_mFirstVblock(m,ri) + sh >= 1);
369 assume(p_mLastVblock(m,ri) + sh <= ri->N/lV);
370
371 int *e=(int *)omAlloc((ri->N+1)*sizeof(int));
372 int *s=(int *)omAlloc0((ri->N+1)*sizeof(int));
373 p_GetExpV(m,e,ri);
374
375 if (p_mLastVblock(m, e, ri) + sh > ri->N/lV)
376 {
377 Werror("degree bound of Letterplace ring is %d, but at least %d is needed for this shift", ri->N/lV, p_mLastVblock(m, e, ri) + sh);
378 }
379 for (int i = ri->N - sh*lV; i > 0; i--)
380 {
381 assume(e[i]<=1);
382 if (e[i]==1)
383 {
384 s[i + (sh*lV)] = e[i]; /* actually 1 */
385 }
386 }
387 p_SetExpV(m,s,ri);
388 omFreeSize((ADDRESS) e, (ri->N+1)*sizeof(int));
389 omFreeSize((ADDRESS) s, (ri->N+1)*sizeof(int));
390}
391
392void p_LPshift(poly p, int sh, const ring ri)
393{

Callers 3

p_LPshiftFunction · 0.85
enterSBbaShiftFunction · 0.85
p_LPCopyAndShiftLMFunction · 0.85

Calls 7

p_LmIsConstantCompFunction · 0.85
p_mFirstVblockFunction · 0.85
p_mLastVblockFunction · 0.85
omAlloc0Function · 0.85
p_GetExpVFunction · 0.85
WerrorFunction · 0.85
p_SetExpVFunction · 0.85

Tested by

no test coverage detected