- Timestamp:
- May 13, 2016, 1:26:50 PM (8 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- ff38ee02732552e78a143ebf4f9aadccee454071
- Parents:
- 7aa6edb86ac7c8b9cfbd1bcd3ba76d19a18ca978
- Location:
- kernel/GBEngine
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/kstd1.cc
r7aa6ed r978a8c 14 14 #define MYTEST 0 15 15 16 #define ADIDEBUG 116 #define ADIDEBUG 0 17 17 #define ADIDEBUG_NF 0 18 18 -
kernel/GBEngine/kstd2.cc
r7aa6ed r978a8c 20 20 #endif /* ifndef SING_NDEBUG */ 21 21 22 #define ADIDEBUG 022 #define ADIDEBUG 1 23 23 #define ADIDEBUG_COUNT 0 24 24 #define REV_BLOCK_SBA 0 … … 722 722 if (j < 0) 723 723 { 724 #ifdef HAVE_RINGS 725 if(rField_is_Ring(currRing)) 726 { 727 //Check for sigdrop after reduction 728 if(pLtCmp(beforeredsig,h->sig) == 1) 729 { 730 #if ADIDEBUG 731 printf("\nSigDrop after reduce\n");pWrite(beforeredsig);pWrite(h->sig); 732 #endif 733 strat->sigdrop = TRUE; 734 //Reduce it as much as you can 735 int red_result = redRing(h,strat); 736 if(red_result == 0) 737 { 738 //It reduced to 0, cancel the sigdrop 739 #if ADIDEBUG 740 printf("\nReduced to 0 via redRing. Cancel sigdrop\n"); 741 #endif 742 strat->sigdrop = FALSE; 743 p_Delete(&h->sig,currRing);h->sig = NULL; 744 return 0; 745 } 746 else 724 // over ZZ: cleanup coefficients by complete reduction with monomials 725 postReduceByMonSig(h, strat); 726 if(nIsZero(pGetCoeff(h->p))) return 2; 727 j = kFindDivisibleByInT(strat, h,start); 728 if(j < 0) 729 { 730 if(strat->tl >= 0) 731 h->i_r1 = strat->tl; 732 else 733 h->i_r1 = -1; 734 if (h->GetLmTailRing() == NULL) 735 { 736 if (h->lcm!=NULL) pLmDelete(h->lcm); 737 h->Clear(); 738 return 0; 739 } 740 #ifdef HAVE_RINGS 741 if(rField_is_Ring(currRing)) 742 { 743 //Check for sigdrop after reduction 744 if(pLtCmp(beforeredsig,h->sig) == 1) 747 745 { 748 746 #if ADIDEBUG 749 printf("\n Reduced to this via redRing.SIGDROP\n");pWrite(h->p);747 printf("\nSigDrop after reduce\n");pWrite(beforeredsig);pWrite(h->sig); 750 748 #endif 751 //strat->enterS(*h, strat->sl+1, strat, strat->tl); 752 return 0; 749 strat->sigdrop = TRUE; 750 //Reduce it as much as you can 751 int red_result = redRing(h,strat); 752 if(red_result == 0) 753 { 754 //It reduced to 0, cancel the sigdrop 755 #if ADIDEBUG 756 printf("\nReduced to 0 via redRing. Cancel sigdrop\n"); 757 #endif 758 strat->sigdrop = FALSE; 759 p_Delete(&h->sig,currRing);h->sig = NULL; 760 return 0; 761 } 762 else 763 { 764 #if ADIDEBUG 765 printf("\nReduced to this via redRing.SIGDROP\n");pWrite(h->p); 766 #endif 767 //strat->enterS(*h, strat->sl+1, strat, strat->tl); 768 return 0; 769 } 753 770 } 754 }755 p_Delete(&beforeredsig,currRing);756 }757 #endif758 return 1;771 p_Delete(&beforeredsig,currRing); 772 } 773 #endif 774 return 1; 775 } 759 776 } 760 777 … … 2157 2174 printf("\n list L\n"); 2158 2175 int iii; 2159 #if 02176 #if 1 2160 2177 for(iii = 0; iii<= strat->Ll; iii++) 2161 2178 { -
kernel/GBEngine/kutil.cc
r7aa6ed r978a8c 12 12 #define MYTEST 0 13 13 14 #define ADIDEBUG 014 #define ADIDEBUG 1 15 15 16 16 #include <kernel/mod2.h> … … 6134 6134 BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly /*lm*/, kStrategy strat, int start=0) 6135 6135 { 6136 return FALSE;6136 //return FALSE; 6137 6137 //printf("Faugere Rewritten Criterion\n"); 6138 6138 //#if 1 … … 6159 6159 PrintS("DELETE!\n"); 6160 6160 #endif 6161 printf("\nFaugere RewCrit: * divisible by *\n");pWrite(sig);pWrite(strat->sig[k]); 6161 6162 return TRUE; 6162 6163 } … … 9700 9701 if(pLmDivisibleBy(strat->S[i], p)) 9701 9702 { 9703 number dummy = n_IntMod(p->coef, strat->S[i]->coef, currRing->cf); 9704 p_SetCoeff(p,dummy,currRing); 9705 } 9706 if(nIsZero(p->coef)) 9707 { 9708 pLmDelete(&p); 9709 deleted = TRUE; 9710 } 9711 else 9712 { 9713 ok = TRUE; 9714 } 9715 } 9716 pp = pNext(p); 9717 while(pp != NULL) 9718 { 9719 if(pLmDivisibleBy(strat->S[i], pp)) 9720 { 9721 number dummy = n_IntMod(pp->coef, strat->S[i]->coef, currRing->cf); 9722 p_SetCoeff(pp,dummy,currRing); 9723 if(nIsZero(pp->coef)) 9724 { 9725 pLmDelete(&pNext(p)); 9726 pp = pNext(p); 9727 deleted = TRUE; 9728 } 9729 else 9730 { 9731 p = pp; 9732 pp = pNext(p); 9733 } 9734 } 9735 else 9736 { 9737 p = pp; 9738 pp = pNext(p); 9739 } 9740 } 9741 } 9742 } 9743 h->SetLmCurrRing(); 9744 if(deleted) 9745 strat->initEcart(h); 9746 } 9747 9748 void postReduceByMonSig(LObject* h, kStrategy strat) 9749 { 9750 if(!nCoeff_is_Ring_Z(currRing->cf)) 9751 return; 9752 printf("\npostreducebymon\n"); 9753 poly hSig = h->sig; 9754 poly pH = h->GetP(); 9755 poly p,pp; 9756 p = pH; 9757 bool deleted = FALSE, ok = FALSE; 9758 for(int i = 0; i<=strat->sl; i++) 9759 { 9760 p = pH; 9761 if(pNext(strat->S[i]) == NULL) 9762 { 9763 printf("\n------------------\n"); 9764 pWrite(p); 9765 pWrite(strat->S[i]); 9766 while(ok == FALSE) 9767 { 9768 if(pLmDivisibleBy(strat->S[i], p)) 9769 { 9770 poly dum = pDivideM(pHead(p),pHead(strat->S[i])); 9771 pWrite(dum);getchar(); 9702 9772 number dummy = n_IntMod(p->coef, strat->S[i]->coef, currRing->cf); 9703 9773 p_SetCoeff(p,dummy,currRing); -
kernel/GBEngine/kutil.h
r7aa6ed r978a8c 748 748 poly preIntegerCheck(ideal F, ideal Q); 749 749 void postReduceByMon(LObject* h, kStrategy strat); 750 void postReduceByMonSig(LObject* h, kStrategy strat); 750 751 void finalReduceByMon(kStrategy strat); 751 752 #endif
Note: See TracChangeset
for help on using the changeset viewer.