| 943 | } |
| 944 | |
| 945 | int redRing (LObject* h,kStrategy strat) |
| 946 | { |
| 947 | if (strat->tl<0) return 1; |
| 948 | if (h->IsNull()) return 0; // spoly is zero (can only occur with zero divisors) |
| 949 | |
| 950 | int at/*,i*/; |
| 951 | long d; |
| 952 | int j = 0; |
| 953 | int pass = 0; |
| 954 | // poly zeroPoly = NULL; |
| 955 | |
| 956 | // TODO warum SetpFDeg notwendig? |
| 957 | h->SetpFDeg(); |
| 958 | assume(h->pFDeg() == h->FDeg); |
| 959 | long reddeg = h->GetpFDeg(); |
| 960 | |
| 961 | h->SetShortExpVector(); |
| 962 | loop |
| 963 | { |
| 964 | j = kFindDivisibleByInT(strat, h); |
| 965 | if (j < 0) |
| 966 | { |
| 967 | // over ZZ: cleanup coefficients by complete reduction with monomials |
| 968 | postReduceByMon(h, strat); |
| 969 | if(h->p == NULL) |
| 970 | { |
| 971 | kDeleteLcm(h); |
| 972 | h->Clear(); |
| 973 | return 0; |
| 974 | } |
| 975 | if(nIsZero(pGetCoeff(h->p))) return 2; |
| 976 | j = kFindDivisibleByInT(strat, h); |
| 977 | if(j < 0) |
| 978 | { |
| 979 | if(strat->tl >= 0) |
| 980 | h->i_r1 = strat->tl; |
| 981 | else |
| 982 | h->i_r1 = -1; |
| 983 | if (h->GetLmTailRing() == NULL) |
| 984 | { |
| 985 | kDeleteLcm(h); |
| 986 | h->Clear(); |
| 987 | return 0; |
| 988 | } |
| 989 | return 1; |
| 990 | } |
| 991 | } |
| 992 | //printf("\nFound one: ");pWrite(strat->T[j].p); |
| 993 | //enterT(*h, strat); |
| 994 | ksReducePoly(h, &(strat->T[j]), NULL, NULL, NULL, strat); // with debug output |
| 995 | //printf("\nAfter small red: ");pWrite(h->p); |
| 996 | if (h->GetLmTailRing() == NULL) |
| 997 | { |
| 998 | kDeleteLcm(h); |
| 999 | h->Clear(); |
| 1000 | return 0; |
| 1001 | } |
| 1002 | h->SetShortExpVector(); |
no test coverage detected