Changeset 19567b in git for kernel/f5gb.cc
- Timestamp:
- Mar 31, 2009, 9:36:00 AM (14 years ago)
- Branches:
- (u'spielwiese', 'd1ba061a762c62d3a25159d8da8b6e17332291fa')
- Children:
- 798f72186f85eaf9224aef1590336c69ccc6a3f9
- Parents:
- 0e61893242df08dedfa5b71b664d0ddac5cc7bd3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/f5gb.cc
r0e6189 r19567b 109 109 // NOTE: inside there is a second check of criterion 2 if new rules are 110 110 // added 111 int timer4 = initTimer();112 startTimer();111 //int timer4 = initTimer(); 112 //startTimer(); 113 113 computeSPols(critPairsMinDeg,rTag,rules,sPolyList); 114 timer4 = getTimer();115 Print("SPOLS TIMER: %d\n",timer4);116 spolsTime = spolsTime + timer4;114 //timer4 = getTimer(); 115 //Print("SPOLS TIMER: %d\n",timer4); 116 //spolsTime = spolsTime + timer4; 117 117 // DEBUG STUFF FOR SPOLYLIST 118 118 LNode* temp = sPolyList->getFirst(); … … 128 128 timer3 = getTimer(); 129 129 reductionTime = reductionTime + timer3; 130 Print("REDUCTION TIMER: %d\n",timer3);130 //Print("REDUCTION TIMER: %d\n",timer3); 131 131 // DEBUG STUFF FOR GPREV 132 132 //temp = gPrev->getFirst(); … … 619 619 // check if sPolyList has any elements 620 620 // NOTE: due to initialization sPolyList always has a default NULL element 621 LNode* temp; 621 622 while(sPolyList->getLength() > 0) { 622 //Print("SPOLYLIST LENGTH: %d\n",sPolyList->getLength());623 if(sPolyList->getLength() > 1) {624 //Print("%p\n",sPolyList->getFirst());625 //Print("%p\n",sPolyList->getFirst()->getLPoly());626 //Print("%p\n",sPolyList->getFirst()->getNext());627 //Print("%p\n",sPolyList->getFirst()->getNext()->getLPoly());628 //Print("%p\n",sPolyList->getFirst());629 }630 //if(gPrev->getLast()->getIndex() == 5) {631 //sPolyList->print();632 //sleep(5);633 //}634 635 623 // temp is the first element in the sPolyList which should be reduced 636 624 // due to earlier sorting this is the element of minimal degree AND 637 625 // minimal label 638 LNode* temp = sPolyList->getFirst(); 639 //pWrite(temp->getPoly()); 626 temp = sPolyList->getFirst(); 640 627 // delete the above first element from sPolyList, temp will be either reduced to 641 628 // zero or added to gPrev, but never come back to sPolyList 642 629 if(NULL != temp) { 643 630 sPolyList->setFirst(temp->getNext()); 644 //Print("HIER\n");645 631 } 646 632 else { 647 633 break; 648 634 } 649 //Print("HALLO %p\n",temp->getPoly());650 //Print("%p\n",temp->getPoly());651 //pWrite(temp->getPoly());652 //idShow(gbPrev);653 635 poly tempNF = kNF(gbPrev,currQuotient,temp->getPoly()); 654 //Print("LENGTH: %d\n",sPolyList->getLength());655 //pWrite(tempNF);656 //pWrite(temp->getPoly());657 636 if(NULL != tempNF) { 658 637 pNorm(tempNF); 659 // write the reduced polynomial in temp660 638 temp->setPoly(tempNF); 661 639 // try further reductions of temp with polynomials in gPrev … … 666 644 } 667 645 if(NULL != temp->getPoly()) { 668 //CList* newCritPairs = new CList;669 //Print("##################IN CRITPAIRS IN REDUCTION#####################\n");670 646 criticalPair(gPrev,critPairs,lTag,rTag,rules); 671 //Print("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++H I E R++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); 672 } 673 else { 674 //delete temp; 675 LNode* tempLoop = gPrev->getFirst(); 676 //Print("AUSGABE IN REDUCTION:\n"); 677 //while(NULL != tempLoop) { 678 //pWrite(tempLoop->getPoly()); 679 //tempLoop = tempLoop->getNext(); 680 //} 681 //sleep(10); 682 } 683 647 } 684 648 } 685 649 } … … 698 662 do { 699 663 LNode* gPrevRedCheck = new LNode(lTag->getFirstCurrentIdx()); 700 //Print("gPrevCheckPOLY: ");701 //pWrite(gPrevRedCheck->getPoly());702 664 LNode* tempRed = new LNode(); 703 //Print("TESTED POLYNOMIAL IN THE FOLLOWING: ");704 //pWrite(l->getPoly());705 //Print("HIER\n");706 665 tempRed = findReductor(l,gPrevRedCheck,gPrev,rules,lTag,rTag); 707 //Print("TEMPRED NEXT: %p\n",tempRed->getNext());708 //Print("--------------------------------HIER DEBUG 2----------------------------------\n");709 666 // if a reductor for l is found and saved in tempRed 710 667 if(NULL != tempRed) { 711 668 // if label of reductor is greater than the label of l we have to built a new element 712 669 // and add it to sPolyList 713 //Print("REDUCTOR POLYNOMIAL: ");714 //pWrite(tempRed->getPoly());715 //Print("TEMPRED: %p\n",tempRed);716 //Print("TERM: ");717 //pWrite(tempRed->getTerm());718 670 if(pLmCmp(tempRed->getTerm(),l->getTerm()) == 1) { 719 671 // needed sinc pSub destroys the arguments! 720 //Print("H----------I------------E--------------R\n");721 672 poly temp_poly_l = pInit(); 722 673 temp_poly_l = pCopy(l->getPoly()); 723 //Print("POLYNOMIAL L: ");724 //pWrite(l->getPoly());725 //pWrite(temp_poly_l);726 674 poly temp = pSub(tempRed->getPoly(),temp_poly_l); 727 //Print("POLYNOMIAL L: ");728 //pWrite(l->getPoly());729 //pWrite(temp_poly_l);730 //Print("AFTER REDUCTION STEP: ");731 //pWrite(temp);732 //sleep(20);733 //pWrite(temp);734 675 if(NULL != temp) { 735 676 pNorm(temp); 736 677 tempRed->setPoly(temp); 737 678 tempRed->setDel(1); 738 // for debugging739 //pWrite(tempRed->getPoly());740 //Print("RULE ADDED\n");741 679 rules->insert(tempRed->getIndex(),tempRed->getTerm()); 742 680 tempRed->getLPoly()->setRule(rules->getFirst()->getRule()); 743 //Print("%p\n",sPolyList->getFirst());744 //Print("%p\n",sPolyList->getFirst()->getLPoly());745 //Print("SPOLYLIST LENGTH: %d\n",sPolyList->getLength());746 //sPolyList->print();747 748 681 sPolyList->insertByLabel(tempRed); 749 //sPolyList->print();750 //Print("SPOLYLIST LENGTH: %d\n",sPolyList->getLength());751 //Print("OH JE\n");752 682 } 753 683 else { 754 684 pDelete(&temp); 755 685 reductionsToZero++; 756 //Print("RULE ADDED\n");757 //rules->insert(tempRed->getIndex(),tempRed->getTerm());758 //pWrite(rules->getFirst()->getRuleTerm());759 //Print("DELETE TEMPRED\n");760 686 delete tempRed; 761 687 } … … 765 691 // after subtraction 766 692 else { 693 767 694 poly temp_poly_l = pInit(); 768 695 temp_poly_l = pCopy(l->getPoly()); 769 696 poly temp = pSub(temp_poly_l,tempRed->getPoly()); 770 //Print("AFTER REDUCTION STEP: ");771 //pWrite(temp);772 697 if(NULL != temp) { 773 698 pNorm(temp); 774 699 poly tempNF = kNF(gbPrev,currQuotient,temp); 775 700 pNorm(tempNF); 776 //pWrite(tempNF);777 701 if(NULL == tempNF) { 778 702 reductionsToZero++; … … 783 707 l->setPoly(tempNF); 784 708 785 //pWrite(l->getPoly());786 709 gPrevRedCheck = lTag->getFirstCurrentIdx(); 787 710 } 788 711 else { 789 //Print("ZERO REDUCTION!\n");790 712 reductionsToZero++; 791 713 pDelete(&temp); 792 714 l->setPoly(NULL); 793 //pWrite(gPrev->getLast()->getPoly());794 715 break; 795 716 } … … 799 720 if(NULL != l->getPoly()) { 800 721 pNorm(l->getPoly()); 801 //Print("----------------------------------ADDED TO GPREV IN TOPREDUCTION:-------------------------------------- ");802 //pWrite(l->getPoly());803 //pWrite(l->getTerm());804 //Print("INDEX: %d\n\n\n", l->getIndex());805 //sleep(20);806 722 gPrev->insert(l->getLPoly()); 807 //Print("GPREV: \n");808 LNode* tempLoop = gPrev->getFirst();809 //while(NULL != tempLoop) {810 //Print("HERE\n");811 //pWrite(tempLoop->getPoly());812 //tempLoop = tempLoop->getNext();813 //}814 723 } 815 724 break; … … 826 735 LNode* findReductor(LNode* l, LNode* gPrevRedCheck, LList* gPrev, RList* rules, LTagList* lTag,RTagList* rTag) { 827 736 // allociation of memory for the possible reductor 828 //Print("IN FIND REDUCTOR\n");829 737 poly u = pOne(); 830 738 poly red = pOne(); … … 837 745 // not from the first element of gPrev with the current index 838 746 temp = gPrevRedCheck; 839 //temp = lTag->getFirstCurrentIdx();840 //Print("GPREVREDCHECK: %p\n",gPrevRedCheck);841 //pWrite(gPrevRedCheck->getPoly());842 747 // search for reductors until we are at the end of gPrev resp. at the 843 748 // end of the elements of the current index 844 749 while(NULL != temp && temp->getIndex() == l->getIndex()) { 845 //pWrite(temp->getPoly());846 //Print("INDEX: %d\n",temp->getIndex());847 750 // does the head of the element of gPrev divides the head of 848 751 // the to be reduced element? 849 //Print("-------------FOUND REDUCTORS----------------------\n");850 //Print("\n");851 //pWrite(temp->getPoly());852 //pWrite(temp->getTerm());853 //pWrite(t);854 //Print("HALLO\n");855 752 if(pLmDivisibleByNoComp(pHead(temp->getPoly()),t)) { 856 //Print("HALLO\n");857 753 // get all the information needed for the following tests 858 754 // of the criteria 859 755 u = pDivide(t,pHead(temp->getPoly())); 860 756 pSetCoeff(u,nOne); 861 //Print("HIER FINDRED\n");862 //pWrite(u);863 //Print("\n");864 757 red = ppMult_qq(u,temp->getPoly()); 865 758 pNorm(red); 866 //u = ppMult_qq(u,temp->getTerm());867 //pSetCoeff(u,nOne);868 759 // check if both have the same label 869 //Print("HALLO\n");870 760 if(pLmCmp(u,l->getTerm()) != 0) { 871 //Print("HALLO\n");872 761 // passing criterion2 ? 873 762 if(!criterion2(gPrev->getFirst()->getIndex(), u,temp,rules,rTag)) { 874 763 // passing criterion1 ? 875 764 if(!criterion1(gPrev,u,temp,lTag)) { 876 //Print("HIER DEBUG\n");877 765 gPrevRedCheck = temp->getNext(); 878 766 LNode* redNode = new LNode(ppMult_qq(u,temp->getTerm()),temp->getIndex(),red,NULL,NULL); … … 882 770 } 883 771 } 884 //Print("%p\n",temp->getNext());885 //pWrite(temp->getPoly());886 //Print("HALLO\n");887 772 temp = temp->getNext(); 888 773 } 889 774 890 775 // delete temp; 891 //Print("1st gPrev: ");892 //pWrite(gPrev->getFirst()->getPoly());893 //Print("2nd gPrev: ");894 //pWrite(gPrev->getFirst()->getNext()->getPoly());895 776 return NULL; 896 777 } … … 1093 974 timer = getTimer(); 1094 975 Print("Highest Degree during computations: %d\n",highestDegree); 1095 Print("Time for computations: %d/1000 seconds\n",timer);976 Print("Time for computations: %d/10000 seconds\n",timer); 1096 977 //LNode* temp = gPrev->getFirst(); 1097 978 //while(NULL != temp) {
Note: See TracChangeset
for help on using the changeset viewer.