Changeset 4eaf38d in git


Ignore:
Timestamp:
Apr 15, 2009, 4:36:10 PM (15 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
459b80a7e98c18294ff7b7baa6fa52186193fa9e
Parents:
28e0e5582e2e5e2059a6cd427d901f66d7e9c4b3
Message:
pCopy to avoid destruction of arguments


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    r28e0e55 r4eaf38d  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    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 $
     4$Date: 2009-04-15 14:36:10 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.33 2009-04-15 14:36:10 monerjan Exp $
     6$Id: gfan.cc,v 1.33 2009-04-15 14:36:10 monerjan Exp $
    77*/
    88
     
    161161                * As a result of this procedure the pointer facetPtr points to the first facet of the cone.
    162162                */
    163                 void getConeNormals(const ideal &I)
     163                void getConeNormals(ideal const &I)
    164164                {
    165165#ifdef gfan_DEBUG
     
    404404                                        {
    405405                                                cout << "Parallel vector found, adding to initialFormElement" << endl;                         
    406                                                 initialFormElement[ii] = pAdd(initialFormElement[ii],(poly)pHead(aktpoly));
     406                                                initialFormElement[ii] = pAdd(pCopy(initialFormElement[ii]),(poly)pHead(aktpoly));
    407407                                        }                                               
    408408                                }//while
     
    413413                                initialForm->m[ii]=initialFormElement[ii];
    414414                        }//for
    415                         f->setFlipGB(initialForm);                     
     415                        f->setFlipGB(initialForm);      //FIXME PROBABLY WRONG TO STORE HERE SINCE INA!=flibGB                 
    416416#ifdef gfan_DEBUG
    417417                        cout << "Initial ideal is: " << endl;
     
    441441                        rComplete(dstRing);
    442442                        rChangeCurrRing(dstRing);
    443                         //map theMap=(map)idMaxIdeal(1);
     443                       
    444444                        rWrite(currRing); cout << endl;
    445445                        ideal ina;
     
    504504                                                step2 = ppMult_qq(step1, I->m[ii-1]);
    505505                                                //cout << "TICK 3.2" << endl;
    506                                                 step3 = pSub(p, step2);
     506                                                step3 = pSub(pCopy(p), step2);
    507507                                                //p=pSub(p,pMult( pDivide(pHead(p),pHead(I->m[ii])), I->m[ii]));
    508508                                                //cout << "TICK 4" << endl;
    509                                                 pSetm(p);
     509                                                //pSetm(p);
     510                                                pSort(step3); //must be here, otherwise strange behaviour with many +o+o+o+o+ terms
    510511                                                p=step3;
    511512                                                pWrite(p);                                             
     
    520521                                {
    521522                                        //cout << "TICK 5" << endl;
    522                                         r=pAdd(r,pHead(p));
     523                                        r=pAdd(pCopy(r),pHead(p));
    523524                                        pSetm(r);
     525                                        pSort(r);
    524526                                        cout << "r="; pWrite(r); cout << endl;
    525527                                        //cout << "TICK 6" << endl;
    526528                                        if (pLength(p)!=1)
    527529                                        {
    528                                                 p=pSub(p,pHead(p));     //Here it may occur that p=0 instead of p=NULL
     530                                                p=pSub(pCopy(p),pHead(p));      //Here it may occur that p=0 instead of p=NULL
    529531                                        }
    530532                                        else
     
    546548                        int size=IDELEMS(H);
    547549                        ideal res=idInit(size,1);
     550                        poly temp1, temp2, temp3;       //polys to temporarily store values for pSub
    548551                        for (int ii=0;ii<size;ii++)
    549552                        {
    550553                                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]);
     554                                temp1=H->m[ii];
     555                                temp2=res->m[ii];                               
     556                                temp3=pSub(temp1, temp2);
     557                                res->m[ii]=temp3;
     558                                //res->m[ii]=pSub(temp1,temp2); //buggy
     559                                //pSort(res->m[ii]);
     560                                //pSetm(res->m[ii]);
    553561                                cout << "res->m["<<ii<<"]=";pWrite(res->m[ii]);                                         
    554562                        }
Note: See TracChangeset for help on using the changeset viewer.