Changeset c888ad in git for kernel/gfan.cc


Ignore:
Timestamp:
Jul 24, 2009, 10:59:45 AM (15 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
dfb5988d2fef3b4aafc6823ebfc36a09411689b4
Parents:
8c1592fd363749fb677e5b714b0180fcde6c8ac8
Message:
Rudimentary garbage collection
Documentation
Bugfix in noRevS
 if( ii==0 || (ii>0 && SearchListAct==NULL) )
for the case that the first facet of a cone is non-flippable


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    r8c1592 rc888ad  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-07-23 12:34:53 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.81 2009-07-23 12:34:53 monerjan Exp $
    6 $Id: gfan.cc,v 1.81 2009-07-23 12:34:53 monerjan Exp $
     4$Date: 2009-07-24 08:59:45 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.82 2009-07-24 08:59:45 monerjan Exp $
     6$Id: gfan.cc,v 1.82 2009-07-24 08:59:45 monerjan Exp $
    77*/
    88
     
    9393                       
    9494        public:
    95                 /**
     95                /** \brief Boolean value to indicate whether a facet is flippable or not
     96                * This is also used to mark facets that nominally are flippable but which do
     97                * not intersect with the positive orthant. This check is done in gcone::getCodim2Normals
    9698                */     
    9799                bool isFlippable;       //**flippable facet? */
     
    11711173                        rChangeCurrRing(dstRing);
    11721174                       
    1173 #ifdef gfan_DEBUG
     1175//#ifdef gfan_DEBUG
    11741176                        rWrite(dstRing); cout << endl;
    1175 #endif
     1177//#endif
    11761178                        ideal dstRing_I;                       
    11771179                        dstRing_I=idrCopyR(srcRing_HH,srcRing);
     
    17041706                        facet *SearchListRoot = new facet(); //The list containing ALL facets we come across
    17051707                        facet *SearchListAct;
     1708                        SearchListAct = NULL;
    17061709                        //SearchListAct = SearchListRoot;
    17071710                       
     
    17491752                                {
    17501753                                        fNormal = fAct->getFacetNormal();
    1751                                         if(ii==0)
     1754                                        if( ii==0 || (ii>0 && SearchListAct==NULL) ) //1st facet may be non-flippable
    17521755                                        {                                               
    17531756                                                SearchListAct = SearchListRoot;
     
    17551758                                        }
    17561759                                        else
    1757                                         {
     1760                                        {                       
    17581761                                                SearchListAct->next = new facet();
    1759                                                 SearchListAct = SearchListAct->next;
     1762                                                SearchListAct = SearchListAct->next;                                           
    17601763                                                //memcpy(SearchListAct,fAct,sizeof(facet));                             
    17611764                                        }
     
    17971800                                if(SearchListAct->next!=NULL)
    17981801                                {
    1799                                         SearchListAct->next->prev = SearchListAct;
    1800                                         //SearchListAct = SearchListAct->next;
     1802                                        SearchListAct->next->prev = SearchListAct;                                     
    18011803                                }
    18021804                                SearchListAct = SearchListAct->next;
     
    18041806                        SearchListAct = SearchListRoot; //Set to beginning of List
    18051807                       
    1806                         fAct = gcAct->facetPtr;                 
     1808                        fAct = gcAct->facetPtr;
     1809                        //NOTE Disabled until code works as expected
    18071810                        //gcAct->writeConeToFile(*gcAct);
    18081811                       
     
    18121815                        Choose a facet from fListPtr, flip it and forget the previous cone
    18131816                        We always choose the first facet from fListPtr as facet to be flipped
    1814                         */
    1815                         while(SearchListAct!=NULL)
     1817                        */                     
     1818                        while(SearchListAct!=NULL)// && counter<limit)
    18161819                        {//NOTE See to it that the cone is only changed after ALL facets have been flipped!                             
    18171820                                fAct = SearchListAct;
     
    20052008                        }       */             
    20062009                }
    2007                 /**
     2010                /** \brief Enqueue new facets into the searchlist
     2011                * The searchlist (SLA for short) is implemented as a FIFO
     2012                * Checks are done as follows:
     2013                * 1) Check facet fAct against all facets in SLA for parallelity. If it is not parallel to any one add it.
     2014                * 2) If it is parallel compare the codim2 facets. If they coincide the facets are equal and we delete the
     2015                *       facet from SLA and do not add fAct.
     2016                * It may very well happen, that SLA=\f$ \emptyset \f$ but we do not have checked all fActs yet. In this case we
     2017                * can be sure, that none of the facets that are still there already were in SLA once, so we just dump them into SLA.
    20082018                * Takes ptr to search list root
    20092019                * Returns a pointer to new first element of Searchlist
     
    20252035                        facet *sl2Act;
    20262036                        sl2Act = f.codim2Ptr;
     2037                        /** Pointer to a facet that will be deleted */
    20272038                        facet *deleteMarker;
    20282039                        deleteMarker = NULL;
    20292040                       
     2041                        /** Flag to indicate a facet that should be added to SLA*/
    20302042                        bool doNotAdd=FALSE;
     2043                        /**A facet was removed, lengthOfSearchlist-- thus we must not rely on
     2044                        * if(notParallelCtr==lengthOfSearchList) but rather
     2045                        * if( (notParallelCtr==lengthOfSearchList && removalOccured==FALSE)
     2046                        */
    20312047                        bool removalOccured=FALSE;
    20322048                        int ctr=0;      //encountered qualities in SLA
     
    21162132                                                {
    21172133                                                        notParallelCtr++;
     2134                                                        slAct = slAct->next;
    21182135                                                }
    21192136                                                else
     
    21562173                                                                }//NOTE find a way to delete without affecting slAct = slAct->next
    21572174                                                                else if(slAct==slEndStatic)
    2158                                                                         {                                                       
     2175                                                                        {
     2176                                                                                deleteMarker = slAct;                                   
    21592177                                                                                if(slEndStatic->next==NULL)
    21602178                                                                                {                                                       
     
    21862204                                                                //break;
    21872205                                                        }
     2206                                                        slAct = slAct->next;
     2207                                                        delete deleteMarker;
    21882208                                                }//if(!isParallel(fNormal, slNormal))
    2189                                                 slAct = slAct->next;
    2190                                                 //delete deleteMarker;
     2209                                                /* NOTE The following lines must not be here but rather called inside the if-block above.
     2210                                                Otherwise results get crappy. Unfortunately there are two slAct=slAct->next calls now,
     2211                                                (not nice!) but since they are in seperate branches of the if-statement there should not
     2212                                                be a way it gets called twice thus ommiting one facet:
     2213                                                slAct = slAct->next;                                           
     2214                                                delete deleteMarker;*/
    21912215                                                deleteMarker=NULL;
    21922216                                                //if slAct was marked as to be deleted, delete it here!
Note: See TracChangeset for help on using the changeset viewer.