Changeset e58dbb in git
- Timestamp:
- Mar 25, 2011, 1:49:49 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 787f10764ca8eabeccca61ebad635bf6a2b12c5a
- Parents:
- de4e64a426712523b3ba44188f1f75f4bb4aad7d
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
rde4e64 re58dbb 291 291 const int64vec* fNormal; //No new since iv64Copy and therefore getFacetNormal return a new 292 292 const int64vec* sNormal; 293 fNormal = f->getRef2FacetNormal(); //->getFacetNormal();294 sNormal = s->getRef2FacetNormal(); //->getFacetNormal();293 fNormal = f->getRef2FacetNormal(); 294 sNormal = s->getRef2FacetNormal(); 295 295 #include "intvec.h" 296 296 //Do not need parallelity. Too time consuming … … 301 301 int64vec *fNRef=const_cast<int64vec*>(fNormal); 302 302 int64vec *sNRef=const_cast<int64vec*>(sNormal); 303 // if(isParallel(*fNormal,*sNormal))304 303 if(isParallel(*fNRef,*sNRef)) 305 304 // if(fNormal->compare((sNormal))!=0)//Behold! Teh definitive Mandelbug … … 312 311 { 313 312 const int64vec* f2Normal; 314 f2Normal = f2Act->getRef2FacetNormal(); //->getFacetNormal();313 f2Normal = f2Act->getRef2FacetNormal(); 315 314 // int64vec *f2Ref=const_cast<int64vec*>(f2Normal); 316 315 s2Act = s->codim2Ptr; … … 318 317 { 319 318 const int64vec* s2Normal; 320 s2Normal = s2Act->getRef2FacetNormal(); //->getFacetNormal();319 s2Normal = s2Act->getRef2FacetNormal(); 321 320 // bool foo=areEqual(f2Normal,s2Normal); 322 321 // int64vec *s2Ref=const_cast<int64vec*>(s2Normal); … … 325 324 ctr++; 326 325 s2Act = s2Act->next; 327 // delete s2Normal;328 326 } 329 // delete f2Normal;330 327 f2Act = f2Act->next; 331 328 } 332 329 } 333 // delete fNormal;334 // delete sNormal;335 330 if(ctr==f->numCodim2Facets) 336 331 res=TRUE; … … 347 342 #endif 348 343 return res; 349 // int64vec *foo=ivNeg(sNormal);350 // if(fNormal->compare(foo)!=0) //facet normals351 // {352 // delete foo;353 // res=FALSE;354 // }355 // else356 // {357 // facet* f2Act;358 // facet* s2Act;359 // f2Act = f->codim2Ptr;360 // ctr=0;361 // while(f2Act!=NULL)362 // {363 // int64vec* f2Normal;364 // f2Normal = f2Act->getFacetNormal();365 // s2Act = s->codim2Ptr;366 // while(s2Act!=NULL)367 // {368 // int64vec* s2Normal;369 // s2Normal = s2Act->getFacetNormal();370 // // bool foo=areEqual(f2Normal,s2Normal);371 // int foo=f2Normal->compare(s2Normal);372 // if(foo==0)373 // ctr++;374 // s2Act = s2Act->next;375 // delete s2Normal;376 // }377 // delete f2Normal;378 // f2Act = f2Act->next;379 // }380 // }381 // delete fNormal;382 // delete sNormal;383 // if(ctr==f->numCodim2Facets)384 // res=TRUE;385 // return res;386 344 } 387 345 … … 404 362 { 405 363 return iv64Copy(this->fNormal); 406 // return this->fNormal;407 364 } 408 365 … … 488 445 */ 489 446 volatile void facet::fDebugPrint() 490 { 447 { 448 #ifndef NDEBUG 491 449 facet *codim2Act; 492 450 codim2Act = this->codim2Ptr; … … 506 464 } 507 465 printf("=======================\n"); 508 delete fNormal; 509 } 510 511 //friend class gcone; //Bad style 466 delete fNormal; 467 #endif 468 } 512 469 513 470 … … 572 529 // this->prev=(gcone *)&gc; //comment in to get a tree 573 530 this->prev=NULL; 574 this->numVars=gc.numVars; 531 this->numVars=gc.numVars; 575 532 this->counter++; 576 533 this->UCN=this->counter; … … 662 619 volatile void gcone::showFacets(const short codim) 663 620 { 621 #ifndef NDEBUG 664 622 facet *f=this->facetPtr; 665 623 facet *f2=NULL; … … 689 647 } 690 648 printf("\n"); 649 #endif 691 650 } 692 651 … … 694 653 static volatile void showSLA(facet &f) 695 654 { 655 #ifndef NDEBUG 696 656 facet *fAct; 697 657 fAct = &f; … … 726 686 } 727 687 } 688 #endif 728 689 } 729 690 730 691 static void idDebugPrint(const ideal &I) 731 692 { 693 #ifndef NDEBUG 732 694 int numElts=IDELEMS(I); 733 695 printf("Ideal with %i generators\n", numElts); … … 739 701 } 740 702 printf("\n"); 703 #endif 741 704 } 742 705 … … 1161 1124 //In cases like I=<x-1,y-1> there are only non-flippable facets... 1162 1125 if(numNonFlip==this->numFacets) 1163 { 1126 { 1164 1127 WerrorS ("Only non-flippable facets. Terminating...\n"); 1165 1128 // exit(-1);//Bit harsh maybe... … … 1382 1345 dd_MatrixPtr ddineq; 1383 1346 dd_ErrorType err; 1384 // if(dd_LinealitySpace->rowsize>0)//The linspace might be 01385 // ddineq = dd_AppendMatrix(gc.ddFacets,gcone::dd_LinealitySpace);1386 // else1387 // ddineq = dd_CopyMatrix(gc.ddFacets);1388 1347 ddineq = (dd_LinealitySpace->rowsize>0) ? dd_AppendMatrix(gc.ddFacets,gcone::dd_LinealitySpace) : dd_CopyMatrix(gc.ddFacets); 1389 1348 /* In case the input is non-homogeneous we add constrains for the positive orthant. … … 1407 1366 ddPolyh = dd_DDMatrix2Poly(ddineq, &err); 1408 1367 dd_MatrixPtr P; 1409 P=dd_CopyGenerators(ddPolyh); 1368 P=dd_CopyGenerators(ddPolyh);//Here we actually compute the rays! 1410 1369 dd_FreePolyhedra(ddPolyh); 1411 1370 dd_FreeMatrix(ddineq); … … 1419 1378 for(int ii=0;ii<P->rowsize;ii++) 1420 1379 { 1421 // int64vec *foo = new int64vec(this->numVars);1422 1380 int64vec *tmp = ivIntPointOfCone; 1423 1381 makeInt(P,ii+1,*foo); 1424 1382 ivIntPointOfCone = iv64Add(ivIntPointOfCone,foo); 1425 1383 delete tmp; 1426 // delete foo;1427 1384 } 1428 1385 delete foo; … … 1430 1387 for (int ii=0;ii<(this->numVars);ii++) 1431 1388 { 1432 // mpq_t product;1433 // mpq_init(product);1434 // mpq_mul(product,qkgV,colSum[ii]);1435 // (*ivIntPointOfCone)[ii]=(int64)mpz_get_d(mpq_numref(product));1436 1389 if( (*ivIntPointOfCone)[ii]>INT_MAX ) 1437 1390 WarnS("Interior point exceeds INT_MAX!\n"); 1438 // mpq_clear(product);1439 1391 //Compute intgcd 1440 1392 ggT=int64gcd(ggT,(*ivIntPointOfCone)[ii]); … … 1450 1402 } 1451 1403 } 1452 // mpq_clear(qkgV); 1453 // delete [] colSum; 1404 1454 1405 /*For homogeneous input (like Det3,3,5) the int points may be negative. So add a suitable multiple of (1,_,1)*/ 1455 1406 if(hasHomInput==TRUE && iv64isStrictlyPositive(ivIntPointOfCone)==FALSE) … … 2449 2400 static bool isParallel(const int64vec &a,const int64vec &b) 2450 2401 { 2451 /*#ifdef gfanp2452 timeval start, end;2453 gettimeofday(&start, 0);2454 #endif*/2455 2402 bool res; 2456 2403 int lhs=dotProduct(a,b)*dotProduct(a,b); 2457 2404 int rhs=dotProduct(a,a)*dotProduct(b,b); 2458 // #ifdef gfanp2459 // gettimeofday(&end, 0);2460 // t_isParallel += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));2461 // #endif2462 // return res;2463 2405 return res = (lhs==rhs)?TRUE:FALSE; 2464 } //bool isParallel2406 } 2465 2407 2466 2408 /** \brief Compute an interior point of a given cone -
kernel/gfan.h
rde4e64 re58dbb 13 13 14 14 #include <kernel/int64vec.h> 15 // #include "int64vec.h"16 15 17 16 #define p800 … … 29 28 #endif 30 29 #ifndef USE_ZFAN 31 lists grfan(ideal inputIdeal, int heuristic, bool singleCone);30 lists grfan(ideal inputIdeal, int heuristic, bool singleCone); 32 31 #else 33 #include <../gfanlib/gfanlib.h>34 gfan::ZFan *grfan(ideal inputIdeal, int h, bool singleCone);32 #include <../gfanlib/gfanlib.h> 33 gfan::ZFan *grfan(ideal inputIdeal, int h, bool singleCone); 35 34 #endif 36 35 // lists grcone_by_intvec(ideal inputIdeal);
Note: See TracChangeset
for help on using the changeset viewer.