2 * puts signature p.sig to the set syz */
| 9338 | * puts signature p.sig to the set syz |
| 9339 | */ |
| 9340 | void enterSyz(LObject &p, kStrategy strat, int atT) |
| 9341 | { |
| 9342 | int i; |
| 9343 | strat->newt = TRUE; |
| 9344 | if (strat->syzl == strat->syzmax-1) |
| 9345 | { |
| 9346 | pEnlargeSet(&strat->syz,strat->syzmax,setmax); |
| 9347 | strat->sevSyz = (unsigned long*) omRealloc0Size(strat->sevSyz, |
| 9348 | (strat->syzmax)*sizeof(unsigned long), |
| 9349 | ((strat->syzmax)+setmax) |
| 9350 | *sizeof(unsigned long)); |
| 9351 | strat->syzmax += setmax; |
| 9352 | } |
| 9353 | if (atT < strat->syzl) |
| 9354 | { |
| 9355 | #ifdef ENTER_USE_MEMMOVE |
| 9356 | memmove(&(strat->syz[atT+1]), &(strat->syz[atT]), |
| 9357 | (strat->syzl-atT+1)*sizeof(poly)); |
| 9358 | memmove(&(strat->sevSyz[atT+1]), &(strat->sevSyz[atT]), |
| 9359 | (strat->syzl-atT+1)*sizeof(unsigned long)); |
| 9360 | #endif |
| 9361 | for (i=strat->syzl; i>=atT+1; i--) |
| 9362 | { |
| 9363 | #ifndef ENTER_USE_MEMMOVE |
| 9364 | strat->syz[i] = strat->syz[i-1]; |
| 9365 | strat->sevSyz[i] = strat->sevSyz[i-1]; |
| 9366 | #endif |
| 9367 | } |
| 9368 | } |
| 9369 | //i = strat->syzl; |
| 9370 | i = atT; |
| 9371 | //Makes sure the syz saves just the signature |
| 9372 | if(rField_is_Ring(currRing)) |
| 9373 | pNext(p.sig) = NULL; |
| 9374 | strat->syz[atT] = p.sig; |
| 9375 | strat->sevSyz[atT] = p.sevSig; |
| 9376 | strat->syzl++; |
| 9377 | #if F5DEBUG |
| 9378 | Print("element in strat->syz: %d--%d ",atT+1,strat->syzmax); |
| 9379 | pWrite(strat->syz[atT]); |
| 9380 | #endif |
| 9381 | // recheck pairs in strat->L with new rule and delete correspondingly |
| 9382 | int cc = strat->Ll; |
| 9383 | while (cc>-1) |
| 9384 | { |
| 9385 | //printf("\nCheck if syz is div by L\n");pWrite(strat->syz[atT]);pWrite(strat->L[cc].sig); |
| 9386 | //printf("\npLmShDivBy(syz,L) = %i\nn_DivBy(L,syz) = %i\n pLtCmp(L,syz) = %i",p_LmShortDivisibleBy( strat->syz[atT], strat->sevSyz[atT],strat->L[cc].sig, ~strat->L[cc].sevSig, currRing), n_DivBy(pGetCoeff(strat->L[cc].sig),pGetCoeff(strat->syz[atT]),currRing), pLtCmp(strat->L[cc].sig,strat->syz[atT])==1); |
| 9387 | if (p_LmShortDivisibleBy( strat->syz[atT], strat->sevSyz[atT], |
| 9388 | strat->L[cc].sig, ~strat->L[cc].sevSig, currRing) |
| 9389 | &&((!rField_is_Ring(currRing)) |
| 9390 | || (n_DivBy(pGetCoeff(strat->L[cc].sig),pGetCoeff(strat->syz[atT]),currRing->cf) && (pLtCmp(strat->L[cc].sig,strat->syz[atT])==1))) |
| 9391 | ) |
| 9392 | { |
| 9393 | //printf("\nYES!\n"); |
| 9394 | deleteInL(strat->L,&strat->Ll,cc,strat); |
| 9395 | } |
| 9396 | cc--; |
| 9397 | } |
no test coverage detected