Changeset e58dbb in git


Ignore:
Timestamp:
Mar 25, 2011, 1:49:49 PM (13 years ago)
Author:
Martin Monerjan
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
Children:
787f10764ca8eabeccca61ebad635bf6a2b12c5a
Parents:
de4e64a426712523b3ba44188f1f75f4bb4aad7d
Message:
cleanup


git-svn-id: file:///usr/local/Singular/svn/trunk@14068 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    rde4e64 re58dbb  
    291291        const int64vec* fNormal; //No new since iv64Copy and therefore getFacetNormal return a new
    292292        const int64vec* sNormal;
    293         fNormal = f->getRef2FacetNormal();//->getFacetNormal();
    294         sNormal = s->getRef2FacetNormal();//->getFacetNormal();
     293        fNormal = f->getRef2FacetNormal();
     294        sNormal = s->getRef2FacetNormal();
    295295#include "intvec.h"
    296296        //Do not need parallelity. Too time consuming
     
    301301        int64vec *fNRef=const_cast<int64vec*>(fNormal);
    302302        int64vec *sNRef=const_cast<int64vec*>(sNormal);
    303 //      if(isParallel(*fNormal,*sNormal))       
    304303        if(isParallel(*fNRef,*sNRef))
    305304//      if(fNormal->compare((sNormal))!=0)//Behold! Teh definitive Mandelbug
     
    312311                {
    313312                        const int64vec* f2Normal;
    314                         f2Normal = f2Act->getRef2FacetNormal();//->getFacetNormal();
     313                        f2Normal = f2Act->getRef2FacetNormal();
    315314//                      int64vec *f2Ref=const_cast<int64vec*>(f2Normal);
    316315                        s2Act = s->codim2Ptr;
     
    318317                        {
    319318                                const int64vec* s2Normal;
    320                                 s2Normal = s2Act->getRef2FacetNormal();//->getFacetNormal();
     319                                s2Normal = s2Act->getRef2FacetNormal();
    321320//                              bool foo=areEqual(f2Normal,s2Normal);
    322321//                              int64vec *s2Ref=const_cast<int64vec*>(s2Normal);
     
    325324                                        ctr++;
    326325                                s2Act = s2Act->next;
    327 //                              delete s2Normal;
    328326                        }
    329 //                      delete f2Normal;
    330327                        f2Act = f2Act->next;
    331328                }               
    332329        }
    333 //      delete fNormal;
    334 //      delete sNormal;
    335330        if(ctr==f->numCodim2Facets)
    336331                res=TRUE;
     
    347342#endif
    348343        return res;
    349 //      int64vec *foo=ivNeg(sNormal);
    350 //      if(fNormal->compare(foo)!=0) //facet normals
    351 //      {
    352 //              delete foo;
    353 //              res=FALSE;
    354 //      }
    355 //      else
    356 //      {
    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;
    386344}       
    387345               
     
    404362{                               
    405363        return iv64Copy(this->fNormal);
    406 //      return this->fNormal;
    407364}
    408365
     
    488445*/
    489446volatile void facet::fDebugPrint()
    490 {                       
     447{
     448  #ifndef NDEBUG
    491449        facet *codim2Act;                       
    492450        codim2Act = this->codim2Ptr;
     
    506464        }
    507465        printf("=======================\n");
    508         delete fNormal;
    509 }               
    510                
    511 //friend class gcone;   //Bad style
     466        delete fNormal;
     467  #endif
     468}
    512469
    513470
     
    572529//      this->prev=(gcone *)&gc; //comment in to get a tree
    573530        this->prev=NULL;
    574         this->numVars=gc.numVars;                                               
     531        this->numVars=gc.numVars;
    575532        this->counter++;
    576533        this->UCN=this->counter;
     
    662619volatile void gcone::showFacets(const short codim)
    663620{
     621  #ifndef NDEBUG
    664622        facet *f=this->facetPtr;
    665623        facet *f2=NULL;
     
    689647        }
    690648        printf("\n");
     649  #endif
    691650}
    692651               
     
    694653static volatile void showSLA(facet &f)
    695654{
     655  #ifndef NDEBUG
    696656        facet *fAct;
    697657        fAct = &f;
     
    726686                }
    727687        }
     688  #endif
    728689}
    729690               
    730691static void idDebugPrint(const ideal &I)
    731692{
     693  #ifndef NDEBUG
    732694        int numElts=IDELEMS(I);
    733695        printf("Ideal with %i generators\n", numElts);
     
    739701        }
    740702        printf("\n");
     703  #endif
    741704}
    742705
     
    11611124        //In cases like I=<x-1,y-1> there are only non-flippable facets...
    11621125        if(numNonFlip==this->numFacets)
    1163         {                                       
     1126        {
    11641127                WerrorS ("Only non-flippable facets. Terminating...\n");
    11651128//              exit(-1);//Bit harsh maybe...
     
    13821345        dd_MatrixPtr ddineq;
    13831346        dd_ErrorType err;       
    1384 //      if(dd_LinealitySpace->rowsize>0)//The linspace might be 0
    1385 //              ddineq = dd_AppendMatrix(gc.ddFacets,gcone::dd_LinealitySpace);
    1386 //      else
    1387 //              ddineq = dd_CopyMatrix(gc.ddFacets);
    13881347        ddineq = (dd_LinealitySpace->rowsize>0) ? dd_AppendMatrix(gc.ddFacets,gcone::dd_LinealitySpace) : dd_CopyMatrix(gc.ddFacets);
    13891348        /* In case the input is non-homogeneous we add constrains for the positive orthant.
     
    14071366        ddPolyh = dd_DDMatrix2Poly(ddineq, &err);
    14081367        dd_MatrixPtr P;
    1409         P=dd_CopyGenerators(ddPolyh);
     1368        P=dd_CopyGenerators(ddPolyh);//Here we actually compute the rays!
    14101369        dd_FreePolyhedra(ddPolyh);
    14111370        dd_FreeMatrix(ddineq);
     
    14191378        for(int ii=0;ii<P->rowsize;ii++)
    14201379        {
    1421 //              int64vec *foo = new int64vec(this->numVars);
    14221380                int64vec *tmp = ivIntPointOfCone;
    14231381                makeInt(P,ii+1,*foo);
    14241382                ivIntPointOfCone = iv64Add(ivIntPointOfCone,foo);
    14251383                delete tmp;
    1426 //              delete foo;
    14271384        }
    14281385        delete foo;
     
    14301387        for (int ii=0;ii<(this->numVars);ii++)
    14311388        {
    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));
    14361389                if( (*ivIntPointOfCone)[ii]>INT_MAX )
    14371390                        WarnS("Interior point exceeds INT_MAX!\n");
    1438 //              mpq_clear(product);
    14391391                //Compute intgcd
    14401392                ggT=int64gcd(ggT,(*ivIntPointOfCone)[ii]);
     
    14501402                }
    14511403        }
    1452 //      mpq_clear(qkgV);
    1453 //      delete [] colSum;
     1404
    14541405        /*For homogeneous input (like Det3,3,5) the int points may be negative. So add a suitable multiple of (1,_,1)*/
    14551406        if(hasHomInput==TRUE && iv64isStrictlyPositive(ivIntPointOfCone)==FALSE)
     
    24492400static bool isParallel(const int64vec &a,const int64vec &b)
    24502401{       
    2451 /*#ifdef gfanp 
    2452         timeval start, end;
    2453         gettimeofday(&start, 0);
    2454 #endif*/               
    24552402        bool res;
    24562403        int lhs=dotProduct(a,b)*dotProduct(a,b);
    24572404        int rhs=dotProduct(a,a)*dotProduct(b,b);
    2458 // #ifdef gfanp
    2459 //      gettimeofday(&end, 0);
    2460 //      t_isParallel += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
    2461 // #endif       
    2462 //      return res;
    24632405        return res = (lhs==rhs)?TRUE:FALSE;
    2464 }//bool isParallel
     2406}
    24652407
    24662408/** \brief Compute an interior point of a given cone
  • kernel/gfan.h

    rde4e64 re58dbb  
    1313
    1414#include <kernel/int64vec.h>
    15 // #include "int64vec.h"
    1615
    1716#define p800
     
    2928#endif
    3029#ifndef USE_ZFAN
    31 lists grfan(ideal inputIdeal, int heuristic, bool singleCone);
     30  lists grfan(ideal inputIdeal, int heuristic, bool singleCone);
    3231#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);
    3534#endif
    3635// lists grcone_by_intvec(ideal inputIdeal);
Note: See TracChangeset for help on using the changeset viewer.