Changeset e3b5ed in git
- Timestamp:
- May 4, 2009, 3:30:53 PM (14 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 233f2e504906a97e837a6704ca5f2f22d86c4bb8
- Parents:
- 39e4239ad700dd19503501b393c68b7aabd191b5
- Location:
- kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/f5gb.cc
r39e423 re3b5ed 109 109 */ 110 110 LList* F5inc(int i, poly f_i, LList* gPrev, ideal gbPrev, poly ONE, LTagList* lTag, RList* rules, RTagList* rTag) { 111 Print("in f5inc\n");111 //Print("in f5inc\n"); 112 112 //pWrite(rules->getFirst()->getRuleTerm()); 113 113 int j; … … 147 147 //int timer4 = initTimer(); 148 148 //startTimer(); 149 critPairs->print();149 //critPairs->print(); 150 150 computeSPols(critPairsMinDeg,rTag,rules,sPolyList); 151 151 //timer4 = getTimer(); … … 162 162 //int timer3 = initTimer(); 163 163 //startTimer(); 164 sPolyList->print();165 reduction(sPolyList, critPairs, gPrev, rules, lTag, rTag, gbPrev);166 //newReduction(sPolyList, critPairs, gPrev, rules, lTag, rTag, gbPrev);164 //sPolyList->print(); 165 //reduction(sPolyList, critPairs, gPrev, rules, lTag, rTag, gbPrev); 166 newReduction(sPolyList, critPairs, gPrev, rules, lTag, rTag, gbPrev); 167 167 //timer3 = getTimer(); 168 168 //reductionTime = reductionTime + timer3; … … 357 357 //Print("%d\n",testNode->getIndex()); 358 358 if(pLmDivisibleByNoComp(testNode->getPoly(),u1)) { 359 Print("Criterion 1 NOT passed!\n");359 //Print("Criterion 1 NOT passed!\n"); 360 360 return true; 361 361 } … … 482 482 //Print("%d\n",testNode->getRuleIndex()); 483 483 if(pLmDivisibleByNoComp(testNode->getRuleTerm(),u1)) { 484 Print("-----------------Criterion 2 NOT passed!-----------------------------------\n");484 //Print("-----------------Criterion 2 NOT passed!-----------------------------------\n"); 485 485 //Print("INDEX: %d\n",l->getIndex()); 486 486 pDelete(&u1); … … 528 528 //pWrite(testNode->getRuleTerm()); 529 529 if(pLmDivisibleByNoComp(testNode->getRuleTerm(),u1)) { 530 Print("--------------------------Criterion 2 NOT passed!------------------------------\n");530 //Print("--------------------------Criterion 2 NOT passed!------------------------------\n"); 531 531 //Print("INDEX: %d\n",l->getIndex()); 532 532 pDelete(&u1); … … 587 587 //Print("RULE ADDED: \n"); 588 588 //pWrite(rules->getFirst()->getRuleTerm()); 589 //rules->print(); 589 590 // as sp = NULL, delete it 590 591 pDelete(&sp); … … 596 597 //Print("RULE ADDED: \n"); 597 598 //pWrite(rules->getFirst()->getRuleTerm()); 599 //rules->print(); 598 600 sPolyList->insertByLabel(ppMult_qq(temp->getT1(),temp->getLp1Term()),temp->getLp1Index(),sp,rules->getFirst()->getRule()); 599 601 } … … 620 622 //Print("RULE ADDED: \n"); 621 623 //pWrite(rules->getFirst()->getRuleTerm()); 624 //rules->print(); 622 625 // as sp = NULL, delete it 623 626 pDelete(&sp); … … 628 631 //Print("RULE ADDED: \n"); 629 632 //pWrite(rules->getFirst()->getRuleTerm()); 633 //rules->print(); 630 634 //Print("%d\n",rules->getFirst()->getRuleIndex()); 631 635 //Print("%p\n",sPolyList->getFirst()); … … 665 669 // delete the above first element from sPolyList, temp will be either reduced to 666 670 // zero or added to gPrev, but never come back to sPolyList 671 //pWrite(sPolyList->getFirst()->getPoly()); 672 //Print("LIST OF SPOLYNOMIALS!\n"); 673 //sPolyList->print(); 667 674 sPolyList->setFirst(temp->getNext()); 668 675 poly tempNF = kNF(gbPrev,currQuotient,temp->getPoly()); … … 673 680 // with label index = current label index: this is done such that there 674 681 // is no label corruption during the reduction process 682 //Print("lower label reduction: "); 683 //pWrite(tempNF); 675 684 topReduction(temp,sPolyList,gPrev,critPairs,rules,lTag,rTag,gbPrev); 676 685 … … 699 708 // check if sPolyList has any elements 700 709 // NOTE: due to initialization sPolyList always has a default NULL element 710 //Print("--1--\n"); 701 711 LNode* temp = sPolyList->getFirst(); 702 712 while(NULL != temp) { … … 706 716 // delete the above first element from sPolyList, temp will be either reduced to 707 717 // zero or added to gPrev, but never come back to sPolyList 718 //Print("LIST OF SPOLYNOMIALS!\n"); 719 //sPolyList->print(); 720 //pWrite(sPolyList->getFirst()->getPoly()); 708 721 sPolyList->setFirst(temp->getNext()); 709 poly tempNF = kNF(gbPrev,currQuotient,temp->getPoly()); 710 if(NULL != tempNF) { 711 pNorm(tempNF); 712 temp->setPoly(tempNF); 722 //pWrite(temp->getPoly()); 723 //poly tempNF = kNF(gbPrev,currQuotient,temp->getPoly()); 724 //Print("!!!\n"); 725 //if(NULL != tempNF) { 726 //pNorm(tempNF); 727 //temp->setPoly(tempNF); 728 //Print("lower label reduction: "); 729 //pWrite(tempNF); 713 730 // try further reductions of temp with polynomials in gPrev 714 731 // with label index = current label index: this is done such that there 715 732 // is no label corruption during the reduction process 716 findReducers(temp,sPolyList,g Prev,critPairs,rules,lTag,rTag);717 }718 else {719 reductionsToZero++;720 delete temp;721 }733 findReducers(temp,sPolyList,gbPrev,gPrev,critPairs,rules,lTag,rTag); 734 //} 735 //else { 736 // reductionsToZero++; 737 // delete temp; 738 //} 722 739 //if(NULL != temp->getPoly()) { 723 740 // criticalPair(gPrev,critPairs,lTag,rTag,rules); 724 741 //} 742 //Print("HIER AUCH ?\n"); 743 //Print("--2--\n"); 744 //sPolyList->print(); 745 //critPairs->print(); 725 746 temp = sPolyList->getFirst(); 747 //Print("%p\n",temp); 726 748 } 727 749 //sPolyList->print(); 728 750 //delete sPolyList; 751 //Print("REDUCTION FERTIG\n"); 729 752 } 730 753 … … 742 765 * ================================================================================ 743 766 */ 744 void findReducers(LNode* l, LList* sPolyList, LList* gPrev, CList* critPairs, RList* rules, LTagList* lTag, RTagList* rTag) {767 void findReducers(LNode* l, LList* sPolyList, ideal gbPrev, LList* gPrev, CList* critPairs, RList* rules, LTagList* lTag, RTagList* rTag) { 745 768 LList* good = new LList(); 746 769 LList* bad = new LList(); … … 750 773 LNode* tempRed = lTag->getFirstCurrentIdx(); 751 774 LNode* tempMon = monomials->getFirst(); 752 Print("IN FIND REDUCERS: "); 753 pWrite(l->getPoly()); 775 poly tempPoly = pInit(); 776 //Print("IN FIND REDUCERS: "); 777 //pWrite(l->getPoly()); 778 754 779 while(NULL != tempMon) { 755 780 // iteration over all monomials in tempMon 756 poly tempPoly = tempMon->getPoly(); 781 tempPoly = pCopy(l->getPoly()); 782 //Print("______________________NEW POLYNOMIAL TESTED IN MONOMIALS_______________________\n"); 783 757 784 while(NULL != tempPoly) { 758 785 // iteration of all elements in gPrev of the current index 786 787 //Print("LABEL OF REDUCED ELEMENT: "); 788 //Print("%p\n",tempPoly); 789 //pWrite(tempPoly); 790 pNorm(tempPoly); 791 //pWrite(l->getTerm()); 792 tempRed = gPrev->getFirst(); 793 //tempRed = lTag->getFirstCurrentIdx(); 759 794 while(NULL != tempRed) { 760 if(pDivisibleBy(tempRed->getPoly(),tempPoly)) { 795 //Print("POSSIBLE REDUCER: "); 796 //pWrite(tempRed->getPoly()); 797 //pWrite(tempRed->getTerm()); 798 //Print("TO BE REDUCED: "); 799 //pWrite(tempPoly); 800 //Print("DIVISIBLE? %d\n",pDivisibleBy(tempRed->getPoly(),tempPoly)); 801 if(pDivisibleBy(tempRed->getPoly(),tempPoly)) { 761 802 u = pDivide(pHead(tempPoly),pHead(tempRed->getPoly())); 762 803 pSetCoeff(u,nOne); 763 //poly red = ppMult_qq(u,temp->getPoly()); 764 //pNorm(red); 804 poly red = ppMult_qq(u,tempRed->getPoly()); 805 pNorm(red); 806 //pWrite(red); 765 807 // check if both have the same label 766 if(pLmCmp(ppMult_qq(u,tempRed->getTerm()),tempMon->getTerm()) != 0) { 808 if(tempRed->getIndex() != l->getIndex()) { 809 // passing criterion1 ? 810 if(!criterion1(gPrev,u,tempRed,lTag)) { 811 //Print("TO BE REDUCED: "); 812 //pWrite(tempPoly); 813 //Print("REDUCER: "); 814 pWrite(tempRed->getPoly()); 815 //pWrite(ppMult_qq(u,tempRed->getPoly())); 816 //pWrite(ppMult_qq(u,tempRed->getTerm())); 817 //Print("%d\n",tempRed->getIndex()); 818 //Print("+++++++++++++LIST OF MONOMIALS1+++++++++++++++++\n"); 819 poly tempRedPoly = pSub(ppMult_qq(u,tempRed->getPoly()),pHead(ppMult_qq(u,tempRed->getPoly()))); 820 pAdd(tempPoly,tempRedPoly); 821 //Print("REDUCTION STEP: \n"); 822 //pWrite(l->getPoly()); 823 //l->setPoly(pSub(l->getPoly(),ppMult_qq(u,tempRed->getPoly()))); 824 //pNorm(tempRedPoly); 825 //pWrite(l->getPoly()); 826 //monomials->insert(ppMult_qq(u,tempRed->getTerm()), tempRed->getIndex(), tempRedPoly,NULL); 827 //Print("+++++++++++++LIST OF MONOMIALS2+++++++++++++++++\n"); 828 //monomials->print(); 829 good->insert(pOne(),1,ppMult_qq(u,tempRed->getPoly()),NULL); 830 //Print("GOOD ELEMENTS: \n"); 831 //Print("%p\n",good->getFirst()); 832 //good->print(); 833 break; 834 } 835 836 } 837 else { 838 if(pLmCmp(ppMult_qq(u,tempRed->getTerm()),l->getTerm()) != 0) { 767 839 // passing criterion2 ? 768 840 if(!criterion2(gPrev->getFirst()->getIndex(), u,tempRed,rules,rTag)) { 769 841 // passing criterion1 ? 770 842 if(!criterion1(gPrev,u,tempRed,lTag)) { 771 if(pLmCmp(ppMult_qq(u,tempRed->getTerm()),tempMon->getTerm()) == 1) { 772 //Print("HIER1\n"); 843 if(pLmCmp(ppMult_qq(u,tempRed->getTerm()),l->getTerm()) == 1) { 844 //Print("BAD REDUCTION STUFF\n"); 845 //pWrite(tempRed->getPoly()); 846 //pWrite(ppMult_qq(u,tempRed->getTerm())); 847 //rules->insert(tempRed->getIndex(),ppMult_qq(u,tempRed->getTerm())); 848 //Print("\n\nRules:\n"); 849 //rules->print(); 773 850 bad->insertSP(tempRed->getLPoly()); 851 //Print("HERE\n"); 852 //pWrite(tempRed->getPoly()); 853 //sleep(5); 774 854 } 775 855 else { 776 monomials->insertSP(tempRed->getLPoly()); 777 good->insertSP(tempRed->getLPoly()); 778 //Print("HIER2\n"); 856 //Print("TO BE REDUCED: "); 857 //pWrite(tempPoly); 858 //Print("REDUCER: "); 859 //pWrite(tempRed->getPoly()); 860 //pWrite(ppMult_qq(u,tempRed->getPoly())); 861 //pWrite(ppMult_qq(u,tempRed->getTerm())); 862 //Print("%d\n",tempRed->getIndex()); 863 //Print("+++++++++++++LIST OF MONOMIALS1+++++++++++++++++\n"); 864 poly tempRedPoly = pSub(ppMult_qq(u,tempRed->getPoly()),pHead(ppMult_qq(u,tempRed->getPoly()))); 865 pAdd(tempPoly,tempRedPoly); 866 //Print("REDUCTION STEP: \n"); 867 //pWrite(l->getPoly()); 868 //l->setPoly(pSub(l->getPoly(),ppMult_qq(u,tempRed->getPoly()))); 869 //pNorm(tempRedPoly); 870 //pWrite(l->getPoly()); 871 //monomials->insert(ppMult_qq(u,tempRed->getTerm()), tempRed->getIndex(), tempRedPoly,NULL); 872 //Print("+++++++++++++LIST OF MONOMIALS2+++++++++++++++++\n"); 873 //monomials->print(); 874 good->insert(pOne(),l->getIndex(),ppMult_qq(u,tempRed->getPoly()),NULL); 875 //Print("GOOD ELEMENTS: \n"); 876 //Print("%p\n",good->getFirst()); 877 //good->print(); 878 break; 779 879 } 780 880 } … … 783 883 } 784 884 } 885 886 } 785 887 tempRed = tempRed->getNext(); 888 //Print("HERE TOO\n"); 889 //pWrite(tempRed->getPoly()); 786 890 } 787 891 pIter(tempPoly); 788 } 892 //Print("ITERATION: "); 893 //pWrite(tempPoly); 894 } 895 789 896 tempMon = tempMon->getNext(); 790 } 791 // if there are reducers than reduce l 897 //Print("NEXT ELEMENT TO BE REDUCED: "); 898 //if(NULL != tempMon) { 899 // pWrite(tempMon->getPoly()); 900 //} 901 //else { 902 // Print("NICHTS MEHR DA\n"); 903 //} 904 } 905 // if there are reducers than reduce l 792 906 if(NULL != good->getFirst()) { 907 //Print("HIER IN GOOD REDUCTION\n"); 793 908 LNode* tempGood = good->getFirst(); 794 909 ideal reductionId = idInit(good->getLength(),1); 795 910 int i; 911 //Print("\n\n"); 796 912 for(i=0;i<good->getLength();i++) { 797 913 reductionId->m[i] = tempGood->getPoly(); 914 //Print("REDUCERS:"); 915 //pWrite(tempGood->getPoly()); 916 //Print("%p\n",tempGood); 798 917 tempGood = tempGood->getNext(); 799 918 } 919 //idShow(reductionId); 920 //reductionId = idAdd(reductionId,gbPrev); 921 //Print("\n\nREDUCTION PROCESS DONE TWICE!"); 922 //idDelMultiples(reductionId); 923 //idShow(reductionId); 800 924 poly temp = kNF(reductionId,currQuotient,l->getPoly()); 925 //pWrite(temp); 926 //poly temp2 = kNF(reductionId,currQuotient,temp); 927 //pWrite(temp2); 928 //Print("\n\n"); 801 929 if(NULL != temp) { 802 930 pNorm(temp); 803 Print("NEW REDUCTION: ");804 pWrite(temp);931 //Print("NEW REDUCTION: "); 932 //pWrite(temp); 805 933 l->setPoly(temp); 806 pWrite(l->getPoly()); 934 //Print("ELEMENT ADDED TO GPREV: "); 935 //pWrite(l->getPoly()); 936 //pWrite(l->getTerm()); 937 //Print("%p\n",gPrev->getLast()); 938 //pWrite(gPrev->getLast()->getPoly()); 807 939 gPrev->insert(l->getLPoly()); 808 rules->print(); 940 //Print("%p\n",gPrev->getLast()); 941 //pWrite(gPrev->getLast()->getPoly()); 942 //rules->print(); 809 943 criticalPair(gPrev,critPairs,lTag,rTag,rules); 944 //Print("LIST OF CRITICAL PAIRS: \n"); 945 //critPairs->print(); 810 946 } 811 947 else { … … 814 950 } 815 951 //pWrite(temp); 816 for(i=0;i<IDELEMS(reductionId);i++) { 817 reductionId->m[i] = NULL; 818 } 952 //for(i=0;i<IDELEMS(reductionId);i++) { 953 //} 954 //idShow(reductionId); 955 //Print("HIER\n"); 956 //Print("ADDRESS OF IDEAL: %p\n",&reductionId); 819 957 idDelete(&reductionId); 820 958 //Print("HIER\n"); 821 959 } 822 960 else { 823 961 //pWrite(l->getPoly()); 824 962 gPrev->insert(l->getLPoly()); 825 Print("GENAU HIER: "); 963 //Print("ELEMENT ADDED TO GPREV: "); 964 //pWrite(l->getPoly()); 965 //pWrite(l->getTerm()); 966 //Print("GENAU HIER: "); 967 //pWrite(l->getPoly()); 968 criticalPair(gPrev,critPairs,lTag,rTag,rules); 969 //Print("LIST OF CRITICAL PAIRS: \n"); 970 //critPairs->print(); 971 } 972 // if there are "bad" reducers than try to compute new S-polynomials and rules 973 /* 974 if(NULL != bad->getFirst()) { 975 Print("BAD STUFF LIST:\n"); 976 bad->print(); 977 LNode* tempBad = bad->getFirst(); 826 978 pWrite(l->getPoly()); 827 criticalPair(gPrev,critPairs,lTag,rTag,rules);828 }829 // if there are "bad" reducers than try to compute new S-polynomials and rules830 if(NULL != bad->getFirst()) {831 LNode* tempBad = bad->getFirst();832 979 while(NULL != tempBad) { 833 980 if(pDivisibleBy(tempBad->getPoly(),l->getPoly())) { 981 Print("BAD STUFF\n"); 982 pWrite(l->getPoly()); 983 pWrite(tempBad->getPoly()); 834 984 u = pDivide(pHead(l->getPoly()),pHead(tempBad->getPoly())); 985 Print("MULTIPLIER: "); 986 pWrite(u); 835 987 pSetCoeff(u,nOne); 836 988 if(pLmCmp(ppMult_qq(u,tempBad->getTerm()),l->getTerm()) != 0) { … … 843 995 poly temp = pSub(ppMult_qq(u,tempBad->getPoly()),l->getPoly()); 844 996 LNode* tempBadNew = new LNode(ppMult_qq(u,tempBad->getTerm()),tempBad->getIndex(),temp,rules->getFirst()->getRule()); 997 pWrite(temp); 998 pWrite(tempBadNew->getPoly()); 845 999 //tempRed->getLPoly()->setRule(rules->getFirst()->getRule()); 846 1000 tempBadNew->setDel(1); … … 850 1004 } 851 1005 } 1006 Print("HIER\n"); 852 1007 tempBad = tempBad->getNext(); 853 } 854 } 1008 Print("%p\n",tempBad); 1009 } 1010 } 1011 Print("HIER AUCH\n"); 1012 1013 */ 1014 855 1015 856 1016 } … … 889 1049 //poly temp = pMinus_mm_Mult_qq(tempRed->getPoly(),pOne,l->getPoly()); 890 1050 poly temp = ksOldSpolyRedNew(l->getPoly(),tempRed->getPoly()); 1051 rules->insert(tempRed->getIndex(),tempRed->getTerm()); 891 1052 //Print("NACHHER: "); 892 1053 //pWrite(tempRed->getPoly()); … … 897 1058 //tempRed->setPoly(temp); 898 1059 //tempRed->setDel(1); 899 rules->insert(tempRed->getIndex(),tempRed->getTerm());1060 //rules->insert(tempRed->getIndex(),tempRed->getTerm()); 900 1061 LNode* tempRedNew = new LNode(tempRed->getTerm(),tempRed->getIndex(),temp,rules->getFirst()->getRule()); 901 1062 //tempRed->getLPoly()->setRule(rules->getFirst()->getRule()); … … 918 1079 //temp_poly_l = pCopy(l->getPoly()); 919 1080 //poly temp = pMinus_mm_Mult_qq(tempRed->getPoly(),pOne,l->getPoly()); 1081 //Print("REDUCER: "); 1082 //pWrite(tempRed->getPoly()); 1083 //pWrite(tempRed->getTerm()); 920 1084 poly temp = ksOldSpolyRedNew(l->getPoly(),tempRed->getPoly()); 1085 //Print("REDUCED ELEMENT: "); 921 1086 if(NULL != temp) { 922 1087 pNorm(temp); 1088 //pWrite(temp); 923 1089 poly tempNF = kNF(gbPrev,currQuotient,temp); 924 1090 pNorm(tempNF); … … 944 1110 if(NULL != l->getPoly()) { 945 1111 pNorm(l->getPoly()); 1112 //Print("ELEMENT ADDED TO GPREV: "); 1113 //pWrite(l->getPoly()); 946 1114 gPrev->insert(l->getLPoly()); 947 Print("TEMP RED == 0 ");948 pWrite(l->getPoly());949 pWrite(l->getTerm());950 rules->print();1115 //Print("TEMP RED == 0 "); 1116 //pWrite(l->getPoly()); 1117 //pWrite(l->getTerm()); 1118 //rules->print(); 951 1119 criticalPair(gPrev,critPairs,lTag,rTag,rules); 1120 //Print("LIST OF CRITICAL PAIRS: \n"); 1121 //critPairs->print(); 952 1122 } 953 1123 break; … … 1050 1220 // DEBUGGING STUFF START 1051 1221 //Print("NUMBER: %d\n",r->N); 1052 1222 /* 1053 1223 int* ev = new int[r->N +1]; 1054 1224 for(i=0;i<IDELEMS(id);i++) { … … 1062 1232 } 1063 1233 delete ev; 1064 1234 */ 1065 1235 /*DEBUGGING STUFF END */ 1066 1236 … … 1085 1255 id = idNew; 1086 1256 //qsortDegree(&id->m[0],&id->m[IDELEMS(id)-1]); 1087 idShow(id);1257 //idShow(id); 1088 1258 LList* gPrev = new LList(ONE, i, id->m[0]); 1089 1259 //idShow(id); … … 1132 1302 //} 1133 1303 } 1134 if(counter != gPrev->count(gPrevTag->getNext())) {1135 Print("----------------------------------WRONG COUNTING---------------------------\n");1136 }1137 1304 gbPrev = idAdd(gbPrev,gbAdd); 1138 1305 //idShow(gbPrev); … … 1151 1318 //int timer2 = initTimer(); 1152 1319 //startTimer(); 1320 //idShow(gbPrev); 1153 1321 ideal tempId = kInterRed(gbPrev); 1154 1322 //idShow(kInterRed(gbPrev)); 1155 1323 //idShow(tempId); 1156 1324 gbPrev = tempId; … … 1203 1371 } 1204 1372 gbLength = gPrev->getLength(); 1205 //Print("HIER\n"); 1206 } 1373 /* 1374 if(gPrev->getLength() == 4) { 1375 poly temp1 = pInit(); 1376 poly temp2 = pInit(); 1377 poly u = pInit(); 1378 temp1 = pCopy(gbPrev->m[3]); 1379 temp2 = pCopy(gbPrev->m[2]); 1380 u = pCopy(gbPrev->m[0]); 1381 pIter(u); 1382 pIter(u); 1383 pIter(u); 1384 pIter(u); 1385 //pWrite(u); 1386 number n = nInit(3); 1387 pSetCoeff(u,n); 1388 poly tempNew = pAdd(temp1,pMult(u,temp2)); 1389 gbPrev->m[3] = tempNew; 1390 LNode* tempNode4 = gPrev->getFirst(); 1391 tempNode4 = tempNode4->getNext()->getNext()->getNext(); 1392 tempNode4->setPoly(tempNew); 1393 //Print("HIER\n"); 1394 } 1395 */ 1207 1396 //gPrev->print(); 1208 1397 //int anzahl = 1; … … 1219 1408 //Print("===================================================\n"); 1220 1409 //Print("JA\n"); 1221 Print("LENGTH OF GPREV: %d\n",gPrev->getLength()); 1410 //Print("LENGTH OF GPREV: %d\n",gPrev->getLength()); 1411 //idShow(gbPrev); 1222 1412 } 1223 1413 //idShow(gbPrev); 1414 } 1224 1415 Print("\n\nNumber of zero-reductions: %d\n",reductionsToZero); 1225 1416 timer = getTimer(); … … 1235 1426 delete rTag; 1236 1427 delete gPrev; 1237 reductionTime = 0; 1238 spolsTime = 0; 1428 reductionsToZero = 0; 1429 highestDegree = 0; 1430 reductionTime = 0; 1431 spolsTime = 0; 1239 1432 return(gbPrev); 1240 1433 -
kernel/f5gb.h
r39e423 re3b5ed 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: f5gb.h,v 1.3 7 2009-04-20 13:54:50ederc Exp $ */4 /* $Id: f5gb.h,v 1.38 2009-05-04 13:30:53 ederc Exp $ */ 5 5 /* 6 6 * ABSTRACT: f5gb interface … … 102 102 ======================================================================== 103 103 */ 104 inline void newReduction(LList* sPolyList, CList* critPairs, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, 105 ideal gbPrev); 104 inline void newReduction(LList* sPolyList, CList* critPairs, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev); 106 105 107 106 /*! … … 117 116 * ================================================================================ 118 117 */ 119 void findReducers(LNode* l, LList* sPolyList, LList* gPrev, CList* critPairs, RList* rules, LTagList* lTag, RTagList* rTag);118 void findReducers(LNode* l, LList* sPolyList, ideal gbPrev, LList* gPrev, CList* critPairs, RList* rules, LTagList* lTag, RTagList* rTag); 120 119 121 120 /* -
kernel/f5lists.cc
r39e423 re3b5ed 76 76 // needed for list gPrev 77 77 inline LNode* LNode::insert(LPoly* lp) { 78 //Print("INSERTION: \n");79 78 //Print("LAST GPREV: "); 80 79 //pWrite(this->getPoly()); 81 LNode* newElement = new LNode(lp, NULL); 82 this->next = newElement; 83 return newElement; 80 if(NULL == this) { 81 LNode* newElement = new LNode(lp,this); 82 return newElement; 83 } 84 else { 85 LNode* newElement = new LNode(lp, NULL); 86 this->next = newElement; 87 return newElement; 88 } 84 89 } 85 90 86 91 inline LNode* LNode::insert(poly t, int i, poly p, Rule* r) { 87 LNode* newElement = new LNode(t, i, p, r, NULL); 88 this->next = newElement; 89 return newElement; 92 if(NULL == this) { 93 LNode* newElement = new LNode(t,i,p,r,this); 94 return newElement; 95 } 96 else { 97 LNode* newElement = new LNode(t, i, p, r, NULL); 98 this->next = newElement; 99 return newElement; 100 } 90 101 } 91 102 … … 152 163 153 164 inline LNode* LNode::insertByLabel(LNode* l) { 154 //Print("ADDING SOLYS TO THE LIST\n");165 Print("ADDING SOLYS TO THE LIST\n"); 155 166 //Print("new element: "); 156 167 //pWrite(t); … … 338 349 void LList::insert(LPoly* lp) { 339 350 last = last->insert(lp); 351 if(NULL == first) { 352 first = last; 353 } 340 354 //Print("NEW LAST GPREV: "); 341 355 //pWrite(last->getPoly()); 356 //Print("%p\n",first); 357 //pWrite(first->getPoly()); 342 358 length++; 343 359 //Print("LENGTH %d\n",length); … … 346 362 void LList::insert(poly t,int i, poly p, Rule* r) { 347 363 last = last->insert(t,i,p,r); 364 if(NULL == first) { 365 first = last; 366 } 348 367 length++; 349 368 //Print("LENGTH %d\n",length);
Note: See TracChangeset
for help on using the changeset viewer.