unshifts the monomial m
| 325 | |
| 326 | // unshifts the monomial m |
| 327 | void p_mLPunshift(poly m, const ring ri) |
| 328 | { |
| 329 | if (m == NULL || p_LmIsConstantComp(m,ri)) return; |
| 330 | |
| 331 | int lV = ri->isLPring; |
| 332 | |
| 333 | int shift = p_mFirstVblock(m, ri) - 1; |
| 334 | |
| 335 | if (shift == 0) return; |
| 336 | |
| 337 | int *e=(int *)omAlloc((ri->N+1)*sizeof(int)); |
| 338 | int *s=(int *)omAlloc0((ri->N+1)*sizeof(int)); |
| 339 | p_GetExpV(m, e, ri); |
| 340 | |
| 341 | int expVoffset = shift*lV; |
| 342 | for (int i = 1 + expVoffset; i <= ri->N; i++) |
| 343 | { |
| 344 | assume(e[i] <= 1); |
| 345 | s[i - expVoffset] = e[i]; |
| 346 | } |
| 347 | p_SetExpV(m,s,ri); |
| 348 | omFreeSize((ADDRESS) e, (ri->N+1)*sizeof(int)); |
| 349 | omFreeSize((ADDRESS) s, (ri->N+1)*sizeof(int)); |
| 350 | } |
| 351 | |
| 352 | // unshifts the polynomial p, note: the ordering can be destroyed if the shifts for the monomials are not equal |
| 353 | void p_LPunshift(poly p, const ring ri) |
no test coverage detected