Changeset ecc6a3 in git for kernel/gfan.cc
- Timestamp:
- Apr 14, 2009, 1:05:52 PM (14 years ago)
- Branches:
- (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
- Children:
- 88a031adbc665b53d27253fb6fd990e763c045c6
- Parents:
- ad3dfeacbfe7cbf742e1376a0a0b8c5844bdc83f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
rad3dfe recc6a3 2 2 Compute the Groebner fan of an ideal 3 3 $Author: monerjan $ 4 $Date: 2009-04- 08 14:02:26$5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.3 1 2009-04-08 14:02:26monerjan Exp $6 $Id: gfan.cc,v 1.3 1 2009-04-08 14:02:26monerjan Exp $4 $Date: 2009-04-14 11:05:52 $ 5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.32 2009-04-14 11:05:52 monerjan Exp $ 6 $Id: gfan.cc,v 1.32 2009-04-14 11:05:52 monerjan Exp $ 7 7 */ 8 8 … … 483 483 pWrite(p); 484 484 //poly r=kCreateZeroPoly(,currRing,currRing); //The 0-polynomial, hopefully 485 poly r= 0;485 poly r=NULL; //The zero polynomial 486 486 int ii; 487 487 bool divOccured; 488 cout << "TICK 1" << endl; //Hangs after this line. Zeropoly stuff489 while (p Head(p)!=NULL)488 489 while (p!=NULL) 490 490 { 491 491 ii=1; 492 divOccured=TRUE; 492 divOccured=FALSE; 493 493 494 while( (ii<=IDELEMS(I) && (divOccured==FALSE) )) 494 { 495 cout << "TICK 2" << endl; 496 if (pLmDivisibleBy(I->m[ii],p)) 497 { 498 cout << "TICK 3" << endl; 499 p=pSub(p,pMult( pDivide(pHead(p),pHead(I->m[ii])), I->m[ii])); 500 cout << "TICK 4" << endl; 501 pWrite(p); 495 { 496 if (pDivisibleBy(I->m[ii-1],p)) //does LM(I->m[ii]) divide LM(p) ? 497 { 498 //cout << "TICK 3" << endl; 499 poly step1,step2,step3; 500 cout << "dividing "; pWrite(pHead(p));cout << "by ";pWrite(pHead(I->m[ii-1])); cout << endl; 501 step1 = pDivideM(pHead(p),pHead(I->m[ii-1])); 502 cout << "LT(p)/LT(f_i)="; pWrite(step1); cout << endl; 503 //cout << "TICK 3.1" << endl; 504 step2 = ppMult_qq(step1, I->m[ii-1]); 505 //cout << "TICK 3.2" << endl; 506 step3 = pSub(p, step2); 507 //p=pSub(p,pMult( pDivide(pHead(p),pHead(I->m[ii])), I->m[ii])); 508 //cout << "TICK 4" << endl; 502 509 pSetm(p); 510 p=step3; 511 pWrite(p); 503 512 divOccured=TRUE; 504 513 } … … 507 516 ii += 1; 508 517 }//if (pLmDivisibleBy(I->m[ii],p,currRing)) 509 if (divOccured==FALSE)510 {511 cout << "TICK 5" << endl;512 r=pAdd(r,pHead(p));513 cout << "TICK 6" << endl;514 p=pSub(p,pHead(p));515 cout << "TICK 7" << endl;516 pWrite(p);517 }//if (divOccured==FALSE)518 518 }//while( (ii<IDELEMS(I) && (divOccured==FALSE) )) 519 if (divOccured==FALSE) 520 { 521 //cout << "TICK 5" << endl; 522 r=pAdd(r,pHead(p)); 523 pSetm(r); 524 cout << "r="; pWrite(r); cout << endl; 525 //cout << "TICK 6" << endl; 526 if (pLength(p)!=1) 527 { 528 p=pSub(p,pHead(p)); //Here it may occur that p=0 instead of p=NULL 529 } 530 else 531 { 532 p=NULL; //Hack to correct this situation 533 } 534 //cout << "TICK 7" << endl; 535 cout << "p="; pWrite(p); 536 }//if (divOccured==FALSE) 519 537 }//while (p!=0) 520 538 return r; … … 526 544 { 527 545 cout << "Entering ffG" << endl; 528 int size=IDELEMS( G);546 int size=IDELEMS(H); 529 547 ideal res=idInit(size,1); 530 548 for (int ii=0;ii<size;ii++) 531 549 { 532 550 res->m[ii]=restOfDiv(H->m[ii],G); 551 //res->m[ii]=pSub(H->m[ii],res->m[ii]); //buggy 552 pSetm(res->m[ii]); 553 cout << "res->m["<<ii<<"]=";pWrite(res->m[ii]); 533 554 } 534 555 return res;
Note: See TracChangeset
for help on using the changeset viewer.