2 * reduction procedure for the ring coeffs */
| 675 | * reduction procedure for the ring coeffs |
| 676 | */ |
| 677 | int redRing_Z (LObject* h,kStrategy strat) |
| 678 | { |
| 679 | if (h->IsNull()) return 0; // spoly is zero (can only occur with zero divisors) |
| 680 | if (strat->tl<0) return 1; |
| 681 | |
| 682 | int at; |
| 683 | long d; |
| 684 | int j = 0; |
| 685 | int pass = 0; |
| 686 | |
| 687 | // TODO warum SetpFDeg notwendig? |
| 688 | h->SetpFDeg(); |
| 689 | assume(h->pFDeg() == h->FDeg); |
| 690 | long reddeg = h->GetpFDeg(); |
| 691 | |
| 692 | h->SetShortExpVector(); |
| 693 | loop |
| 694 | { |
| 695 | /* check if a reducer of the lead term exists */ |
| 696 | j = kFindDivisibleByInT(strat, h); |
| 697 | if (j < 0) |
| 698 | { |
| 699 | #if STDZ_EXCHANGE_DURING_REDUCTION |
| 700 | /* check if a reducer with the same lead monomial exists */ |
| 701 | j = kFindSameLMInT_Z(strat, h); |
| 702 | if (j < 0) |
| 703 | { |
| 704 | #endif |
| 705 | /* check if a reducer of the lead monomial exists, by the above |
| 706 | * check this is a real divisor of the lead monomial */ |
| 707 | j = kFindDivisibleByInT_Z(strat, h); |
| 708 | if (j < 0) |
| 709 | { |
| 710 | // over ZZ: cleanup coefficients by complete reduction with monomials |
| 711 | if (rHasLocalOrMixedOrdering(currRing)) |
| 712 | postReduceByMon(h, strat); |
| 713 | if(h->p == NULL) |
| 714 | { |
| 715 | if (h->lcm!=NULL) pLmDelete(h->lcm); |
| 716 | h->Clear(); |
| 717 | return 0; |
| 718 | } |
| 719 | if(nIsZero(pGetCoeff(h->p))) return 2; |
| 720 | j = kFindDivisibleByInT(strat, h); |
| 721 | if(j < 0) |
| 722 | { |
| 723 | if(strat->tl >= 0) |
| 724 | h->i_r1 = strat->tl; |
| 725 | else |
| 726 | h->i_r1 = -1; |
| 727 | if (h->GetLmTailRing() == NULL) |
| 728 | { |
| 729 | if (h->lcm!=NULL) pLmDelete(h->lcm); |
| 730 | h->Clear(); |
| 731 | return 0; |
| 732 | } |
| 733 | return 1; |
| 734 | } |
nothing calls this directly
no test coverage detected