Changeset f6c6b01 in git
- Timestamp:
- Apr 2, 2009, 2:59:59 PM (14 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- c4a041219a2ad7d07a655aa5c8e89a483611a985
- Parents:
- a9fa9287cfb2d0c548c023e5b34bb1397da303b0
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/f5gb.cc
ra9fa92 rf6c6b01 123 123 //} 124 124 // reduction process of new S-polynomials and also adds new critical pairs to critPairs 125 int timer3 = initTimer();126 startTimer();125 //int timer3 = initTimer(); 126 //startTimer(); 127 127 reduction(sPolyList, critPairs, gPrev, rules, lTag, rTag, gbPrev); 128 timer3 = getTimer();129 reductionTime = reductionTime + timer3;128 //timer3 = getTimer(); 129 //reductionTime = reductionTime + timer3; 130 130 //Print("REDUCTION TIMER: %d\n",timer3); 131 131 // DEBUG STUFF FOR GPREV … … 619 619 // check if sPolyList has any elements 620 620 // NOTE: due to initialization sPolyList always has a default NULL element 621 LNode* temp ;622 while( sPolyList->getLength() > 0) {621 LNode* temp = sPolyList->getFirst(); 622 while(NULL != temp) { 623 623 // temp is the first element in the sPolyList which should be reduced 624 624 // due to earlier sorting this is the element of minimal degree AND 625 625 // minimal label 626 temp = sPolyList->getFirst();627 626 // delete the above first element from sPolyList, temp will be either reduced to 628 627 // zero or added to gPrev, but never come back to sPolyList 629 if(NULL != temp) { 630 sPolyList->setFirst(temp->getNext()); 631 } 632 else { 633 break; 634 } 628 sPolyList->setFirst(temp->getNext()); 635 629 poly tempNF = kNF(gbPrev,currQuotient,temp->getPoly()); 636 630 if(NULL != tempNF) { … … 640 634 // with label index = current label index: this is done such that there 641 635 // is no label corruption during the reduction process 642 topReduction(temp,sPolyList,gPrev, rules,lTag,rTag,gbPrev);636 topReduction(temp,sPolyList,gPrev,critPairs,rules,lTag,rTag,gbPrev); 643 637 644 638 } 645 if(NULL != temp->getPoly()) { 646 criticalPair(gPrev,critPairs,lTag,rTag,rules); 647 } 648 } 639 else { 640 reductionsToZero++; 641 delete temp; 642 } 643 //if(NULL != temp->getPoly()) { 644 // criticalPair(gPrev,critPairs,lTag,rTag,rules); 645 //} 646 temp = sPolyList->getFirst(); 647 } 648 //delete sPolyList; 649 649 } 650 650 … … 657 657 ===================================================================================== 658 658 */ 659 void topReduction(LNode* l, LList* sPolyList, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev) {659 void topReduction(LNode* l, LList* sPolyList, LList* gPrev, CList* critPairs, RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev) { 660 660 //Print("##########################################In topREDUCTION!########################################\n"); 661 661 // try l as long as there are reductors found by findReductor() 662 LNode* gPrevRedCheck = new LNode(lTag->getFirstCurrentIdx()); 663 LNode* tempRed = new LNode(); 662 LNode* gPrevRedCheck = lTag->getFirstCurrentIdx(); 663 LNode* tempRed; 664 poly pOne = pOne(); 664 665 do { 666 int timer5 = initTimer(); 667 startTimer(); 665 668 tempRed = findReductor(l,gPrevRedCheck,gPrev,rules,lTag,rTag); 669 timer5 = getTimer(); 670 reductionTime = reductionTime + timer5; 666 671 // if a reductor for l is found and saved in tempRed 667 672 if(NULL != tempRed) { … … 670 675 if(pLmCmp(tempRed->getTerm(),l->getTerm()) == 1) { 671 676 // needed sinc pSub destroys the arguments! 672 poly temp_poly_l = pInit(); 673 temp_poly_l = pCopy(l->getPoly()); 674 poly temp = pSub(tempRed->getPoly(),temp_poly_l); 677 //poly temp_poly_l = pInit(); 678 //temp_poly_l = pCopy(l->getPoly()); 679 //Print("VORHER: "); 680 //pWrite(tempRed->getPoly()); 681 poly temp = pMinus_mm_Mult_qq(tempRed->getPoly(),pOne,l->getPoly()); 682 //Print("NACHHER: "); 683 //pWrite(tempRed->getPoly()); 684 //Print("TEMP: "); 685 //pWrite(temp); 675 686 if(NULL != temp) { 676 687 pNorm(temp); … … 686 697 pDelete(&temp); 687 698 reductionsToZero++; 688 delete tempRed;699 //delete tempRed; 689 700 } 690 701 } … … 694 705 else { 695 706 696 poly temp_poly_l = pInit();697 temp_poly_l = pCopy(l->getPoly());698 poly temp = p Sub(temp_poly_l,tempRed->getPoly());707 //poly temp_poly_l = pInit(); 708 //temp_poly_l = pCopy(l->getPoly()); 709 poly temp = pMinus_mm_Mult_qq(tempRed->getPoly(),pOne,l->getPoly()); 699 710 if(NULL != temp) { 700 711 pNorm(temp); … … 723 734 pNorm(l->getPoly()); 724 735 gPrev->insert(l->getLPoly()); 736 criticalPair(gPrev,critPairs,lTag,rTag,rules); 725 737 } 726 738 break; … … 802 814 //Print("NUMBER: %d\n",r->N); 803 815 804 //int* ev = new int[r->N];805 //int ev2;806 //for(i=0;i<IDELEMS(id);i++) {807 //pGetExpV(id->m[i],ev);816 int* ev = new int[r->N +1]; 817 int ev2; 818 for(i=0;i<IDELEMS(id);i++) { 819 pGetExpV(id->m[i],ev); 808 820 //ev2 = pGetExp(id->m[i],1); 809 821 //pWrite(id->m[i]); … … 812 824 //Print("EXP2: %d\n",ev[2]); 813 825 //Print("EXP3: %d\n\n",ev[3]); 814 //}826 } 815 827 //delete ev; 816 828 -
kernel/f5gb.h
ra9fa92 rf6c6b01 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: f5gb.h,v 1.3 3 2009-03-18 13:39:13ederc Exp $ */4 /* $Id: f5gb.h,v 1.34 2009-04-02 12:59:59 ederc Exp $ */ 5 5 /* 6 6 * ABSTRACT: f5gb interface … … 88 88 ===================================================================================== 89 89 */ 90 inline void topReduction(LNode* l, LList* sPolyList, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev);90 inline void topReduction(LNode* l, LList* sPolyList, LList* gPrev, CList* critPairs, RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev); 91 91 92 92 /*
Note: See TracChangeset
for help on using the changeset viewer.