| 4010 | } |
| 4011 | |
| 4012 | poly kNF2Bound (ideal F,ideal Q,poly q,int bound,kStrategy strat, int lazyReduce) |
| 4013 | { |
| 4014 | assume(q!=NULL); |
| 4015 | assume(!(idIs0(F)&&(Q==NULL))); // NF(q, std(0) in polynomial ring? |
| 4016 | |
| 4017 | // lazy_reduce flags: can be combined by | |
| 4018 | //#define KSTD_NF_LAZY 1 |
| 4019 | // do only a reduction of the leading term |
| 4020 | //#define KSTD_NF_NONORM 4 |
| 4021 | // only global: avoid normalization, return a multiply of NF |
| 4022 | poly p; |
| 4023 | |
| 4024 | //if ((idIs0(F))&&(Q==NULL)) |
| 4025 | // return pCopy(q); /*F=0*/ |
| 4026 | //strat->ak = idRankFreeModule(F); |
| 4027 | /*- creating temp data structures------------------- -*/ |
| 4028 | BITSET save1; |
| 4029 | SI_SAVE_OPT1(save1); |
| 4030 | si_opt_1|=Sy_bit(OPT_REDTAIL); |
| 4031 | initBuchMoraCrit(strat); |
| 4032 | strat->initEcart = initEcartBBA; |
| 4033 | strat->enterS = enterSBba; |
| 4034 | #ifndef NO_BUCKETS |
| 4035 | strat->use_buckets = (!TEST_OPT_NOT_BUCKETS) && (!rIsPluralRing(currRing)); |
| 4036 | #endif |
| 4037 | /*- set S -*/ |
| 4038 | strat->sl = -1; |
| 4039 | /*- init local data struct.---------------------------------------- -*/ |
| 4040 | /*Shdl=*/initS(F,Q,strat); |
| 4041 | /*- compute------------------------------------------------------- -*/ |
| 4042 | //if ((TEST_OPT_INTSTRATEGY)&&(lazyReduce==0)) |
| 4043 | //{ |
| 4044 | // for (i=strat->sl;i>=0;i--) |
| 4045 | // pNorm(strat->S[i]); |
| 4046 | //} |
| 4047 | kTest(strat); |
| 4048 | if (TEST_OPT_PROT) { PrintS("r"); mflush(); } |
| 4049 | if (BVERBOSE(23)) kDebugPrint(strat); |
| 4050 | int max_ind; |
| 4051 | p = redNFBound(pCopy(q),max_ind,lazyReduce & KSTD_NF_NONORM,strat,bound); |
| 4052 | if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0)) |
| 4053 | { |
| 4054 | if (TEST_OPT_PROT) { PrintS("t"); mflush(); } |
| 4055 | if (rField_is_Z(currRing)||(rField_is_Zn(currRing))) |
| 4056 | { |
| 4057 | p = redtailBba_Z(p,max_ind,strat); |
| 4058 | } |
| 4059 | else if (rField_is_Ring(currRing)) |
| 4060 | { |
| 4061 | p = redtailBba_Ring(p,max_ind,strat); |
| 4062 | } |
| 4063 | else |
| 4064 | { |
| 4065 | si_opt_1 &= ~Sy_bit(OPT_INTSTRATEGY); |
| 4066 | p = redtailBbaBound(p,max_ind,strat,bound,(lazyReduce & KSTD_NF_NONORM)==0); |
| 4067 | //p = redtailBba(p,max_ind,strat,(lazyReduce & KSTD_NF_NONORM)==0); |
| 4068 | } |
| 4069 | } |
no test coverage detected