Changeset bb02ea in git
- Timestamp:
- Apr 5, 2009, 9:49:18 AM (14 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- bb9471e2e1af065ffce285ee2e4d142ab2d974b0
- Parents:
- 9660f5c48cc33240ba1f644718ebd3f554c48fff
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/f5gb.cc
r9660f5 rbb02ea 64 64 } 65 65 66 66 /** 67 ========================================================================== 68 compare monomials, i.e. divisibility tests for criterion 1 and criterion 2 69 ========================================================================== 70 */ 71 bool compareMonomials(int* m1, int** m2, int numberOfRules) { 72 int i,j; 73 int k = sizeof(m1) / sizeof(int); 74 for(i=0; i<numberOfRules; i++) { 75 for(j=1; j<=k; j++) { 76 if(m1[j]>m2[i][j]) { 77 return true; 78 } 79 } 80 } 81 return false; 82 } 67 83 68 84 /* … … 183 199 */ 184 200 //gPrev->print(); 185 Print("COMPLETE REDUCTION TIME UNTIL NOW: %d\n",reductionTime);186 Print("COMPLETE SPOLS TIME UNTIL NOW: %d\n",spolsTime);201 //Print("COMPLETE REDUCTION TIME UNTIL NOW: %d\n",reductionTime); 202 //Print("COMPLETE SPOLS TIME UNTIL NOW: %d\n",spolsTime); 187 203 return gPrev; 188 204 } … … 529 545 if(!criterion2(temp->getT2(),temp->getAdLp2(),rules,temp->getTestedRule())) { 530 546 // computation of S-polynomial 531 sp = pSub(ppMult_qq(temp->getT1(),temp->getLp1Poly()),547 sp = ksOldSpolyRedNew(ppMult_qq(temp->getT1(),temp->getLp1Poly()), 532 548 ppMult_qq(temp->getT2(),temp->getLp2Poly())); 533 549 //Print("BEGIN SPOLY1\n====================\n"); … … 564 580 else { // temp->getLp2Index() < temp->getLp1Index() 565 581 // computation of S-polynomial 566 sp = pSub(ppMult_qq(temp->getT1(),temp->getLp1Poly()),582 sp = ksOldSpolyRedNew(ppMult_qq(temp->getT1(),temp->getLp1Poly()), 567 583 ppMult_qq(temp->getT2(),temp->getLp2Poly())); 568 584 //Print("BEGIN SPOLY2\n====================\n"); … … 665 681 poly pOne = pOne(); 666 682 do { 667 int timer5 = initTimer();668 startTimer();669 tempRed = findReductor(l, gPrevRedCheck,gPrev,rules,lTag,rTag);670 timer5 = getTimer();671 reductionTime = reductionTime + timer5;683 //int timer5 = initTimer(); 684 //startTimer(); 685 tempRed = findReductor(l,sPolyList,gPrevRedCheck,gPrev,rules,lTag,rTag); 686 //timer5 = getTimer(); 687 //reductionTime = reductionTime + timer5; 672 688 // if a reductor for l is found and saved in tempRed 673 689 if(NULL != tempRed) { … … 680 696 //Print("VORHER: "); 681 697 //pWrite(tempRed->getPoly()); 682 poly temp = pMinus_mm_Mult_qq(tempRed->getPoly(),pOne,l->getPoly());683 //poly temp = ksOldSpolyRedNew(l->getPoly(),tempRed->getPoly());698 //poly temp = pMinus_mm_Mult_qq(tempRed->getPoly(),pOne,l->getPoly()); 699 poly temp = ksOldSpolyRedNew(l->getPoly(),tempRed->getPoly()); 684 700 //Print("NACHHER: "); 685 701 //pWrite(tempRed->getPoly()); … … 709 725 //poly temp_poly_l = pInit(); 710 726 //temp_poly_l = pCopy(l->getPoly()); 711 poly temp = pMinus_mm_Mult_qq(tempRed->getPoly(),pOne,l->getPoly());712 //poly temp = ksOldSpolyRedNew(l->getPoly(),tempRed->getPoly());727 //poly temp = pMinus_mm_Mult_qq(tempRed->getPoly(),pOne,l->getPoly()); 728 poly temp = ksOldSpolyRedNew(l->getPoly(),tempRed->getPoly()); 713 729 if(NULL != temp) { 714 730 pNorm(temp); … … 750 766 ===================================================================== 751 767 */ 752 LNode* findReductor(LNode* l, L Node* gPrevRedCheck, LList* gPrev, RList* rules, LTagList* lTag,RTagList* rTag) {768 LNode* findReductor(LNode* l, LList* sPolyList, LNode* gPrevRedCheck, LList* gPrev, RList* rules, LTagList* lTag,RTagList* rTag) { 753 769 // allociation of memory for the possible reductor 770 //Print("LPOLY: "); 771 //pWrite(l->getPoly()); 754 772 poly u = pOne(); 755 773 poly red; … … 775 793 pNorm(red); 776 794 // check if both have the same label 777 if(pLmCmp( u,l->getTerm()) != 0) {795 if(pLmCmp(ppMult_qq(u,temp->getTerm()),l->getTerm()) == -1) { 778 796 // passing criterion2 ? 779 797 if(!criterion2(gPrev->getFirst()->getIndex(), u,temp,rules,rTag)) { … … 786 804 } 787 805 } 788 } 806 if(pLmCmp(ppMult_qq(u,temp->getTerm()),l->getTerm()) == 1) { 807 // passing criterion2 ? 808 if(!criterion2(gPrev->getFirst()->getIndex(), u,temp,rules,rTag)) { 809 // passing criterion1 ? 810 if(!criterion1(gPrev,u,temp,lTag)) { 811 poly tempSpoly = ksOldSpolyRedNew(red,l->getPoly()); 812 rules->insert(temp->getIndex(),ppMult_qq(u,temp->getTerm())); 813 gPrevRedCheck = temp->getNext(); 814 if(NULL != tempSpoly) { 815 pNorm(tempSpoly); 816 sPolyList->insertByLabel(ppMult_qq(u,temp->getTerm()),temp->getIndex(),tempSpoly,rules->getFirst()->getRule()); 817 //Print("NEW ONE: "); 818 //pWrite(tempSpoly); 819 //Print("HIER\n"); 820 //sPolyList->print(); 821 //sleep(5); 822 } 823 } 824 } 825 } 826 } 827 //Print("AUCH HIER\n"); 789 828 temp = temp->getNext(); 790 829 } … … 915 954 // interreduction stuff 916 955 if(i<IDELEMS(id)) { 917 int timer2 = initTimer();918 startTimer();956 //int timer2 = initTimer(); 957 //startTimer(); 919 958 ideal tempId = kInterRed(gbPrev); 920 959 921 960 //idShow(tempId); 922 961 gbPrev = tempId; 923 timer2 = getTimer();924 Print("Timer INTERREDUCTION: %d\n",timer2);962 //timer2 = getTimer(); 963 //Print("Timer INTERREDUCTION: %d\n",timer2); 925 964 //idShow(gbPrev); 926 965 //qsortDegree(&gbPrev->m[0],&gbPrev->m[IDELEMS(gbPrev)-1]); -
kernel/f5gb.h
r9660f5 rbb02ea 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: f5gb.h,v 1.3 4 2009-04-02 12:59:59ederc Exp $ */4 /* $Id: f5gb.h,v 1.35 2009-04-05 07:49:18 ederc Exp $ */ 5 5 /* 6 6 * ABSTRACT: f5gb interface … … 20 20 */ 21 21 void qsortDegree(poly* left, poly* right); 22 23 /** 24 ========================================================================== 25 compare monomials, i.e. divisibility tests for criterion 1 and criterion 2 26 ========================================================================== 27 */ 28 bool compareMonomials(int* m1, int** m2, int numberOfRules); 22 29 23 30 /* … … 95 102 ===================================================================== 96 103 */ 97 inline LNode* findReductor(LNode* l, L Node* gPrevRedCheck, LList* gPrev, RList* rules, LTagList* lTag,RTagList* rTag);104 inline LNode* findReductor(LNode* l, LList* sPolyList, LNode* gPrevRedCheck, LList* gPrev, RList* rules, LTagList* lTag,RTagList* rTag); 98 105 99 106 /*
Note: See TracChangeset
for help on using the changeset viewer.