Changeset c888ad in git for kernel/gfan.cc
- Timestamp:
- Jul 24, 2009, 10:59:45 AM (15 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- dfb5988d2fef3b4aafc6823ebfc36a09411689b4
- Parents:
- 8c1592fd363749fb677e5b714b0180fcde6c8ac8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
r8c1592 rc888ad 2 2 Compute the Groebner fan of an ideal 3 3 $Author: monerjan $ 4 $Date: 2009-07-2 3 12:34:53$5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.8 1 2009-07-23 12:34:53monerjan Exp $6 $Id: gfan.cc,v 1.8 1 2009-07-23 12:34:53monerjan 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 $ 7 7 */ 8 8 … … 93 93 94 94 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 96 98 */ 97 99 bool isFlippable; //**flippable facet? */ … … 1171 1173 rChangeCurrRing(dstRing); 1172 1174 1173 #ifdef gfan_DEBUG1175 //#ifdef gfan_DEBUG 1174 1176 rWrite(dstRing); cout << endl; 1175 #endif1177 //#endif 1176 1178 ideal dstRing_I; 1177 1179 dstRing_I=idrCopyR(srcRing_HH,srcRing); … … 1704 1706 facet *SearchListRoot = new facet(); //The list containing ALL facets we come across 1705 1707 facet *SearchListAct; 1708 SearchListAct = NULL; 1706 1709 //SearchListAct = SearchListRoot; 1707 1710 … … 1749 1752 { 1750 1753 fNormal = fAct->getFacetNormal(); 1751 if( ii==0)1754 if( ii==0 || (ii>0 && SearchListAct==NULL) ) //1st facet may be non-flippable 1752 1755 { 1753 1756 SearchListAct = SearchListRoot; … … 1755 1758 } 1756 1759 else 1757 { 1760 { 1758 1761 SearchListAct->next = new facet(); 1759 SearchListAct = SearchListAct->next; 1762 SearchListAct = SearchListAct->next; 1760 1763 //memcpy(SearchListAct,fAct,sizeof(facet)); 1761 1764 } … … 1797 1800 if(SearchListAct->next!=NULL) 1798 1801 { 1799 SearchListAct->next->prev = SearchListAct; 1800 //SearchListAct = SearchListAct->next; 1802 SearchListAct->next->prev = SearchListAct; 1801 1803 } 1802 1804 SearchListAct = SearchListAct->next; … … 1804 1806 SearchListAct = SearchListRoot; //Set to beginning of List 1805 1807 1806 fAct = gcAct->facetPtr; 1808 fAct = gcAct->facetPtr; 1809 //NOTE Disabled until code works as expected 1807 1810 //gcAct->writeConeToFile(*gcAct); 1808 1811 … … 1812 1815 Choose a facet from fListPtr, flip it and forget the previous cone 1813 1816 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) 1816 1819 {//NOTE See to it that the cone is only changed after ALL facets have been flipped! 1817 1820 fAct = SearchListAct; … … 2005 2008 } */ 2006 2009 } 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. 2008 2018 * Takes ptr to search list root 2009 2019 * Returns a pointer to new first element of Searchlist … … 2025 2035 facet *sl2Act; 2026 2036 sl2Act = f.codim2Ptr; 2037 /** Pointer to a facet that will be deleted */ 2027 2038 facet *deleteMarker; 2028 2039 deleteMarker = NULL; 2029 2040 2041 /** Flag to indicate a facet that should be added to SLA*/ 2030 2042 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 */ 2031 2047 bool removalOccured=FALSE; 2032 2048 int ctr=0; //encountered qualities in SLA … … 2116 2132 { 2117 2133 notParallelCtr++; 2134 slAct = slAct->next; 2118 2135 } 2119 2136 else … … 2156 2173 }//NOTE find a way to delete without affecting slAct = slAct->next 2157 2174 else if(slAct==slEndStatic) 2158 { 2175 { 2176 deleteMarker = slAct; 2159 2177 if(slEndStatic->next==NULL) 2160 2178 { … … 2186 2204 //break; 2187 2205 } 2206 slAct = slAct->next; 2207 delete deleteMarker; 2188 2208 }//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;*/ 2191 2215 deleteMarker=NULL; 2192 2216 //if slAct was marked as to be deleted, delete it here!
Note: See TracChangeset
for help on using the changeset viewer.