Changeset 398e35 in git
- Timestamp:
- Jul 22, 2009, 11:57:23 AM (14 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 9be65c2f015f278636f0f197b120707fa72d825f
- Parents:
- c17211fd987aecab4e77b072748408f46325a27b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
rc17211 r398e35 2 2 Compute the Groebner fan of an ideal 3 3 $Author: monerjan $ 4 $Date: 2009-07-2 1 15:56:28$5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1. 79 2009-07-21 15:56:28monerjan Exp $6 $Id: gfan.cc,v 1. 79 2009-07-21 15:56:28monerjan Exp $4 $Date: 2009-07-22 09:57:23 $ 5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.80 2009-07-22 09:57:23 monerjan Exp $ 6 $Id: gfan.cc,v 1.80 2009-07-22 09:57:23 monerjan Exp $ 7 7 */ 8 8 … … 534 534 int getUCN() 535 535 { 536 return this->UCN; 536 if(this!=NULL) 537 return this->UCN; 538 else 539 return -1; 537 540 } 538 541 … … 1172 1175 #endif 1173 1176 ideal dstRing_I; 1174 dstRing_I=idrCopyR(srcRing_HH,srcRing); 1177 dstRing_I=idrCopyR(srcRing_HH,srcRing); 1178 //dstRing_I=idrCopyR(inputIdeal,srcRing); 1175 1179 //validOpts<1>=TRUE; 1176 1180 #ifdef gfan_DEBUG … … 1179 1183 BITSET save=test; 1180 1184 test|=Sy_bit(OPT_REDSB); 1185 test|=Sy_bit(OPT_REDTAIL); 1181 1186 test|=Sy_bit(6); //OPT_DEBUG 1182 1187 ideal tmpI; 1183 1188 tmpI = idrCopyR(this->inputIdeal,this->baseRing); 1184 1189 dstRing_I=kStd(tmpI,NULL,testHomog,NULL); 1185 kInterRed(dstRing_I);1190 //kInterRed(dstRing_I); 1186 1191 idSkipZeroes(dstRing_I); 1187 1192 test=save; … … 1295 1300 *\return void 1296 1301 */ 1297 void getGB(ideal const &inputIdeal) 1298 { 1302 void getGB(ideal const &inputIdeal) 1303 { 1304 BITSET save=test; 1305 test|=Sy_bit(OPT_REDSB); 1306 test|=Sy_bit(OPT_REDTAIL); 1299 1307 ideal gb; 1300 1308 gb=kStd(inputIdeal,NULL,testHomog,NULL); 1301 1309 idSkipZeroes(gb); 1302 1310 this->gcBasis=gb; //write the GB into gcBasis 1311 test=save; 1303 1312 }//void getGB 1304 1313 … … 2012 2021 facet *sl2Act; 2013 2022 sl2Act = f.codim2Ptr; 2023 facet *deleteMarker; 2024 deleteMarker = NULL; 2014 2025 2015 2026 bool doNotAdd=FALSE; … … 2038 2049 slAct = slHead; 2039 2050 notParallelCtr=0; 2051 /*If slAct==NULL and fAct!=NULL 2052 we just copy all remaining facets into SLA*/ 2053 if(slAct==NULL) 2054 { 2055 facet *fCopy; 2056 fCopy = fAct; 2057 while(fCopy!=NULL) 2058 { 2059 if(slAct==NULL) 2060 { 2061 slAct = new facet(); 2062 slHead = slAct; 2063 } 2064 else 2065 { 2066 slAct->next = new facet(); 2067 slAct = slAct->next; 2068 } 2069 slAct->setFacetNormal(fAct->getFacetNormal()); 2070 slAct->setUCN(fAct->getUCN()); 2071 slAct->isFlippable=fAct->isFlippable; 2072 facet *f2Copy; 2073 f2Copy = fCopy->codim2Ptr; 2074 sl2Act = slAct->codim2Ptr; 2075 while(f2Copy!=NULL) 2076 { 2077 if(sl2Act==NULL) 2078 { 2079 sl2Act = new facet(2); 2080 slAct->codim2Ptr = sl2Act; 2081 } 2082 else 2083 { 2084 facet *marker; 2085 marker = sl2Act; 2086 sl2Act->next = new facet(2); 2087 sl2Act = sl2Act->next; 2088 sl2Act->prev = marker; 2089 } 2090 sl2Act->setFacetNormal(f2Copy->getFacetNormal()); 2091 sl2Act->setUCN(f2Copy->getUCN()); 2092 f2Copy = f2Copy->next; 2093 } 2094 fCopy = fCopy->next; 2095 } 2096 break; 2097 } 2098 /*End of */ 2040 2099 while(slAct!=NULL) 2041 2100 //while(slAct!=slEndStatic->next) … … 2083 2142 removalOccured=TRUE; 2084 2143 slAct->isFlippable=FALSE; 2085 doNotAdd=TRUE; 2144 doNotAdd=TRUE; 2086 2145 if(slAct==slHead) //We want to delete the first element of SearchList 2087 { 2088 slHead = slAct->next; 2146 { 2147 deleteMarker = slHead; 2148 slHead = slAct->next; 2089 2149 if(slHead!=NULL) 2090 slHead->prev = NULL; 2150 slHead->prev = NULL; 2091 2151 //set a bool flag to mark slAct as to be deleted 2092 } 2152 }//NOTE find a way to delete without affecting slAct = slAct->next 2093 2153 else if(slAct==slEndStatic) 2094 { 2154 { 2095 2155 if(slEndStatic->next==NULL) 2096 { 2156 { 2097 2157 slEndStatic = slEndStatic->prev; 2098 2158 slEndStatic->next = NULL; … … 2108 2168 else 2109 2169 { 2170 deleteMarker = slAct; 2110 2171 slAct->prev->next = slAct->next; 2111 2172 slAct->next->prev = slAct->prev; 2112 2173 } 2174 2113 2175 //update lengthOfSearchList 2114 2176 lengthOfSearchList--; … … 2122 2184 }//if(!isParallel(fNormal, slNormal)) 2123 2185 slAct = slAct->next; 2186 delete deleteMarker; 2187 deleteMarker=NULL; 2124 2188 //if slAct was marked as to be deleted, delete it here! 2125 2189 }//while(slAct!=NULL)
Note: See TracChangeset
for help on using the changeset viewer.