Changeset c9193a in git for kernel/f5gb.cc
- Timestamp:
- Feb 28, 2009, 10:14:06 PM (15 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 5887d78d81d30fb2177cf296ce90d01565c6ae3b
- Parents:
- 1863d8a8be27be6f1d1a24187172fe5ab71c385f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/f5gb.cc
r1863d8 rc9193a 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: f5gb.cc,v 1.3 5 2009-02-27 22:22:30ederc Exp $ */4 /* $Id: f5gb.cc,v 1.36 2009-02-28 21:14:06 ederc Exp $ */ 5 5 /* 6 6 * ABSTRACT: f5gb interface … … 194 194 //} 195 195 // testing both new labels by the F5 Criterion 196 if(!criterion1(gPrev,u1,newElement,lTag) && !criterion1(gPrev,u2,temp,lTag)) { 197 //&& !criterion2(u1, newElement, rules, rTag) && !criterion2(u2, temp, rules, rTag)) { 198 // if they pass the test, add them to CList critPairs, having the LPoly with greater 199 // label as first element in the CPair 200 if(newElement->getIndex() == temp->getIndex() && 201 -1 == pLmCmp(ppMult_qq(u1, newElement->getTerm()),ppMult_qq(u2, temp->getTerm()))) { 202 //Print("zweites groesser\n"); 203 CPair* cp = new CPair(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u2, 204 temp->getLPoly(), u1, newElement->getLPoly(), testedRule); 205 critPairs->insert(cp); 206 } 207 else { 208 //Print("erstes groesser\n"); 209 CPair* cp = new CPair(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u1, 210 newElement->getLPoly(), u2, temp->getLPoly(), testedRule); 211 critPairs->insert(cp); 212 } 213 } 214 else { 215 } 216 217 //Print("\n\n"); 218 temp = temp->getNext(); 219 } 220 // for debugging 221 //if(NULL != critPairs) { 222 //critPairs->print(); 223 //sleep(5); 224 //} 225 } 226 227 228 229 230 /* 231 ================================================================ 232 computes a list of critical pairs for the next reduction process 233 first element in gPrev is always the newest element which must 234 build critical pairs with all other elements in gPrev 235 this is a special version for reduction() in which the first 236 generator of the critical pair is not tested by criterion2() 237 as there are no rules added until then to test for 238 ================================================================ 239 */ 240 void criticalPairRed(LList* gPrev, CList* critPairs, LTagList* lTag, RTagList* rTag, RList* rules) { 241 // initialization for usage in pLcm() 242 number nOne = nInit(1); 243 LNode* newElement = gPrev->getLast(); 244 LNode* temp = gPrev->getFirst(); 245 poly u1 = pOne(); 246 poly u2 = pOne(); 247 poly lcm = pOne(); 248 poly t = pHead(newElement->getPoly()); 249 Rule* testedRule = rules->getFirst()->getRule(); 250 // computation of critical pairs 251 while( gPrev->getLast() != temp) { 252 //pWrite( *(gPrev->getFirst()->getPoly()) ); 253 // pWrite( *(l->getPoly()) ); 254 pLcm(newElement->getPoly(), temp->getPoly(), lcm); 255 pSetCoeff(lcm,nOne); 256 // computing factors u2 for new labels 257 u1 = pDivide(lcm,t); 258 pSetCoeff(u1,nOne); 259 u2 = pDivide(lcm, pHead(temp->getPoly())); 260 pSetCoeff(u2,nOne); 261 //if(gPrev->getLast()->getIndex()==5) { 262 //Print("IN CRITPAIRS\n"); 263 // pWrite(u1); 264 // Print("1st ELEMENT: "); 265 // pWrite(newElement->getPoly()); 266 // Print("2nd ELEMENT: "); 267 // pWrite(temp->getPoly()); 268 //} 269 // testing both new labels by the F5 Criterion 196 270 if(!criterion1(gPrev,u1,newElement,lTag) && !criterion1(gPrev,u2,temp,lTag) && 197 !criterion2(u 1, newElement, rules, rTag) && !criterion2(u2, temp, rules, rTag)) {271 !criterion2(u2, temp, rules, rTag)) { 198 272 // if they pass the test, add them to CList critPairs, having the LPoly with greater 199 273 // label as first element in the CPair … … 514 588 //idShow(gbPrev); 515 589 poly tempNF = kNF(gbPrev,currQuotient,temp->getPoly()); 516 pNorm(tempNF);517 590 //Print("LENGTH: %d\n",sPolyList->getLength()); 518 591 //pWrite(tempNF); 519 592 //pWrite(temp->getPoly()); 520 593 if(NULL != tempNF) { 594 pNorm(tempNF); 521 595 // write the reduced polynomial in temp 522 596 temp->setPoly(tempNF); … … 530 604 //CList* newCritPairs = new CList; 531 605 //Print("##################IN CRITPAIRS IN REDUCTION#####################\n"); 532 criticalPair (gPrev,critPairs,lTag,rTag,rules);606 criticalPairRed(gPrev,critPairs,lTag,rTag,rules); 533 607 //Print("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++H I E R++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); 534 608 } … … 561 635 //Print("TESTED POLYNOMIAL IN THE FOLLOWING: "); 562 636 //pWrite(l->getPoly()); 637 //Print("HIER\n"); 563 638 tempRed = findReductor(l,gPrev,rules,lTag,rTag); 564 639 //Print("--------------------------------HIER DEBUG 2----------------------------------\n"); … … 628 703 poly tempNF = kNF(gbPrev,currQuotient,temp); 629 704 pNorm(tempNF); 705 //pWrite(tempNF); 706 if(NULL == tempNF) { 707 reductionsToZero++; 708 pDelete(&tempNF); 709 l->setPoly(NULL); 710 break; 711 } 630 712 l->setPoly(tempNF); 713 714 //pWrite(l->getPoly()); 631 715 l->setGPrevRedCheck(NULL); 632 716 } … … 683 767 if(NULL != l->getGPrevRedCheck()) { 684 768 temp = l->getGPrevRedCheck()->getNext(); 685 } 769 } 686 770 // no reductors were searched for l before, thus start at the first 687 771 // element of gPrev with the current index, tagged by lTag … … 694 778 // does the head of the element of gPrev divides the head of 695 779 // the to be reduced element? 696 Print("-------------FOUND REDUCTORS----------------------\n"); 697 Print("\n"); 698 pWrite(temp->getPoly()); 699 pWrite(temp->getTerm()); 700 pWrite(t); 701 Print("HALLO\n"); 780 //Print("-------------FOUND REDUCTORS----------------------\n"); 781 //Print("\n"); 782 //pWrite(temp->getPoly()); 783 //pWrite(temp->getTerm()); 784 //pWrite(t); 785 //pWrite(l->getPoly()); 786 //Print("HALLO\n"); 702 787 if(pLmDivisibleByNoComp(temp->getPoly(),t)) { 703 Print("HALLO\n");788 //Print("HALLO\n"); 704 789 // get all the information needed for the following tests 705 790 // of the criteria 706 791 u = pDivide(t,pHead(temp->getPoly())); 707 792 pSetCoeff(u,nOne); 708 pWrite(u); 709 Print("\n"); 793 //Print("HIER FINDRED\n"); 794 //pWrite(u); 795 //Print("\n"); 710 796 red = ppMult_qq(u,temp->getPoly()); 711 797 pNorm(red); … … 713 799 //pSetCoeff(u,nOne); 714 800 // check if both have the same label 715 Print("HALLO\n");801 //Print("HALLO\n"); 716 802 if(pLmCmp(u,l->getTerm()) != 0) { 717 Print("HALLO\n");803 //Print("HALLO\n"); 718 804 // passing criterion2 ? 719 805 if(!criterion2(u,temp,rules,rTag)) { … … 728 814 } 729 815 } 730 Print("%p\n",temp->getNext());731 pWrite(temp->getPoly());732 Print("HALLO\n");816 //Print("%p\n",temp->getNext()); 817 //pWrite(temp->getPoly()); 818 //Print("HALLO\n"); 733 819 temp = temp->getNext(); 734 820 } … … 773 859 } 774 860 } 775 id = kInterRed(id); 861 ideal idNew = kInterRed(id); 862 idDelete(&id); 863 id = idNew; 776 864 qsortDegree(&id->m[0],&id->m[IDELEMS(id)-1]); 777 865 LList* gPrev = new LList(ONE, i, id->m[0]);
Note: See TracChangeset
for help on using the changeset viewer.