Changeset 61944d0 in git
 Timestamp:
 Feb 26, 2009, 10:01:52 AM (15 years ago)
 Branches:
 (u'fiekerDuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '45e267b9942dec9429fe249ce3e5e44ab80a6a3a')
 Children:
 60933487e53ddb20e0e5d7d5ccc137ac53893f37
 Parents:
 7a8ca6fdf98e2078621ae6ac00ff9481cab3def8
 Location:
 kernel
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

kernel/f5gb.cc
r7a8ca6 r61944d0 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: f5gb.cc,v 1.3 3 20090223 14:28:38ederc Exp $ */4 /* $Id: f5gb.cc,v 1.34 20090226 09:01:52 ederc Exp $ */ 5 5 /* 6 6 * ABSTRACT: f5gb interface … … 73 73 //Print("%p\n",gPrev>getFirst()); 74 74 //pWrite(gPrev>getFirst()>getPoly()); 75 poly tempNF = kNF(gbPrev,currQuotient,f_i); 76 f_i = tempNF; 75 77 gPrev>insert(ONE,i,f_i); 76 78 // tag the first element in gPrev of the current index for findReductor() … … 183 185 u2 = pDivide(lcm, pHead(temp>getPoly())); 184 186 pSetCoeff(u2,nOne); 185 //Print("IN CRITPAIRS\n"); 186 //pWrite(u1); 187 //Print("1st ELEMENT: "); 188 //pWrite(newElement>getPoly()); 189 //Print("2nd ELEMENT: "); 190 //pWrite(temp>getPoly()); 187 //if(gPrev>getLast()>getIndex()==5) { 188 // Print("IN CRITPAIRS\n"); 189 // pWrite(u1); 190 // Print("1st ELEMENT: "); 191 // pWrite(newElement>getPoly()); 192 // Print("2nd ELEMENT: "); 193 // pWrite(temp>getPoly()); 194 //} 191 195 // testing both new labels by the F5 Criterion 192 196 if(!criterion1(gPrev,u1,newElement,lTag) && !criterion1(gPrev,u2,temp,lTag) && … … 215 219 } 216 220 // for debugging 217 if(NULL != critPairs) { 218 //critPairs>print(); 221 if(NULL != critPairs && gPrev>getLast()>getIndex() == 4) { 222 //critPairs>print(); 223 //sleep(5); 219 224 } 220 225 } … … 315 320 && l>getIndex() == testNode>getRuleIndex()) { 316 321 //pWrite(testNode>getRuleTerm()); 317 if(pLmDivisibleBy(testNode>getRuleTerm(),u1)) { 322 //pWrite(testNode>getRuleTerm()); 323 //pWrite(t); 324 //pWrite(l>getTerm()); 325 //pWrite(u1); 326 //Print("%d\n",testNode>getRuleIndex()); 327 if(pLmDivisibleBy(testNode>getRuleTerm(),u1)) { 318 328 //Print("Criterion 2 NOT passed!\n"); 319 329 pDelete(&u1); … … 443 453 //Print("%d\n",rules>getFirst()>getRuleIndex()); 444 454 //Print("%p\n",sPolyList>getFirst()); 445 sPolyList>insert SP(ppMult_qq(temp>getT1(),temp>getLp1Term()),temp>getLp1Index(),sp,rules>getFirst()>getRule());455 sPolyList>insertByLabel(ppMult_qq(temp>getT1(),temp>getLp1Term()),temp>getLp1Index(),sp,rules>getFirst()>getRule()); 446 456 } 447 457 // data is saved in sPolyList or zero => delete sp … … 477 487 //Print("%p\n",sPolyList>getFirst()); 478 488 } 479 //sPolyList>print(); 489 //if(gPrev>getLast()>getIndex() == 5) { 490 //sPolyList>print(); 491 //sleep(5); 492 //} 493 480 494 // temp is the first element in the sPolyList which should be reduced 481 495 // due to earlier sorting this is the element of minimal degree AND … … 507 521 // with label index = current label index: this is done such that there 508 522 // is no label corruption during the reduction process 509 topReduction(temp,sPolyList,gPrev,rules,lTag,rTag );523 topReduction(temp,sPolyList,gPrev,rules,lTag,rTag,gbPrev); 510 524 511 525 } … … 536 550 ===================================================================================== 537 551 */ 538 void topReduction(LNode* l, LList* sPolyList, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag ) {552 void topReduction(LNode* l, LList* sPolyList, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev) { 539 553 //Print("##########################################In topREDUCTION!########################################\n"); 540 554 // try l as long as there are reductors found by findReductor() 541 555 do { 542 556 LNode* tempRed = new LNode(); 557 Print("TESTED POLYNOMIAL IN THE FOLLOWING: "); 558 pWrite(l>getPoly()); 543 559 tempRed = findReductor(l,gPrev,rules,lTag,rTag); 544 560 //Print("HIER DEBUG 2\n"); … … 547 563 // if label of reductor is greater than the label of l we have to built a new element 548 564 // and add it to sPolyList 565 Print("REDUCTOR POLYNOMIAL: "); 566 pWrite(tempRed>getPoly()); 567 Print("TERM: "); 568 pWrite(tempRed>getTerm()); 549 569 if(pLmCmp(tempRed>getTerm(),l>getTerm()) == 1) { 550 poly temp = pSub(tempRed>getPoly(),l>getPoly()); 570 // needed sinc pSub destroys the arguments! 571 poly temp_poly_l = pInit(); 572 temp_poly_l = pCopy(l>getPoly()); 573 //Print("POLYNOMIAL L: "); 574 //pWrite(l>getPoly()); 575 //pWrite(temp_poly_l); 576 poly temp = pSub(tempRed>getPoly(),temp_poly_l); 577 //Print("POLYNOMIAL L: "); 578 //pWrite(l>getPoly()); 579 //pWrite(temp_poly_l); 580 //Print("AFTER REDUCTION STEP: "); 581 //pWrite(temp); 582 //sleep(20); 551 583 //pWrite(temp); 552 584 if(NULL != temp) { 553 585 pNorm(temp); 554 586 tempRed>setPoly(temp); 587 //pWrite(tempRed>getPoly()); 555 588 // for debugging 556 589 //pWrite(tempRed>getPoly()); … … 577 610 // after subtraction 578 611 else { 579 poly temp = pSub(l>getPoly(),tempRed>getPoly()); 612 poly temp_poly_l = pInit(); 613 temp_poly_l = pCopy(l>getPoly()); 614 poly temp = pSub(temp_poly_l,tempRed>getPoly()); 615 //Print("AFTER REDUCTION STEP: "); 580 616 //pWrite(temp); 581 617 if(NULL != temp) { 582 618 pNorm(temp); 583 l>setPoly(temp); 619 poly tempNF = kNF(gbPrev,currQuotient,temp); 620 pNorm(tempNF); 621 l>setPoly(tempNF); 584 622 l>setGPrevRedCheck(NULL); 585 623 } … … 596 634 else { 597 635 if(NULL != l>getPoly()) { 598 //Print("ADDED TO GPREV IN TOPREDUCTION: "); 599 //pWrite(l>getPoly()); 600 //pWrite(l>getTerm()); 601 //Print("INDEX: %d\n", l>getIndex()); 602 //sleep(10); 636 pNorm(l>getPoly()); 637 Print("ADDED TO GPREV IN TOPREDUCTION: "); 638 pWrite(l>getPoly()); 639 pWrite(l>getTerm()); 640 Print("INDEX: %d\n\n\n", l>getIndex()); 641 603 642 gPrev>insert(l>getLPoly()); 604 643 //Print("GPREV: \n"); … … 646 685 // does the head of the element of gPrev divides the head of 647 686 // the to be reduced element? 687 //Print("FOUND REDUCTORS\n"); 688 //Print("\n"); 689 //pWrite(temp>getPoly()); 690 //pWrite(temp>getTerm()); 648 691 if(pLmDivisibleByNoComp(temp>getPoly(),t)) { 649 692 // get all the information needed for the following tests … … 651 694 u = pDivide(t,pHead(temp>getPoly())); 652 695 pSetCoeff(u,nOne); 696 //pWrite(u); 697 //Print("\n"); 653 698 red = ppMult_qq(u,temp>getPoly()); 654 699 pNorm(red); 655 u = ppMult_qq(u,temp>getTerm());656 pSetCoeff(u,nOne);700 //u = ppMult_qq(u,temp>getTerm()); 701 //pSetCoeff(u,nOne); 657 702 // check if both have the same label 658 703 if(pLmCmp(u,l>getTerm()) != 0) { … … 711 756 } 712 757 } 758 id = kInterRed(id); 759 qsortDegree(&id>m[0],&id>m[IDELEMS(id)1]); 713 760 LList* gPrev = new LList(ONE, i, id>m[0]); 761 //idShow(id); 714 762 //Print("%p\n",id>m[0]); 715 763 //pWrite(id>m[0]); … … 774 822 // temp = temp>getNext(); 775 823 // } 824 delete(gPrev); 776 825 return(gbPrev); 777 826 
kernel/f5gb.h
r7a8ca6 r61944d0 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: f5gb.h,v 1.2 8 20090219 14:52:34ederc Exp $ */4 /* $Id: f5gb.h,v 1.29 20090226 09:01:52 ederc Exp $ */ 5 5 /* 6 6 * ABSTRACT: f5gb interface … … 19 19 ====================================================== 20 20 */ 21 void qsort _degree(poly* left, poly* right);21 void qsortDegree(poly* left, poly* right); 22 22 23 23 /* … … 88 88 ===================================================================================== 89 89 */ 90 void topReduction(LNode* l, LList* sPolyList, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag );90 void topReduction(LNode* l, LList* sPolyList, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, ideal gbPrev); 91 91 92 92 /* 
kernel/f5lists.cc
r7a8ca6 r61944d0 106 106 } 107 107 else { 108 if( 0 == pLmCmp(t,this>getTerm()) 1 == pLmCmp(t,this>getTerm())) {108 if(1 == pLmCmp(t,this>getTerm())) { 109 109 LNode* newElement = new LNode(t, i, p, r, this); 110 110 return newElement; … … 113 113 LNode* temp = this; 114 114 while(NULL != temp>next && NULL != temp>next>data) { 115 if( 0 == pLmCmp(t,temp>next>getTerm()) 1 == pLmCmp(t,temp>next>getTerm())) {115 if(1 == pLmCmp(t,temp>next>getTerm())) { 116 116 LNode* newElement = new LNode(t, i, p, r, temp>next); 117 117 temp>next = newElement; … … 188 188 } 189 189 190 void LNode::setNext(LNode* l) { 191 next = l; 192 } 193 190 194 // test if for any list element the polynomial part of the data is equal to *p 191 195 bool LNode::polyTest(poly* p) { … … 213 217 Print("Index: %d\n",temp>getIndex()); 214 218 Print("Term: "); 215 //pWrite(temp>getTerm());219 pWrite(temp>getTerm()); 216 220 Print("Poly: "); 217 //pWrite(temp>getPoly());221 pWrite(temp>getPoly()); 218 222 Print("\n"); 219 223 temp = temp>next; … … 312 316 313 317 void LList::setFirst(LNode* l) { 318 LNode* temp = first; 319 temp>setNext(NULL); 314 320 first = l; 315 321 length; 
kernel/f5lists.h
r7a8ca6 r61944d0 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: f5lists.h,v 1.1 1 20090219 14:52:34ederc Exp $ */4 /* $Id: f5lists.h,v 1.12 20090226 09:01:52 ederc Exp $ */ 5 5 /* 6 6 * ABSTRACT: list interface … … 79 79 void setIndex(int i); 80 80 void setGPrevRedCheck(LNode* l); 81 void setNext(LNode* l); 81 82 // test if for any list element the polynomial part of the data is equal to *p 82 83 bool polyTest(poly* p);
Note: See TracChangeset
for help on using the changeset viewer.