Changeset f4a2f42 in git


Ignore:
Timestamp:
May 8, 2009, 2:58:01 PM (15 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
a2e297661483537b015225dc3602180d4df607c7
Parents:
eaa679265a6d72561ceafe956d9fe10d64554d89
Message:
Cleanup
Removed bug in declaration of isSearchFacet.


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    reaa679 rf4a2f42  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-05-07 09:55:48 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.47 2009-05-07 09:55:48 monerjan Exp $
    6 $Id: gfan.cc,v 1.47 2009-05-07 09:55:48 monerjan Exp $
     4$Date: 2009-05-08 12:58:01 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.48 2009-05-08 12:58:01 monerjan Exp $
     6$Id: gfan.cc,v 1.48 2009-05-08 12:58:01 monerjan Exp $
    77*/
    88
     
    242242                                (*ivtmp)[ii]=-(*ivtmp)[ii];                             
    243243                        }
    244                         //ivtmp->show(); cout << endl;
    245                         fAct->setFacetNormal(ivtmp);
    246                         //fAct->printNormal();cout << endl;
    247                         //ivtmp->show();cout << endl;
     244                       
     245                        fAct->setFacetNormal(ivtmp);                   
    248246                }
    249247               
     
    513511                        std::cout << "===" << std::endl;
    514512                        std::cout << "running gcone::flip" << std::endl;
    515                         std::cout << "fNormal=";
    516                         fNormal->show();
    517                         std::cout << std::endl;
     513//                      std::cout << "fNormal=";
     514//                      fNormal->show();
     515//                      std::cout << std::endl;
    518516#endif                         
    519517                        /*1st step: Compute the initial ideal*/
     
    544542                                        }
    545543#ifdef gfan_DEBUG
    546                                         cout << "check=";                       
    547                                         check->show();
    548                                         cout << endl;
     544//                                      cout << "check=";                       
     545//                                      check->show();
     546//                                      cout << endl;
    549547#endif
    550548                                        //TODO why not *check, *fNormal????
    551549                                        if (isParallel(*check,*fNormal)) //pass *check when
    552550                                        {
    553                                                 cout << "Parallel vector found, adding to initialFormElement" << endl;                 
     551//                                              cout << "Parallel vector found, adding to initialFormElement" << endl;                 
    554552                                                initialFormElement[ii] = pAdd(pCopy(initialFormElement[ii]),(poly)pHead(aktpoly));
    555553                                        }                                               
     
    583581                        rChangeCurrRing(tmpRing);
    584582                       
    585                         rWrite(currRing); cout << endl;
     583                        //rWrite(currRing); cout << endl;
    586584                       
    587585                        ideal ina;                     
     
    595593                        idSkipZeroes(H);
    596594#ifdef gfan_DEBUG
    597                         cout << "H="; idShow(H); cout << endl;
     595//                      cout << "H="; idShow(H); cout << endl;
    598596#endif
    599597                        /*Substep 2.2
     
    605603                        srcRing_H=idrCopyR(H,tmpRing);
    606604#ifdef gfan_DEBUG
    607                         cout << "srcRing_H = ";
    608                         idShow(srcRing_H); cout << endl;
     605//                      cout << "srcRing_H = ";
     606//                      idShow(srcRing_H); cout << endl;
    609607#endif
    610608                        srcRing_HH=ffG(srcRing_H,this->gcBasis);               
    611609#ifdef gfan_DEBUG
    612                         cout << "srcRing_HH = ";
    613                         idShow(srcRing_HH); cout << endl;
     610//                      cout << "srcRing_HH = ";
     611//                      idShow(srcRing_HH); cout << endl;
    614612#endif
    615613                        /*Substep 2.2.1
     
    770768                        //validOpts<1>=TRUE;
    771769#ifdef gfan_DEBUG
    772                         idShow(dstRing_I);
     770                        //idShow(dstRing_I);
    773771#endif                 
    774772                        BITSET save=test;
     
    800798                        cout << "Entering restOfDiv" << endl;
    801799                        poly p=f;
    802                         pWrite(p);
     800                        //pWrite(p);
    803801                        //poly r=kCreateZeroPoly(,currRing,currRing);   //The 0-polynomial, hopefully
    804802                        poly r=NULL;    //The zero polynomial
     
    825823                                                pSort(step3); //must be here, otherwise strange behaviour with many +o+o+o+o+ terms
    826824                                                p=step3;
    827                                                 pWrite(p);                                             
     825                                                //pWrite(p);                                           
    828826                                                divOccured=TRUE;
    829827                                        }
     
    875873                                //pSort(res->m[ii]);
    876874                                //pSetm(res->m[ii]);
    877                                 cout << "res->m["<<ii<<"]=";pWrite(res->m[ii]);                                         
     875                                //cout << "res->m["<<ii<<"]=";pWrite(res->m[ii]);                                               
    878876                        }                       
    879877                        return res;
     
    936934                        lhs=dotProduct(a,b)*dotProduct(a,b);
    937935                        rhs=dotProduct(a,a)*dotProduct(b,b);
    938                         cout << "LHS="<<lhs<<", RHS="<<rhs<<endl;
     936                        //cout << "LHS="<<lhs<<", RHS="<<rhs<<endl;
    939937                        if (lhs==rhs)
    940938                        {
     
    11021100                * If this is the case, then our facet is indeed a search facet and TRUE is retuned.
    11031101                */
    1104                 bool isSearchFacet(gcone &gcTmp, facet &testfacet)
     1102                bool isSearchFacet(gcone &gcTmp, facet *testfacet)
    11051103                {                               
    11061104                        ring actRing=currRing;
     
    11641162                                        fMin=fCmp;
    11651163                                        fAct=fMin;
     1164                                        fCmp=fCmp->next;
    11661165                                }
    11671166                                else
     
    11821181                       
    11831182                        /*If testfacet was minimal then fMin should still point there */
    1184                         //NOTE BUG: Comment in and -> out of memory error
    1185                         /*intvec *alpha_min = new intvec(this->numVars);
    1186                         alpha_min=fMin->getFacetNormal();
    1187                         delete fCmp,fAct,fMin;
    1188                        
    1189                         intvec *test = new intvec(this->numVars);
    1190                         test=testfacet.getFacetNormal();*/
    1191                         //if(fMin->getFacetNormal()==ivNeg(testfacet.getFacetNormal()))
    1192                         //if (isParallel(fMin->getFacetNormal(),testfacet.getFacetNormal()))
     1183                       
     1184                        //if(fMin->getFacetNormal()==ivNeg(testfacet.getFacetNormal()))                 
     1185#ifdef gfan_DEBUG
     1186                        cout << "Checking for parallelity" << endl <<" fMin is";
    11931187                        fMin->printNormal();
    1194                         testfacet.printNormal();  //NOTE THIS IS EMPTY, so prolly cause of bug above
     1188                        cout << "testfacet is ";
     1189                        testfacet->printNormal();
     1190                        cout << endl;
     1191#endif
    11951192                        if (fMin==gcTmp.facetPtr)                       
    11961193                        //if(areEqual(fMin->getFacetNormal(),ivNeg(testfacet.getFacetNormal())))
     1194                        //if (isParallel(fMin->getFacetNormal(),testfacet->getFacetNormal()))
    11971195                        {                               
    11981196                                cout << "Parallel" << endl;
     
    12471245                                gcTmp->showIntPoint();
    12481246                                /*recursive part goes gere*/
    1249                                 if (isSearchFacet(*gcTmp,(facet&)gcAct->facetPtr))
     1247                                if (isSearchFacet(*gcTmp,(facet*)gcAct->facetPtr))
    12501248                                {
    12511249                                        gcAct->next=gcTmp;
     
    12831281        */
    12841282       
    1285         /* Construct a new ring which will serve as our root
    1286         Does not yet work as expected. Will work fine with order dp,Dp but otherwise hangs in getGB
    1287         resolved 07.04.2009 MM
    1288         */
     1283        /* Construct a new ring which will serve as our root*/
    12891284        rootRing=rCopy0(currRing);
    12901285        rootRing->order[0]=ringorder_lp;
    1291         //NOTE: Build ring accordiing to rCopyAndChangeWeight
    1292         /*rootRing->order[0]=ringorder_a;
    1293         rootRing->order[1]=ringorder_lp;
    1294         rootRing->wvhdl[0] =( int *)omAlloc(numvar*sizeof(int));
    1295         rootRing->wvhdl[0][1]=1;
    1296         rootRing->wvhdl[0][2]=1;*/
     1286       
    12971287        rComplete(rootRing);
    12981288        rChangeCurrRing(rootRing);
Note: See TracChangeset for help on using the changeset viewer.