Changeset cef7ee in git
- Timestamp:
- May 14, 2009, 11:55:36 AM (15 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- c0e207fbb11405ebf5b0060af0a525225c8f26e7
- Parents:
- 787685e7e497280120367f7fab407e5a43d7c629
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
r787685 rcef7ee 2 2 Compute the Groebner fan of an ideal 3 3 $Author: monerjan $ 4 $Date: 2009-05-1 2 15:30:29$5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.5 0 2009-05-12 15:30:29monerjan Exp $6 $Id: gfan.cc,v 1.5 0 2009-05-12 15:30:29monerjan Exp $4 $Date: 2009-05-14 09:55:36 $ 5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.51 2009-05-14 09:55:36 monerjan Exp $ 6 $Id: gfan.cc,v 1.51 2009-05-14 09:55:36 monerjan Exp $ 7 7 */ 8 8 … … 266 266 * direction of the according facet normal 267 267 */ 268 //NOTE Prolly need to specify the facet to flip over 268 269 gcone(const gcone& gc) 269 270 { … … 1316 1317 /** \brief The new method of Markwig and Jensen 1317 1318 */ 1318 void noRevS(gcone &gc )1319 void noRevS(gcone &gc, bool usingIntPoint=FALSE) 1319 1320 { 1320 1321 facet *fListPtr = new facet(); … … 1327 1328 ddrows=2; //Each facet is described by its normal 1328 1329 ddcols=gc.numVars+1; // plus one for the standard simplex 1329 1330 while(fAct->next!=NULL) 1331 { 1332 /*Compute an interior point for each facet*/ 1333 dd_MatrixPtr ddineq; 1334 ddineq=dd_CreateMatrix(ddrows,ddcols); 1335 intvec *comp = new intvec(this->numVars); 1336 comp=fAct->getFacetNormal(); 1337 for(int ii=0; ii<this->numVars; ii++) 1338 { 1339 dd_set_si(ddineq->matrix[0][ii+1],(*comp)[ii]); 1340 dd_set_si(ddineq->matrix[1][ii+1],1); //Assure we search in the pos. orthant 1341 } 1342 set_addelem(ddineq->linset,1); //We want equality in the first row 1343 //dd_WriteMatrix(stdout,ddineq); 1344 interiorPoint(ddineq,*comp); 1345 /**/ 1346 #ifdef gfan_DEBUG 1347 cout << "IP is"; 1348 comp->show(); cout << endl; 1349 #endif 1350 //Store the interior point and the UCN 1351 fListPtr->setInteriorPoint( comp ); 1352 fListPtr->setUCN( gc.getUCN() ); 1353 1354 dd_FreeMatrix(ddineq); 1355 fAct=fAct->next; //iterate 1356 } 1330 if(usingIntPoint){ 1331 while(fAct->next!=NULL) 1332 { 1333 /*Compute an interior point for each facet*/ 1334 dd_MatrixPtr ddineq; 1335 ddineq=dd_CreateMatrix(ddrows,ddcols); 1336 intvec *comp = new intvec(this->numVars); 1337 comp=fAct->getFacetNormal(); 1338 for(int ii=0; ii<this->numVars; ii++) 1339 { 1340 dd_set_si(ddineq->matrix[0][ii+1],(*comp)[ii]); 1341 dd_set_si(ddineq->matrix[1][ii+1],1); //Assure we search in the pos. orthant 1342 } 1343 set_addelem(ddineq->linset,1); //We want equality in the first row 1344 //dd_WriteMatrix(stdout,ddineq); 1345 interiorPoint(ddineq,*comp); 1346 /**/ 1347 #ifdef gfan_DEBUG 1348 cout << "IP is"; 1349 comp->show(); cout << endl; 1350 #endif 1351 //Store the interior point and the UCN 1352 fListPtr->setInteriorPoint( comp ); 1353 fListPtr->setUCN( gc.getUCN() ); 1354 1355 dd_FreeMatrix(ddineq); 1356 fAct=fAct->next; //iterate 1357 } 1358 } 1357 1359 1358 1360 //NOTE Hm, comment in and get a crash for free... … … 1380 1382 * Each section starts with its name in CAPITALS 1381 1383 */ 1382 void writeConeToFile(gcone const &gc )1384 void writeConeToFile(gcone const &gc, bool usingIntPoints=FALSE) 1383 1385 { 1384 1386 ofstream gcOutputFile("/tmp/cone1.gc"); … … 1400 1402 fAct = gc.facetPtr; 1401 1403 gcOutputFile << "FACETS" << endl; 1402 while(fAct !=NULL)1404 while(fAct->next!=NULL) 1403 1405 { 1404 1406 intvec *iv = new intvec(gc.numVars);
Note: See TracChangeset
for help on using the changeset viewer.