2 * reduction procedure for the homogeneous case * and the case of a degree-ordering */
| 1105 | * and the case of a degree-ordering |
| 1106 | */ |
| 1107 | int redHomog (LObject* h,kStrategy strat) |
| 1108 | { |
| 1109 | if (strat->tl<0) return 1; |
| 1110 | //if (h->GetLmTailRing()==NULL) return 0; // HS: SHOULD NOT BE NEEDED! |
| 1111 | assume(h->FDeg == h->pFDeg()); |
| 1112 | |
| 1113 | poly h_p; |
| 1114 | int i,j,at,pass,cnt,ii; |
| 1115 | // long reddeg,d; |
| 1116 | int li; |
| 1117 | BOOLEAN test_opt_length=TEST_OPT_LENGTH; |
| 1118 | |
| 1119 | pass = j = 0; |
| 1120 | cnt = RED_CANONICALIZE; |
| 1121 | h->SetShortExpVector(); |
| 1122 | h_p = h->GetLmTailRing(); |
| 1123 | h->PrepareRed(strat->use_buckets); |
| 1124 | loop |
| 1125 | { |
| 1126 | j = kFindDivisibleByInT(strat, h); |
| 1127 | if (j < 0) return 1; |
| 1128 | |
| 1129 | li = strat->T[j].pLength; |
| 1130 | ii = j; |
| 1131 | /* |
| 1132 | * the polynomial to reduce with (up to the moment) is; |
| 1133 | * pi with length li |
| 1134 | */ |
| 1135 | i = j; |
| 1136 | #if 1 |
| 1137 | if (test_opt_length) |
| 1138 | { |
| 1139 | if (li<=0) li=strat->T[j].GetpLength(); |
| 1140 | if (li>2) |
| 1141 | { |
| 1142 | unsigned long not_sev = ~ h->sev; |
| 1143 | loop |
| 1144 | { |
| 1145 | /*- search the shortest possible with respect to length -*/ |
| 1146 | i++; |
| 1147 | if (i > strat->tl) |
| 1148 | break; |
| 1149 | if ((strat->T[i].pLength < li) |
| 1150 | && |
| 1151 | p_LmShortDivisibleBy(strat->T[i].GetLmTailRing(), strat->sevT[i], |
| 1152 | h_p, not_sev, strat->tailRing)) |
| 1153 | { |
| 1154 | /* |
| 1155 | * the polynomial to reduce with is now; |
| 1156 | */ |
| 1157 | li = strat->T[i].pLength; |
| 1158 | if (li<=0) li=strat->T[i].GetpLength(); |
| 1159 | ii = i; |
| 1160 | if (li<3) break; |
| 1161 | } |
| 1162 | } |
| 1163 | } |
| 1164 | } |
nothing calls this directly
no test coverage detected