Changeset e90881 in git for kernel/f5gb.cc
- Timestamp:
- Mar 29, 2009, 7:17:09 PM (15 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- c6512c014a0813cb992533ab4dd571597c561ea4
- Parents:
- 53e33d93f45a825808d84cade536120482dc46c3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/f5gb.cc
r53e33d9 re90881 26 26 #include "f5lists.h" 27 27 #include "timer.h" 28 int reductionsToZero = 0; 29 28 int reductionsToZero = 0; 29 int reductionTime = 0; 30 int spolsTime = 0; 31 int highestDegree = 0; 30 32 /* 31 33 ==================================================================== … … 91 93 // computation of critical pairs with checking of criterion 1 and criterion 2 and saving them 92 94 // in the list critPairs 93 Print("END F5INC\n");94 95 criticalPair(gPrev, critPairs, lTag, rTag, rules); 95 96 static LList* sPolyList = new LList(); … … 108 109 // NOTE: inside there is a second check of criterion 2 if new rules are 109 110 // added 111 int timer4 = initTimer(); 112 startTimer(); 110 113 computeSPols(critPairsMinDeg,rTag,rules,sPolyList); 114 timer4 = getTimer(); 115 Print("SPOLS TIMER: %d\n",timer4); 116 spolsTime = spolsTime + timer4; 111 117 // DEBUG STUFF FOR SPOLYLIST 112 118 LNode* temp = sPolyList->getFirst(); … … 117 123 //} 118 124 // reduction process of new S-polynomials and also adds new critical pairs to critPairs 125 int timer3 = initTimer(); 126 startTimer(); 119 127 reduction(sPolyList, critPairs, gPrev, rules, lTag, rTag, gbPrev); 120 128 timer3 = getTimer(); 129 reductionTime = reductionTime + timer3; 130 Print("REDUCTION TIMER: %d\n",timer3); 121 131 // DEBUG STUFF FOR GPREV 122 132 //temp = gPrev->getFirst(); … … 173 183 */ 174 184 //gPrev->print(); 185 Print("COMPLETE REDUCTION TIME UNTIL NOW: %d\n",reductionTime); 186 Print("COMPLETE SPOLS TIME UNTIL NOW: %d\n",spolsTime); 175 187 return gPrev; 176 188 } … … 510 522 // the second component is tested only when it has the actual index, otherwise there is 511 523 // no new rule to test since the last test in subalgorithm criticalPair() 524 if(highestDegree < pDeg(ppMult_qq(temp->getT1(),temp->getLp1Poly()))) { 525 highestDegree = pDeg(ppMult_qq(temp->getT1(),temp->getLp1Poly())); 526 //pWrite(pHead(ppMult_qq(temp->getT1(),temp->getLp1Poly()))); 527 } 512 528 if(temp->getLp2Index() == temp->getLp1Index()) { 513 529 if(!criterion2(temp->getT2(),temp->getAdLp2(),rules,temp->getTestedRule())) { … … 719 735 pNorm(temp); 720 736 tempRed->setPoly(temp); 721 //pWrite(tempRed->getPoly());737 tempRed->setDel(1); 722 738 // for debugging 723 739 //pWrite(tempRed->getPoly()); … … 900 916 //Print("LTAG BEGINNING: %p\n",lTag); 901 917 902 // DEBUGGING STUFF START918 // DEBUGGING STUFF START 903 919 //Print("NUMBER: %d\n",r->N); 904 int* ev = new int[r->N]; 905 for(i=0;i<IDELEMS(id);i++) { 906 pGetExpV(id->m[i],ev); 907 pWrite(id->m[i]); 908 Print("EXP1: %d\n",ev[1]); 909 Print("EXP2: %d\n",ev[2]); 910 Print("EXP3: %d\n\n",ev[3]); 911 } 920 921 //int* ev = new int[r->N]; 922 //int ev2; 923 //for(i=0;i<IDELEMS(id);i++) { 924 //pGetExpV(id->m[i],ev); 925 //ev2 = pGetExp(id->m[i],1); 926 //pWrite(id->m[i]); 927 //Print("%d\n",ev2); 928 //Print("EXP1: %d\n",ev[1]); 929 //Print("EXP2: %d\n",ev[2]); 930 //Print("EXP3: %d\n\n",ev[3]); 931 //} 912 932 //delete ev; 913 //DEBUGGING STUFF END 933 934 /*DEBUGGING STUFF END */ 914 935 915 936 // first element in rTag is first element of rules which is NULL RNode, … … 957 978 //pWrite(gPrevTag->getPoly()); 958 979 gPrev = F5inc(i, id->m[i-1], gPrev, gbPrev, ONE, lTag, rules, rTag); 980 Print("%d\n",gPrev->count(gPrevTag->getNext())); 981 Print("%d\n",gPrev->getLength()); 959 982 //Print("____________________________________ITERATION STEP DONE________________________________________\n"); 960 983 … … 963 986 // computing new groebner basis gbPrev 964 987 if(gPrev->getLength() > gbLength) { 965 ideal gbAdd = idInit(gPrev->getLength()-gbLength,1); 966 LNode* temp = gPrevTag; 967 //Print("%p\n",gPrevTag); 968 //Print("%p\n",gPrev->getLast()); 969 //pWrite(temp->getPoly()); 970 //Print("LENGTH OF GPREV LIST: %d\n",gPrev->getLength()); 971 //Print("%d\n",gbLength); 972 //Print("%d\n",gPrev->getLength()-gbLength-1); 973 for(j=0;j<=gPrev->getLength()-gbLength-1;j++) { 974 //Print("YES\n"); 975 temp = temp->getNext(); 976 if(temp) { 977 //Print("%p\n",temp); 978 //pWrite(temp->getPoly()); 979 //Print("%p\n",temp->getNext()); 988 if(i < IDELEMS(id)) { 989 ideal gbAdd = idInit(gPrev->getLength()-gbLength,1); 990 LNode* temp = gPrevTag; 991 int counter = 0; 992 for(j=0;j<=gPrev->getLength()-gbLength-1;j++) { 993 temp = temp->getNext(); 994 if(0 == temp->getDel()) { 995 counter++; 996 gbAdd->m[j] = temp->getPoly(); 997 } 998 //if(1 == temp->getDel()) { 999 // pWrite(temp->getPoly()); 1000 //} 980 1001 } 981 gbAdd->m[j] = temp->getPoly(); 982 //pWrite(temp->getPoly()); 983 } 984 //Print("HIER AUCH\n"); 985 gbPrev = idAdd(gbPrev,gbAdd); 986 987 1002 if(counter != gPrev->count(gPrevTag->getNext())) { 1003 Print("----------------------------------WRONG COUNTING---------------------------\n"); 1004 } 1005 gbPrev = idAdd(gbPrev,gbAdd); 1006 //idShow(gbPrev); 1007 } 1008 else { 1009 ideal gbAdd = idInit(gPrev->getLength()-gbLength,1); 1010 LNode* temp = gPrevTag; 1011 for(j=0;j<=gPrev->getLength()-gbLength-1;j++) { 1012 temp = temp->getNext(); 1013 gbAdd->m[j] = temp->getPoly(); 1014 } 1015 gbPrev = idAdd(gbPrev,gbAdd); 1016 } 988 1017 // interreduction stuff 989 1018 if(i<IDELEMS(id)) { 1019 int timer2 = initTimer(); 1020 startTimer(); 990 1021 ideal tempId = kInterRed(gbPrev); 1022 991 1023 //idShow(tempId); 992 1024 gbPrev = tempId; 1025 timer2 = getTimer(); 1026 Print("Timer INTERREDUCTION: %d\n",timer2); 1027 //idShow(gbPrev); 993 1028 //qsortDegree(&gbPrev->m[0],&gbPrev->m[IDELEMS(gbPrev)-1]); 994 1029 delete gPrev; … … 1035 1070 } 1036 1071 } 1037 1038 1072 gbLength = gPrev->getLength(); 1039 1073 //Print("HIER\n"); … … 1053 1087 //Print("===================================================\n"); 1054 1088 //Print("JA\n"); 1089 Print("LENGTH OF GPREV: %d\n",gPrev->getLength()); 1055 1090 } 1056 1091 //idShow(gbPrev); 1057 1092 Print("\n\nNumber of zero-reductions: %d\n",reductionsToZero); 1058 1093 timer = getTimer(); 1094 Print("Highest Degree during computations: %d\n",highestDegree); 1059 1095 Print("Time for computations: %d/1000 seconds\n",timer); 1060 1096 //LNode* temp = gPrev->getFirst(); … … 1067 1103 //delete rTag; 1068 1104 //delete gPrev; 1105 reductionTime = 0; 1106 spolsTime = 0; 1069 1107 return(gbPrev); 1070 1108
Note: See TracChangeset
for help on using the changeset viewer.