| 1045 | } |
| 1046 | |
| 1047 | static int redRing_S (LObject* h,kStrategy strat) |
| 1048 | { |
| 1049 | if (strat->sl<0) return 1; |
| 1050 | if (h->IsNull()) return 0; // spoly is zero (can only occur with zero divisors) |
| 1051 | |
| 1052 | int j = 0; |
| 1053 | int pass = 0; |
| 1054 | // poly zeroPoly = NULL; |
| 1055 | |
| 1056 | h->SetpFDeg(); |
| 1057 | assume(h->pFDeg() == h->FDeg); |
| 1058 | int max_ind; |
| 1059 | |
| 1060 | h->SetShortExpVector(); |
| 1061 | loop |
| 1062 | { |
| 1063 | max_ind=strat->sl; |
| 1064 | j = kFindDivisibleByInS(strat, &max_ind, h); |
| 1065 | if (j < 0) |
| 1066 | { |
| 1067 | // over ZZ: cleanup coefficients by complete reduction with monomials |
| 1068 | postReduceByMon(h, strat); |
| 1069 | if(h->p == NULL) |
| 1070 | { |
| 1071 | h->Clear(); |
| 1072 | return 0; |
| 1073 | } |
| 1074 | if(nIsZero(pGetCoeff(h->p))) return 2; |
| 1075 | max_ind=strat->sl; |
| 1076 | j = kFindDivisibleByInS(strat, &max_ind,h); |
| 1077 | if(j < 0) |
| 1078 | { |
| 1079 | if (h->GetLmTailRing() == NULL) |
| 1080 | { |
| 1081 | h->Clear(); |
| 1082 | return 0; |
| 1083 | } |
| 1084 | return 1; |
| 1085 | } |
| 1086 | } |
| 1087 | //printf("\nFound one: ");pWrite(strat->T[j].p); |
| 1088 | //enterT(*h, strat); |
| 1089 | TObject tj(strat->S[j]); |
| 1090 | ksReducePoly(h, &tj, NULL, NULL, NULL, strat); // with debug output |
| 1091 | //printf("\nAfter small red: ");pWrite(h->p); |
| 1092 | if (h->GetLmTailRing() == NULL) |
| 1093 | { |
| 1094 | h->Clear(); |
| 1095 | return 0; |
| 1096 | } |
| 1097 | h->SetShortExpVector(); |
| 1098 | /*- try to reduce the s-polynomial -*/ |
| 1099 | pass++; |
| 1100 | } |
| 1101 | } |
| 1102 | |
| 1103 | /*2 |
no test coverage detected