Changeset 5ece85 in git
- Timestamp:
- Jan 29, 2010, 10:51:19 AM (13 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 20d4b60dbf3e6336262bc0f3909917d6f602bbe6
- Parents:
- be6689fe956f0a8b1125b510d5502af93d70d021
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
rbe6689f r5ece85 32 32 #include <time.h> 33 33 #include <sys/time.h> 34 #include <stdlib.h> 34 35 //#include <gmpxx.h> 35 #include <vector> 36 // #include <vector> 37 36 38 37 39 /*DO NOT REMOVE THIS*/ … … 93 95 this->codim=1; //default for (codim-1)-facets 94 96 this->numCodim2Facets=0; 97 this->numRays=0; 95 98 this->flipGB=NULL; 96 99 this->isIncoming=FALSE; … … 116 119 }//NOTE Handle exception here! 117 120 this->numCodim2Facets=0; 121 this->numRays=0; 118 122 this->flipGB=NULL; 119 123 this->isIncoming=FALSE; … … 503 507 * This is mainly for debugging purposes. Usually called from within gdb 504 508 */ 505 inline void gcone::showFacets(const short codim) 506 { 507 facet *f; 508 switch(codim) 509 volatile void gcone::showFacets(const short codim) 510 { 511 facet *f=this->facetPtr; 512 facet *f2=NULL; 513 if(codim==2) 514 f2=this->facetPtr->codim2Ptr; 515 /*switch(codim) 509 516 { 510 517 case 1: … … 512 519 break; 513 520 case 2: 514 f = this->facetPtr->codim2Ptr;521 f2 = this->facetPtr->codim2Ptr; 515 522 break; 516 } 523 }*/ 517 524 while(f!=NULL) 518 525 { … … 526 533 cout << ") "; 527 534 delete iv; 535 if(codim==2) 536 { 537 f2=f->codim2Ptr; 538 while(f2!=NULL) 539 { 540 cout << "["; 541 f2->getFacetNormal()->show(1,0); 542 cout << "]"; 543 f2 = f2->next; 544 } 545 cout << endl; 546 } 528 547 f=f->next; 529 548 } … … 1182 1201 dd_MatrixPtr P; 1183 1202 P=dd_CopyGenerators(ddPolyh); 1184 dd_FreePolyhedra(ddPolyh); 1203 dd_FreePolyhedra(ddPolyh); 1185 1204 //Loop through the rows of P and check whether fNormal*row[i]=0 => row[i] belongs to fNormal 1186 1205 int rows=P->rowsize; … … 1209 1228 } 1210 1229 codim2Act->setFacetNormal(rowvec); 1211 //Check flippability1230 fAct->numRays++; 1212 1231 } 1213 1232 delete(rowvec); 1214 } 1233 } 1234 //Now (if we have at least 3 variables) do a bubblesort on the rays 1235 /*if(this->numVars>2) 1236 { 1237 facet *A[fAct->numRays-1]; 1238 facet *f2Act=fAct->codim2Ptr; 1239 for(unsigned ii=0;ii<fAct->numRays;ii++) 1240 { 1241 A[ii]=f2Act; 1242 f2Act=f2Act->next; 1243 } 1244 bool exchanged=FALSE; 1245 unsigned n=fAct->numRays-1; 1246 do 1247 { 1248 exchanged=FALSE;//n=fAct->numRays-1; 1249 for(unsigned ii=0;ii<=n-1;ii++) 1250 { 1251 if((A[ii]->fNormal)->compare((A[ii+1]->fNormal))==1) 1252 { 1253 //Swap rays 1254 cout << "Swapping "; 1255 A[ii]->fNormal->show(1,0); cout << " with "; A[ii+1]->fNormal->show(1,0); cout << endl; 1256 A[ii]->next=A[ii+1]->next; 1257 if(ii>0) 1258 A[ii-1]->next=A[ii+1]; 1259 A[ii+1]->next=A[ii]; 1260 if(ii==0) 1261 fAct->codim2Ptr=A[ii+1]; 1262 //end swap 1263 facet *tmp=A[ii];//swap in list 1264 A[ii+1]=A[ii]; 1265 A[ii]=tmp; 1266 // tmp=NULL; 1267 } 1268 } 1269 n--; 1270 }while(exchanged==TRUE && n>=0); 1271 }*///if pVariables>2 1215 1272 delete fNormal; 1216 1273 fAct = fAct->next; … … 1218 1275 //Now all extremal rays should be set w.r.t their respective fNormal 1219 1276 //TODO Not sufficient -> vol2 II/125&127 1277 //NOTE Sufficient according to cddlibs doc. These ARE rays 1220 1278 fAct=gc.facetPtr; 1221 1279 while(fAct!=NULL) … … 1250 1308 fAct = fAct->next; 1251 1309 } 1310 1311 1252 1312 #ifdef gfanp 1253 1313 gettimeofday(&end, 0); … … 1648 1708 } 1649 1709 if (isParallel(*check,fNormal)) //pass *check when 1710 // if(fNormal.compare(check)==0) 1650 1711 { 1651 1712 //Found a parallel vector. Add it … … 2290 2351 //while(codim2Act!=NULL) 2291 2352 for(int jj=0;jj<fAct->numCodim2Facets;jj++) 2353 // for(int jj=0;jj<fAct->numRays-1;jj++) 2292 2354 { 2293 2355 intvec *f2Normal; … … 3147 3209 return rCopy(this->baseRing); 3148 3210 } 3211 /** \brief Sort the rays of a facet lexicographically 3212 */ 3213 void gcone::sortRays(gcone *gc) 3214 { 3215 facet *fAct; 3216 fAct = this->facetPtr->codim2Ptr; 3217 // while(fAct->next!=NULL) 3218 // { 3219 // if(fAct->fNormal->compare(fAct->fNormal->next)==-1 3220 // } 3221 } 3222 3149 3223 /** \brief Gather the output 3150 3224 * List of lists -
kernel/gfan.h
rbe6689f r5ece85 76 76 int numCodim2Facets; //#of (codim-2)-facets of this facet. Set in getCodim2Normals() 77 77 ring flipRing; //the ring on the other side of the facet 78 78 unsigned numRays; //Number of spanning rays of the cone 79 79 /** The default constructor. */ 80 80 facet(); … … 195 195 inline int getUCN(); 196 196 inline int getPredUCN(); 197 inline void showFacets(short codim=1);197 volatile void showFacets(short codim=1); 198 198 inline volatile void showSLA(facet &f); 199 199 inline void idDebugPrint(const ideal &I); … … 209 209 inline void readConeFromFile(int gcNum, gcone *gc); 210 210 inline intvec f2M(gcone *gc, facet *f, int n=1); 211 211 inline void sortRays(gcone *gc); 212 212 //The real stuff 213 213 inline void getConeNormals(const ideal &I, bool compIntPoint=FALSE);
Note: See TracChangeset
for help on using the changeset viewer.