| 3804 | return res; |
| 3805 | } |
| 3806 | ideal kInterRed (ideal F,const ideal Q) |
| 3807 | { |
| 3808 | #ifdef HAVE_PLURAL |
| 3809 | if(rIsPluralRing(currRing)) return kInterRedOld(F,Q); |
| 3810 | #endif |
| 3811 | if ((rHasLocalOrMixedOrdering(currRing))|| (rField_is_numeric(currRing)) |
| 3812 | ||(rField_is_Ring(currRing)) |
| 3813 | ) |
| 3814 | return kInterRedOld(F,Q); |
| 3815 | |
| 3816 | //return kInterRedOld(F,Q); |
| 3817 | |
| 3818 | BITSET save1; |
| 3819 | SI_SAVE_OPT1(save1); |
| 3820 | //si_opt_1|=Sy_bit(OPT_NOT_SUGAR); |
| 3821 | si_opt_1|=Sy_bit(OPT_REDTHROUGH); |
| 3822 | //si_opt_1&= ~Sy_bit(OPT_REDTAIL); |
| 3823 | //si_opt_1&= ~Sy_bit(OPT_REDSB); |
| 3824 | //extern char * showOption() ; |
| 3825 | //Print("%s\n",showOption()); |
| 3826 | |
| 3827 | int need_retry; |
| 3828 | int counter=3; |
| 3829 | ideal res, res1; |
| 3830 | int elems; |
| 3831 | ideal null=NULL; |
| 3832 | if ((Q==NULL) || (!TEST_OPT_REDSB)) |
| 3833 | { |
| 3834 | elems=idElem(F); |
| 3835 | res=kInterRedBba(F,Q,need_retry); |
| 3836 | } |
| 3837 | else |
| 3838 | { |
| 3839 | ideal FF=idSimpleAdd(F,Q); |
| 3840 | res=kInterRedBba(FF,NULL,need_retry); |
| 3841 | idDelete(&FF); |
| 3842 | null=idInit(1,1); |
| 3843 | if (need_retry) |
| 3844 | res1=kNF(null,Q,res,0,KSTD_NF_LAZY | KSTD_NF_NONORM); |
| 3845 | else |
| 3846 | res1=kNF(null,Q,res); |
| 3847 | idDelete(&res); |
| 3848 | res=res1; |
| 3849 | need_retry=1; |
| 3850 | } |
| 3851 | if (idElem(res)<=1) need_retry=0; |
| 3852 | while (need_retry && (counter>0)) |
| 3853 | { |
| 3854 | #ifdef KDEBUG |
| 3855 | if (TEST_OPT_DEBUG) { Print("retry counter %d\n",counter); } |
| 3856 | #endif |
| 3857 | res1=kInterRedBba(res,Q,need_retry); |
| 3858 | int new_elems=idElem(res1); |
| 3859 | counter -= (new_elems >= elems); |
| 3860 | elems = new_elems; |
| 3861 | idDelete(&res); |
| 3862 | if (idElem(res1)<=1) need_retry=0; |
| 3863 | if ((Q!=NULL) && (TEST_OPT_REDSB)) |
no test coverage detected