| 2300 | */ |
| 2301 | |
| 2302 | poly redNF (poly h,int &max_ind,int nonorm,kStrategy strat) |
| 2303 | { |
| 2304 | if (h==NULL) return NULL; |
| 2305 | int j,j_ring; |
| 2306 | int cnt=REDNF_CANONICALIZE; |
| 2307 | max_ind=strat->sl; |
| 2308 | |
| 2309 | if (0 > strat->sl) |
| 2310 | { |
| 2311 | return h; |
| 2312 | } |
| 2313 | LObject P(h); |
| 2314 | P.SetShortExpVector(); |
| 2315 | P.t_p=NULL; |
| 2316 | BOOLEAN is_ring = rField_is_Ring(currRing); |
| 2317 | if(is_ring) nonorm=TRUE; |
| 2318 | #ifdef KDEBUG |
| 2319 | // if (TEST_OPT_DEBUG) |
| 2320 | // { |
| 2321 | // PrintS("redNF: starting S:\n"); |
| 2322 | // for( j = 0; j <= max_ind; j++ ) |
| 2323 | // { |
| 2324 | // Print("S[%d] (of size: %d): ", j, pSize(strat->S[j])); |
| 2325 | // pWrite(strat->S[j]); |
| 2326 | // } |
| 2327 | // }; |
| 2328 | #endif |
| 2329 | if (rField_is_Z(currRing)) |
| 2330 | { |
| 2331 | redRing_Z_S(&P,strat); |
| 2332 | if (P.bucket!=NULL) |
| 2333 | { |
| 2334 | P.p=kBucketClear(P.bucket); |
| 2335 | kBucketDestroy(&P.bucket); |
| 2336 | } |
| 2337 | return P.p; |
| 2338 | } |
| 2339 | else if (rField_is_Ring(currRing)) |
| 2340 | { |
| 2341 | redRing_S(&P,strat); |
| 2342 | if (P.bucket!=NULL) |
| 2343 | { |
| 2344 | P.p=kBucketClear(P.bucket); |
| 2345 | kBucketDestroy(&P.bucket); |
| 2346 | } |
| 2347 | return P.p; |
| 2348 | } |
| 2349 | |
| 2350 | P.bucket = kBucketCreate(currRing); |
| 2351 | kBucketInit(P.bucket,P.p,pLength(P.p)); |
| 2352 | kbTest(P.bucket); |
| 2353 | P.p=kBucketGetLm(P.bucket); |
| 2354 | loop |
| 2355 | { |
| 2356 | j_ring=j=kFindDivisibleByInS_noCF(strat,&max_ind,&P); |
| 2357 | while ((j>=0) |
| 2358 | && (nonorm) |
| 2359 | && (!n_DivBy(pGetCoeff(P.p),pGetCoeff(strat->S[j]),currRing->cf))) |
no test coverage detected