Changeset ecc6a3 in git for kernel/gfan.cc


Ignore:
Timestamp:
Apr 14, 2009, 1:05:52 PM (14 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
Children:
88a031adbc665b53d27253fb6fd990e763c045c6
Parents:
ad3dfeacbfe7cbf742e1376a0a0b8c5844bdc83f
Message:
contd work on ffG and restOfDiv. Tailred already included by Alg from CLO?


git-svn-id: file:///usr/local/Singular/svn/trunk@11690 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    rad3dfe recc6a3  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-04-08 14:02:26 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.31 2009-04-08 14:02:26 monerjan Exp $
    6 $Id: gfan.cc,v 1.31 2009-04-08 14:02:26 monerjan 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 $
    77*/
    88
     
    483483                        pWrite(p);
    484484                        //poly r=kCreateZeroPoly(,currRing,currRing);   //The 0-polynomial, hopefully
    485                         poly r=0;
     485                        poly r=NULL;    //The zero polynomial
    486486                        int ii;
    487487                        bool divOccured;
    488                         cout << "TICK 1" << endl;       //Hangs after this line. Zeropoly stuff
    489                         while (pHead(p)!=NULL)
     488                       
     489                        while (p!=NULL)
    490490                        {
    491491                                ii=1;
    492                                 divOccured=TRUE;
     492                                divOccured=FALSE;
     493                               
    493494                                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;
    502509                                                pSetm(p);
     510                                                p=step3;
     511                                                pWrite(p);                                             
    503512                                                divOccured=TRUE;
    504513                                        }
     
    507516                                                ii += 1;
    508517                                        }//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)
    518518                                }//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)
    519537                        }//while (p!=0)
    520538                        return r;
     
    526544                {
    527545                        cout << "Entering ffG" << endl;
    528                         int size=IDELEMS(G);
     546                        int size=IDELEMS(H);
    529547                        ideal res=idInit(size,1);
    530548                        for (int ii=0;ii<size;ii++)
    531549                        {
    532550                                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]);                                         
    533554                        }
    534555                        return res;
Note: See TracChangeset for help on using the changeset viewer.