| 3927 | } |
| 3928 | |
| 3929 | poly kNF2 (ideal F,ideal Q,poly q,kStrategy strat, int lazyReduce) |
| 3930 | { |
| 3931 | assume(q!=NULL); |
| 3932 | assume(!(idIs0(F)&&(Q==NULL))); // NF(q, std(0) in polynomial ring? |
| 3933 | |
| 3934 | // lazy_reduce flags: can be combined by | |
| 3935 | //#define KSTD_NF_LAZY 1 |
| 3936 | // do only a reduction of the leading term |
| 3937 | //#define KSTD_NF_NONORM 4 |
| 3938 | // only global: avoid normalization, return a multiply of NF |
| 3939 | poly p; |
| 3940 | |
| 3941 | //if ((idIs0(F))&&(Q==NULL)) |
| 3942 | // return pCopy(q); /*F=0*/ |
| 3943 | //strat->ak = idRankFreeModule(F); |
| 3944 | /*- creating temp data structures------------------- -*/ |
| 3945 | BITSET save1; |
| 3946 | SI_SAVE_OPT1(save1); |
| 3947 | si_opt_1|=Sy_bit(OPT_REDTAIL); |
| 3948 | initBuchMoraCrit(strat); |
| 3949 | strat->initEcart = initEcartBBA; |
| 3950 | #ifdef HAVE_SHIFTBBA |
| 3951 | if (rIsLPRing(currRing)) |
| 3952 | { |
| 3953 | strat->enterS = enterSBbaShift; |
| 3954 | } |
| 3955 | else |
| 3956 | #endif |
| 3957 | { |
| 3958 | strat->enterS = enterSBba; |
| 3959 | } |
| 3960 | #ifndef NO_BUCKETS |
| 3961 | strat->use_buckets = (!TEST_OPT_NOT_BUCKETS) && (!rIsPluralRing(currRing)); |
| 3962 | #endif |
| 3963 | /*- set S -*/ |
| 3964 | strat->sl = -1; |
| 3965 | /*- init local data struct.---------------------------------------- -*/ |
| 3966 | /*Shdl=*/initS(F,Q,strat); |
| 3967 | /*- compute------------------------------------------------------- -*/ |
| 3968 | //if ((TEST_OPT_INTSTRATEGY)&&(lazyReduce==0)) |
| 3969 | //{ |
| 3970 | // for (i=strat->sl;i>=0;i--) |
| 3971 | // pNorm(strat->S[i]); |
| 3972 | //} |
| 3973 | kTest(strat); |
| 3974 | if (TEST_OPT_PROT) { PrintS("r"); mflush(); } |
| 3975 | if (BVERBOSE(23)) kDebugPrint(strat); |
| 3976 | int max_ind; |
| 3977 | p = redNF(pCopy(q),max_ind,(lazyReduce & KSTD_NF_NONORM)==KSTD_NF_NONORM,strat); |
| 3978 | if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0)) |
| 3979 | { |
| 3980 | if (TEST_OPT_PROT) { PrintS("t"); mflush(); } |
| 3981 | if (rField_is_Z(currRing)||(rField_is_Zn(currRing))) |
| 3982 | { |
| 3983 | p = redtailBba_NF(p,strat); |
| 3984 | } |
| 3985 | else if (rField_is_Ring(currRing)) |
| 3986 | { |
no test coverage detected