Changeset fc1971 in git
- Timestamp:
- Sep 22, 2009, 11:40:10 AM (15 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- 6e05dc2a25c4f0ad4762efc3fed10c763d86d7f1
- Parents:
- e4dfa998b64bccbdf36f705de5490011b3ef0590
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
re4dfa99 rfc1971 2 2 Compute the Groebner fan of an ideal 3 3 $Author: monerjan $ 4 $Date: 2009-09- 18 11:54:36$5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.8 5 2009-09-18 11:54:36monerjan Exp $6 $Id: gfan.cc,v 1.8 5 2009-09-18 11:54:36monerjan Exp $4 $Date: 2009-09-22 09:40:10 $ 5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.86 2009-09-22 09:40:10 monerjan Exp $ 6 $Id: gfan.cc,v 1.86 2009-09-22 09:40:10 monerjan Exp $ 7 7 */ 8 8 … … 53 53 #endif 54 54 55 #ifdef p800 56 #include "../../cddlib/include/setoper.h" 57 #include "../../cddlib/include/cdd.h" 58 #include "../../cddlib/include/cddmp.h" 59 #endif 60 55 61 #ifndef gfan_DEBUG 56 62 #define gfan_DEBUG 63 #ifndef gfan_DEBUGLEVEL 64 #define gfan_DEBUGLEVEL 1 65 #endif 57 66 #endif 58 67 … … 275 284 cout << "=======================" << endl; 276 285 cout << "Facet normal = ("; 277 for(int ii=0;ii<pVariables;ii++) 286 fNormal->show(1,1); 287 cout << ")"<<endl; 288 /*for(int ii=0;ii<pVariables;ii++) 278 289 { 279 290 cout << (*fNormal)[ii] << ","; … … 282 293 cout << ")" << endl; 283 294 else 284 cout << ")*" << endl; //This case should never happen in SLA!295 cout << ")*" << endl;*/ //This case should never happen in SLA! 285 296 cout << "-----------------------" << endl; 286 297 cout << "Codim2 facets:" << endl; … … 289 300 f2Normal = codim2Act->getFacetNormal(); 290 301 cout << "("; 291 for(int jj=0;jj<pVariables;jj++) 292 { 293 cout << (*f2Normal)[jj] << ","; 294 } 302 f2Normal->show(1,0); 303 // for(int jj=0;jj<pVariables;jj++) 304 // { 305 // cout << (*f2Normal)[jj] << ","; 306 // } 295 307 cout << ")" << endl; 296 308 codim2Act = codim2Act->next; … … 668 680 else 669 681 { 670 cout << "Redundant rows: ";671 set_fwrite(stdout, ddredrows); //otherwise print the redundant rows682 // cout << "Redundant rows: "; 683 // set_fwrite(stdout, ddredrows); //otherwise print the redundant rows 672 684 }//if dd_Error 673 685 #endif … … 811 823 /** \brief Compute the (codim-2)-facets of a given cone 812 824 * This method is used during noRevS 825 * Additionally we check whether the codim2-facet normal is strictly positive. Otherwise 826 * the facet is marked as non-flippable. 813 827 */ 814 828 void getCodim2Normals(gcone const &gc) … … 973 987 }//while 974 988 #ifdef gfan_DEBUG 975 cout << "Initial Form=";976 pWrite(initialFormElement[ii]);977 cout << "---" << endl;989 // cout << "Initial Form="; 990 // pWrite(initialFormElement[ii]); 991 // cout << "---" << endl; 978 992 #endif 979 993 /*Now initialFormElement must be added to (ideal)initialForm */ … … 1070 1084 construction of the differences 1071 1085 */ 1072 intPointMatrix = dd_CreateMatrix(iPMatrixRows+ 10,this->numVars+1);1086 intPointMatrix = dd_CreateMatrix(iPMatrixRows+3,this->numVars+1); //iPMatrixRows+10; 1073 1087 intPointMatrix->numbtype=dd_Integer; //NOTE: DO NOT REMOVE OR CHANGE TO dd_Rational 1074 1088 … … 1409 1423 //dd_set_si(M->rowvec[0],1);dd_set_si(M->rowvec[1],1);dd_set_si(M->rowvec[2],1); 1410 1424 1425 /*NOTE: Leave the following line commented out! 1426 * Otherwise it will cause interior points that are not strictly positive on some examples 1427 * 1428 */ 1411 1429 //dd_MatrixCanonicalize(&M, &ddlinset, &ddredrows, &ddnewpos, &err); 1412 1430 //if (err!=dd_NoError){cout << "Error during dd_MatrixCanonicalize" << endl;} … … 1830 1848 We always choose the first facet from fListPtr as facet to be flipped 1831 1849 */ 1832 while( SearchListAct!=NULL)// && counter<limit)1850 while((SearchListAct!=NULL) ) 1833 1851 {//NOTE See to it that the cone is only changed after ALL facets have been flipped! 1834 1852 fAct = SearchListAct; … … 2055 2073 /** Flag to indicate a facet that should be added to SLA*/ 2056 2074 bool doNotAdd=FALSE; 2075 /** \brief Flag to mark a facet that might be added 2076 * The following case may occur: 2077 * A facet fAct is found to be parallel but not equal to the current facet slAct from SLA. 2078 * This does however not mean that there does not exist a facet behind the current slAct that is actually equal 2079 * to fAct. In this case we set the boolean flag maybe to TRUE. If we encounter an equality lateron, it is reset to 2080 * FALSE and the according slAct is deleted. 2081 * If slAct->next==NULL AND maybe==TRUE we know, that fAct must be added 2082 */ 2083 volatile bool maybe=FALSE; 2057 2084 /**A facet was removed, lengthOfSearchlist-- thus we must not rely on 2058 2085 * if(notParallelCtr==lengthOfSearchList) but rather … … 2076 2103 2077 2104 while(fAct!=NULL) 2078 { 2105 { 2079 2106 if(fAct->isFlippable==TRUE) 2080 2107 { 2108 maybe=FALSE; 2081 2109 doNotAdd=TRUE; 2082 2110 fNormal=fAct->getFacetNormal(); … … 2146 2174 { 2147 2175 notParallelCtr++; 2148 slAct = slAct->next;2176 // slAct = slAct->next; 2149 2177 } 2150 2178 else //fN and slN are parallel 2151 2179 { 2180 //We check whether the codim-2-facets coincide 2152 2181 codim2Act = fAct->codim2Ptr; 2153 2182 ctr=0; … … 2172 2201 slNormal->show(1,0); 2173 2202 cout << ") from SLA:" << endl; 2174 fAct->fDebugPrint();2175 slAct->fDebugPrint();2203 fAct->fDebugPrint(); 2204 slAct->fDebugPrint(); 2176 2205 #endif 2177 2206 removalOccured=TRUE; 2178 2207 slAct->isFlippable=FALSE; 2179 doNotAdd=TRUE; 2208 doNotAdd=TRUE; 2209 maybe=FALSE; 2180 2210 if(slAct==slHead) //We want to delete the first element of SearchList 2181 2211 { … … 2211 2241 //update lengthOfSearchList 2212 2242 lengthOfSearchList--; 2213 slAct = slAct->next;2243 //slAct = slAct->next; //not needed, since facets are equal 2214 2244 //delete deleteMarker; 2215 2245 deleteMarker=NULL; … … 2220 2250 //is no other facet later in SLA that might be equal. 2221 2251 { 2222 // if(slAct->next==NULL) 2223 // { 2224 doNotAdd=FALSE; 2225 slAct = slAct->next; 2226 break; 2227 // } 2228 // else 2229 // slAct=slAct->next; 2252 maybe=TRUE; 2253 // if(slAct->next==NULL && maybe==TRUE) 2254 // { 2255 // doNotAdd=FALSE; 2256 // slAct = slAct->next; 2257 // break; 2258 // } 2259 // else 2260 // slAct=slAct->next; 2230 2261 } 2231 2262 //slAct = slAct->next; 2232 2263 //delete deleteMarker; 2233 2264 }//if(!isParallel(fNormal, slNormal)) 2265 if( (slAct->next==NULL) && (maybe==TRUE) ) 2266 { 2267 doNotAdd=FALSE; 2268 break; 2269 } 2270 slAct = slAct->next; 2234 2271 /* NOTE The following lines must not be here but rather called inside the if-block above. 2235 2272 Otherwise results get crappy. Unfortunately there are two slAct=slAct->next calls now,
Note: See TracChangeset
for help on using the changeset viewer.