| 342 | |
| 343 | #ifdef STDZ_EXCHANGE_DURING_REDUCTION |
| 344 | int ksReducePolyGCD(LObject* PR, |
| 345 | TObject* PW, |
| 346 | poly spNoether, |
| 347 | number *coef, |
| 348 | kStrategy strat) |
| 349 | { |
| 350 | #ifdef KDEBUG |
| 351 | red_count++; |
| 352 | #ifdef TEST_OPT_DEBUG_RED |
| 353 | // if (TEST_OPT_DEBUG) |
| 354 | // { |
| 355 | // Print("Red %d:", red_count); PR->wrp(); Print(" with:"); |
| 356 | // PW->wrp(); |
| 357 | // //printf("\necart(PR)-ecart(PW): %i\n",PR->ecart-PW->ecart); |
| 358 | // //pWrite(PR->p); |
| 359 | // } |
| 360 | #endif |
| 361 | #endif |
| 362 | int ret = 0; |
| 363 | ring tailRing = PR->tailRing; |
| 364 | if (strat!=NULL) |
| 365 | { |
| 366 | kTest_L(PR,strat); |
| 367 | kTest_T(PW,strat); |
| 368 | } |
| 369 | |
| 370 | poly p1 = PR->GetLmTailRing(); |
| 371 | poly p2 = PW->GetLmTailRing(); |
| 372 | poly t2 = pNext(p2), lm = pOne(); |
| 373 | assume(p1 != NULL && p2 != NULL);// Attention, we have rings and there LC(p2) and LC(p1) are special |
| 374 | p_CheckPolyRing(p1, tailRing); |
| 375 | p_CheckPolyRing(p2, tailRing); |
| 376 | |
| 377 | pAssume1(p2 != NULL && p1 != NULL && |
| 378 | p_DivisibleBy(p2, p1, tailRing)); |
| 379 | |
| 380 | pAssume1(p_GetComp(p1, tailRing) == p_GetComp(p2, tailRing) || |
| 381 | (p_GetComp(p2, tailRing) == 0 && |
| 382 | p_MaxComp(pNext(p2),tailRing) == 0)); |
| 383 | |
| 384 | #ifdef HAVE_PLURAL |
| 385 | if (rIsPluralRing(currRing)) |
| 386 | { |
| 387 | // for the time being: we know currRing==strat->tailRing |
| 388 | // no exp-bound checking needed |
| 389 | // (only needed if exp-bound(tailring)<exp-b(currRing)) |
| 390 | if (PR->bucket!=NULL) nc_kBucketPolyRed_Z(PR->bucket, p2,coef,TRUE); |
| 391 | else |
| 392 | { |
| 393 | poly _p = (PR->t_p != NULL ? PR->t_p : PR->p); |
| 394 | assume(_p != NULL); |
| 395 | nc_PolyPolyRed(_p, p2,coef, currRing); |
| 396 | if (PR->t_p!=NULL) PR->t_p=_p; else PR->p=_p; |
| 397 | PR->pLength=0; // usually not used, GetpLength re-computes it if needed |
| 398 | } |
| 399 | return 0; |
| 400 | } |
| 401 | #endif |
no test coverage detected