Changeset 2b3c62f in git


Ignore:
Timestamp:
Jul 2, 2009, 4:50:07 PM (14 years ago)
Author:
Martin Monerjan
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
Children:
d47d1f9a7d1ac2d3e103063187d2ec358274680b
Parents:
ae625f2a594a1db9f49dd5783b16e78893533168
Message:
Made SearchList into doubly linked list
enqueue method now returns ptr to first element in purged SL
Does however still not work as expected for three variables


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    rae625f r2b3c62f  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-07-01 09:41:00 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.69 2009-07-01 09:41:00 monerjan Exp $
    6 $Id: gfan.cc,v 1.69 2009-07-01 09:41:00 monerjan Exp $
     4$Date: 2009-07-02 14:50:07 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.70 2009-07-02 14:50:07 monerjan Exp $
     6$Id: gfan.cc,v 1.70 2009-07-02 14:50:07 monerjan Exp $
    77*/
    88
     
    9696                bool isIncoming;        //Is the facet incoming or outgoing?
    9797                facet *next;            //Pointer to next facet
     98                facet *prev;            //Pointer to predecessor. Needed for the SearchList in noRevS
    9899                facet *codim2Ptr;       //Pointer to (codim-2)-facet. Bit of recursion here ;-)
    99100                int numCodim2Facets;
     
    113114                        this->flipGB=NULL;
    114115                        this->isIncoming=FALSE;
    115                         this->next=NULL;               
     116                        this->next=NULL;
     117                        this->prev=NULL;               
    116118                        this->flipRing=NULL;
    117119                }
     
    133135                        this->isIncoming=FALSE;
    134136                        this->next=NULL;
     137                        this->prev=NULL;
    135138                        this->flipRing=NULL;
    136139                }
     
    16841687                                }
    16851688                                fAct = fAct->next;
    1686                         }
     1689                        }                       
    16871690                       
    16881691                        SearchListAct = SearchListRoot; //Set to beginning of list
     1692                        /*Make SearchList doubly linked*/
     1693                        while(SearchListAct!=NULL)
     1694                        {
     1695                                if(SearchListAct->next!=NULL)
     1696                                {
     1697                                        SearchListAct->next->prev = SearchListAct;
     1698                                        //SearchListAct = SearchListAct->next;
     1699                                }
     1700                                SearchListAct = SearchListAct->next;
     1701                        }
     1702                        SearchListAct = SearchListRoot; //Set to beginning of List
    16891703                       
    16901704                        fAct = gcAct->facetPtr;                 
     
    17131727                                        gcTmp->normalize();
    17141728                                        /*add facets to SLA here*/
    1715                                         gcTmp->enqueueNewFacets(*SearchListRoot);
     1729                                        SearchListRoot=gcTmp->enqueueNewFacets(*SearchListRoot);
    17161730                                        gcTmp->showSLA(*SearchListRoot);
    17171731                                        rChangeCurrRing(gcAct->baseRing);
     
    18731887                /**
    18741888                * Takes ptr to search list root
    1875                 */
    1876                 void enqueueNewFacets(facet &f)
    1877                 {
     1889                * Returns a pointer to new first element of Searchlist
     1890                */
     1891                //void enqueueNewFacets(facet &f)
     1892                facet * enqueueNewFacets(facet &f)
     1893                {
     1894                        facet *slHead;
     1895                        slHead = &f;
    18781896                        facet *slAct;   //called with f=SearchListRoot
    18791897                        slAct = &f;
     
    19021920                                doNotAdd=TRUE;
    19031921                                fNormal = fAct->getFacetNormal();
    1904                                 slAct = &f;     //return to start of list
     1922                                slAct = slHead; //return to start of list
    19051923                                codim2Act = fAct->codim2Ptr;
    19061924                                while(slAct!=slEndStatic->next)
     
    19221940                                                                if( !(areEqual(f2Normal,sl2Normal)))
    19231941                                                                {
    1924                                                                         doNotAdd=FALSE;
     1942                                                                        doNotAdd=FALSE;                                                 
    19251943                                                                        break;                                         
    19261944                                                                       
     
    19301948                                                        if(doNotAdd==FALSE)
    19311949                                                                break;
    1932                                                         codim2Act = codim2Act->next;
    1933                                                        
     1950                                                        codim2Act = codim2Act->next;                                                   
    19341951                                                }
    1935                                                 //doNotAdd=FALSE;
    1936                                                 //break;
     1952                                                if(doNotAdd==TRUE)
     1953                                                {/*dequeue slAct*/
     1954                                                        if(slAct->prev==NULL && slHead!=NULL)
     1955                                                        {
     1956                                                                slHead = slAct->next;
     1957                                                                slHead->prev = NULL;
     1958                                                        }
     1959                                                        else
     1960                                                        {                                               
     1961                                                                slAct->prev->next = slAct->next;                                       
     1962                                                        }
     1963                                                        //NOTE Memory leak above!
     1964                                                        break;
     1965                                                }       
     1966                                                slAct = slAct->next;
    19371967                                        }
    1938                                         slAct = slAct->next;
     1968                                        else
     1969                                        {
     1970                                                doNotAdd=FALSE;
     1971                                                break;
     1972                                        }
     1973                                        //slAct = slAct->next;
    19391974                                       
    1940                                         if(doNotAdd==FALSE)
    1941                                                 break;                                 
    1942                                 }
     1975                                        //if(doNotAdd==FALSE)
     1976                                        //      break;                                 
     1977                                }//while(slAct!=slEndStatic->next)
    19431978                                if(doNotAdd==FALSE)
    19441979                                {
     
    19501985                                fAct = fAct->next;
    19511986                        }
     1987                        return slHead;
    19521988//                      delete sl2Normal;
    19531989//                      delete slNormal;
Note: See TracChangeset for help on using the changeset viewer.