Changeset 11a7dc in git


Ignore:
Timestamp:
Mar 16, 2010, 6:38:44 PM (13 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
f524fdf7562a563db23199898e1aa3b16a4619bc
Parents:
706b890c390993bb14ed93acf3c4b09775b93361
Message:
sed s/cout/printf/g
Removed facets2Matrix and interiorPoint2


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    r706b89 r11a7dc  
    2525#include "prCopy.h"     //Needed for idrCopyR
    2626#include "stairc.h"     //For Hilbert series
    27 #include <iostream>
    2827// #include <bitset>
    2928#include <fstream>      //read-write cones to files
     
    7776//NOTE Defining this will slow things down!
    7877//Only good for very coarse profiling
    79 // #define gfanp
     78#define gfanp
    8079#ifdef gfanp
    8180#include <sys/time.h>
     81#include <iostream>
    8282#endif
    8383
     
    201201{
    202202#ifdef gfan_DEBUG
    203         cout << "shallowdel@UCN " << this->getUCN() << endl;
     203        printf("shallowdel@UCN %i\n", this->getUCN());
    204204#endif
    205205        this->fNormal=NULL;
     
    219219{
    220220#ifdef gfan_DEBUG
    221         cout << "~facet@UCN " << this->getUCN() << endl;
     221        printf("~facet@UCN %i\n",this->getUCN());
    222222#endif
    223223        if(this->fNormal!=NULL)
     
    279279#ifdef gfanp
    280280        gettimeofday(&end, 0);
    281         t_areEqual += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
     281        gcone::t_areEqual += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
    282282#endif 
    283283        return res;
     
    357357#ifdef gfanp
    358358        gettimeofday(&end, 0);
    359         t_areEqual += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
     359        gcone::t_areEqual += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
    360360#endif
    361361        return res;
     
    506506        intvec *fNormal;
    507507        fNormal = this->getFacetNormal();       
    508         cout << "=======================" << endl;
    509         cout << "Facet normal = (";
    510         fNormal->show(1,1);
    511         cout << ")"<<endl;     
    512         cout << "-----------------------" << endl;
    513         cout << "Codim2 facets:" << endl;
     508        printf("=======================\n");
     509        printf("Facet normal = (");fNormal->show(1,1);printf(")\n");
     510        printf("-----------------------\n");
     511        printf("Codim2 facets:\n");
    514512        while(codim2Act!=NULL)
    515513        {
    516514                intvec *f2Normal;
    517515                f2Normal = codim2Act->getFacetNormal();
    518                 cout << "(";
    519                 f2Normal->show(1,0);
    520                 cout << ")" << endl;
     516                printf("(");f2Normal->show(1,0);printf(")\n");
    521517                codim2Act = codim2Act->next;
    522518                delete f2Normal;
    523519        }
    524         cout << "=======================" << endl;
     520        printf("=======================\n");
    525521        delete fNormal;
    526522}               
     
    687683                intvec *iv;
    688684                iv = f->getFacetNormal();
    689                 cout << "(";
    690                 iv->show(1,0);                         
     685                printf("(");iv->show(1,0);
    691686                if(f->isFlippable==FALSE)
    692                         cout << ")* ";
     687                        printf(")* ");
    693688                else
    694                         cout << ") ";
     689                        printf(") ");
    695690                delete iv;
    696691                if(codim==2)
     
    699694                        while(f2!=NULL)
    700695                        {
    701                                 cout << "[";
    702                                 f2->getFacetNormal()->show(1,0);
    703                                 cout << "]";
     696                                printf("[");f2->getFacetNormal()->show(1,0);printf("]");
    704697                                f2 = f2->next;
    705698                        }
    706                         cout << endl;
     699                        printf("\n");
    707700                }
    708701                f=f->next;
    709702        }
    710         cout << endl;
     703        printf("\n");
    711704}
    712705               
     
    721714                codim2Act = fAct->codim2Ptr;
    722715               
    723                 cout << endl;
     716                printf("\n");
    724717                while(fAct!=NULL)
    725718                {
    726719                        intvec *fNormal;               
    727720                        fNormal=fAct->getFacetNormal();
    728                         cout << "(";
    729                         fNormal->show(1,0);
     721                        printf("(");fNormal->show(1,0);
    730722                        if(fAct->isFlippable==TRUE)
    731                                 cout << ") ";
     723                                printf(") ");
    732724                        else
    733                                 cout << ")* ";
     725                                printf(")* ");
    734726                        delete fNormal;
    735727                        codim2Act = fAct->codim2Ptr;
    736                         cout << " Codim2: ";
     728                        printf(" Codim2: ");
    737729                        while(codim2Act!=NULL)
    738730                        {
    739731                                intvec *f2Normal;
    740732                                f2Normal = codim2Act->getFacetNormal();
    741                                 cout << "(";
    742                                 f2Normal->show(1,0);
    743                                 cout << ") ";
     733                                printf("(");f2Normal->show(1,0);printf(") ");
    744734                                delete f2Normal;
    745735                                codim2Act = codim2Act->next;
    746736                        }
    747                         cout << "UCN = " << fAct->getUCN() << endl;                             
     737                        printf("UCN = %i",fAct->getUCN());
    748738                        fAct = fAct->next;
    749739                }
     
    754744{
    755745        int numElts=IDELEMS(I);
    756         cout << "Ideal with " << numElts << " generators" << endl;
    757         cout << "Leading terms: ";
     746        printf("Ideal with %i generators\n", numElts);
     747        printf("Leading terms: ");
    758748        for (int ii=0;ii<numElts;ii++)
    759749        {
    760750                pWrite0(pHead(I->m[ii]));
    761                 cout << ",";
    762         }
    763         cout << endl;
     751                printf(",");
     752        }
     753        printf("\n");
    764754}
    765755
     
    11241114                                fAct->setUCN(this->getUCN());
    11251115#ifdef gfan_DEBUG
    1126                                 cout << "Marking facet (";
    1127                                 load->show(1,0);
    1128                                 cout << ") as non flippable" << endl;                           
     1116                                printf("Marking facet (");load->show(1,0);printf(") as non flippable\n");               
    11291117#endif
    11301118                        }
     
    17211709#ifdef gfan_DEBUG
    17221710//      std::cout << "running gcone::flip" << std::endl;
    1723         std::cout << "flipping UCN " << this->getUCN();
    1724         cout << " over facet (";
     1711        printf("flipping UCN %i over facet",this->getUCN());
    17251712        fNormal->show(1,0);
    1726         cout << ") with UCN " << f->getUCN();
    1727         std::cout << std::endl;
     1713        printf(") with UCN %i\n",f->getUCN() );
    17281714#endif
    17291715        if(this->getUCN() != f->getUCN())
     
    20582044        f->flipRing=rCopy(dstRing);     //store the ring on the other side
    20592045#ifdef gfan_DEBUG
    2060         cout << "Flipped GB is UCN " << counter+1 << ":" << endl;
    2061         this->idDebugPrint(dstRing_I);
    2062 //      idPrint(dstRing_I);
    2063         cout << endl;
     2046        printf("Flipped GB is UCN %i:\n",counter+1);
     2047        idDebugPrint(dstRing_I);
     2048        printf("\n");
    20642049#endif 
    20652050        idDelete(&dstRing_I);   
     
    20872072* Is there a way to construct a vector from \f$ \omega \f$ and the facet normal?
    20882073*/
    2089 inline void gcone::flip2(const ideal gb, facet *f)
     2074inline void gcone::flip2(const ideal &gb, facet *f)
    20902075{
    20912076#ifdef gfanp
     
    20962081        fNormal = f->getRef2FacetNormal();/*->getFacetNormal();*/       //read this->fNormal;
    20972082#ifdef gfan_DEBUG
    2098         std::cout << "flipping UCN " << this->getUCN();
    2099         cout << " over facet (";
     2083        printf("flipping UCN %i over facet(",this->getUCN());
    21002084        fNormal->show(1,0);
    2101         cout << ") with UCN " << f->getUCN();
    2102         std::cout << std::endl;
     2085        printf(") with UCN %i\n",f->getUCN()); 
    21032086#endif
    21042087        if(this->getUCN() != f->getUCN())
    2105         {       cout << this->getUCN() << " vs " << f->getUCN() << endl;
     2088        {       printf("%i vs %i\n",this->getUCN(), f->getUCN() );
    21062089                WerrorS("Uh oh... Trying to flip over facet with incompatible UCN");
    21072090                exit(-1);
     
    25502533//      if (err!=dd_NoError){WerrorS("Error during dd_CopyLPSolution");}
    25512534#ifdef gfan_DEBUG
    2552         cout << "Interior point: ";
     2535        printf("Interior point: ");
    25532536        for (int ii=1; ii<(lpSol->d)-1;ii++)
    25542537        {
    25552538                dd_WriteNumber(stdout,lpSol->sol[ii]);
    25562539        }
    2557         cout << endl;
     2540        printf("\n");
    25582541#endif                 
    25592542        //NOTE The following strongly resembles parts of makeInt.
     
    26142597*NOTE no longer used nor maintained. MM Mar 9, 2010
    26152598*/
    2616 void gcone::interiorPoint2()
    2617 {//idPrint(this->gcBasis);
    2618 #ifdef gfan_DEBUG
    2619         if(this->ivIntPt!=NULL)
    2620                 WarnS("Interior point already exists - ovrewriting!");
    2621 #endif
    2622         facet *f1 = this->facetPtr;
    2623         facet *f2 = NULL;
    2624         intvec *intF1=NULL;
    2625         while(f1!=NULL)
    2626         {
    2627                 if(f1->isFlippable)
    2628                 {
    2629                         facet *f1Ray = f1->codim2Ptr;
    2630                         while(f1Ray!=NULL)
    2631                         {
    2632                                 const intvec *check=f1Ray->getRef2FacetNormal();
    2633                                 if(iv64isStrictlyPositive(check))
    2634                                 {
    2635                                         intF1=ivCopy(check);
    2636                                         break;
    2637                                 }                               
    2638                                 f1Ray=f1Ray->next;
    2639                         }
    2640                 }
    2641                 if(intF1!=NULL)
    2642                         break;
    2643                 f1=f1->next;
    2644         }
    2645         if(f1!=NULL && f1->next!=NULL)//Choose another facet, different from f1
    2646                 f2=f1->next;
    2647         else
    2648                 f2=this->facetPtr;
    2649         if(intF1==NULL && hasHomInput==TRUE)
    2650         {
    2651                 intF1 = new intvec(this->numVars);
    2652                 for(int ii=0;ii<this->numVars;ii++)
    2653                         (*intF1)[ii]=1;
    2654         }
    2655         assert(f1); assert(f2);
    2656         intvec *intF2=f2->getInteriorPoint();
    2657         mpq_t *qPosRay = new mpq_t[this->numVars];//The positive ray from above
    2658         mpq_t *qIntPt = new mpq_t[this->numVars];//starting vector a+((b-a)/2)
    2659         mpq_t *qPosIntPt = new mpq_t[this->numVars];//This should be >0 eventually
    2660         for(int ii=0;ii<this->numVars;ii++)
    2661         {
    2662                 mpq_init(qPosRay[ii]);
    2663                 mpq_init(qIntPt[ii]);
    2664                 mpq_init(qPosIntPt[ii]);
    2665         }       
    2666         //Compute a+((b-a)/2) && Convert intF1 to mpq
    2667         for(int ii=0;ii<this->numVars;ii++)
    2668         {
    2669                 mpq_t a,b;
    2670                 mpq_init(a); mpq_init(b);
    2671                 mpq_set_si(a,(*intF1)[ii],1);
    2672                 mpq_set_si(b,(*intF2)[ii],1);
    2673                 mpq_t diff;
    2674                 mpq_init(diff);
    2675                 mpq_sub(diff,b,a);      //diff=b-a
    2676                 mpq_t quot;
    2677                 mpq_init(quot);
    2678                 mpq_div_2exp(quot,diff,1);      //quot=diff/2=(b-a)/2
    2679                 mpq_clear(diff);
    2680                 //Don't be clever and reuse diff here
    2681                 mpq_t sum; mpq_init(sum);
    2682                 mpq_add(sum,b,quot);    //sum=b+quot=a+(b-a)/2
    2683                 mpq_set(qIntPt[ii],sum);
    2684                 mpq_clear(sum);
    2685                 mpq_clear(quot);
    2686                 mpq_clear(a); mpq_clear(b);
    2687                 //Now for intF1
    2688                 mpq_set_si(qPosRay[ii],(*intF1)[ii],1);
    2689         }
    2690         //Now add: qPosIntPt=qPosRay+qIntPt until qPosIntPt >0
    2691         while(TRUE)
    2692         {       
    2693                 bool success=FALSE;
    2694                 int posCtr=0;   
    2695                 for(int ii=0;ii<this->numVars;ii++)
    2696                 {
    2697                         mpq_t sum; mpq_init(sum);
    2698                         mpq_add(sum,qPosRay[ii],qIntPt[ii]);
    2699                         mpq_set(qPosIntPt[ii],sum);
    2700                         mpq_clear(sum);
    2701                         if(mpq_sgn(qPosIntPt[ii])==1)
    2702                                 posCtr++;
    2703                 }
    2704                 if(posCtr==this->numVars)//qPosIntPt > 0
    2705                         break;
    2706                 else
    2707                 {
    2708                         mpq_t qTwo; mpq_init(qTwo);
    2709                         mpq_set_ui(qTwo,2,1);
    2710                         for(int jj=0;jj<this->numVars;jj++)
    2711                         {
    2712                                 mpq_t tmp; mpq_init(tmp);
    2713                                 mpq_mul(tmp,qPosRay[jj],qTwo);
    2714                                 mpq_set( qPosRay[jj], tmp);
    2715                                 mpq_clear(tmp);
    2716                         }
    2717                         mpq_clear(qTwo);
    2718                 }
    2719         }//while
    2720         //Now qPosIntPt ought to be >0, so convert back to int :D
    2721         /*Compute lcm of the denominators*/
    2722         mpz_t *denom = new mpz_t[this->numVars];
    2723         mpz_t tmp,kgV;
    2724         mpz_init(tmp); mpz_init(kgV);
    2725         for (int ii=0;ii<this->numVars;ii++)
    2726         {
    2727                 mpz_t z;
    2728                 mpz_init(z);
    2729                 mpq_get_den(z,qPosIntPt[ii]);
    2730                 mpz_init(denom[ii]);
    2731                 mpz_set( denom[ii], z);
    2732                 mpz_clear(z);                           
    2733         }
    2734                
    2735         mpz_set(tmp,denom[0]);
    2736         for (int ii=0;ii<this->numVars;ii++)
    2737         {
    2738                 mpz_lcm(kgV,tmp,denom[ii]);
    2739                 mpz_set(tmp,kgV);                               
    2740         }
    2741         mpz_clear(tmp);
    2742         /*Multiply the nominators by kgV*/
    2743         mpq_t qkgV,res;
    2744         mpq_init(qkgV);
    2745         mpq_canonicalize(qkgV);         
    2746         mpq_init(res);
    2747         mpq_canonicalize(res);
    2748                                
    2749         mpq_set_num(qkgV,kgV);
    2750         intvec *n=new intvec(this->numVars);
    2751         for (int ii=0;ii<this->numVars;ii++)
    2752         {
    2753                 mpq_canonicalize(qPosIntPt[ii]);
    2754                 mpq_mul(res,qkgV,qPosIntPt[ii]);
    2755                 (*n)[ii]=(int)mpz_get_d(mpq_numref(res));
    2756         }
    2757         this->setIntPoint(n);
    2758         delete n;
    2759         delete [] qPosIntPt;
    2760         delete [] denom;
    2761         delete [] qPosRay;
    2762         delete [] qIntPt;
    2763         mpz_clear(kgV);
    2764         mpq_clear(qkgV); mpq_clear(res);
    2765 }
     2599// void gcone::interiorPoint2()
     2600// {//idPrint(this->gcBasis);
     2601// #ifdef gfan_DEBUG
     2602//      if(this->ivIntPt!=NULL)
     2603//              WarnS("Interior point already exists - ovrewriting!");
     2604// #endif
     2605//      facet *f1 = this->facetPtr;
     2606//      facet *f2 = NULL;
     2607//      intvec *intF1=NULL;
     2608//      while(f1!=NULL)
     2609//      {
     2610//              if(f1->isFlippable)
     2611//              {
     2612//                      facet *f1Ray = f1->codim2Ptr;
     2613//                      while(f1Ray!=NULL)
     2614//                      {
     2615//                              const intvec *check=f1Ray->getRef2FacetNormal();
     2616//                              if(iv64isStrictlyPositive(check))
     2617//                              {
     2618//                                      intF1=ivCopy(check);
     2619//                                      break;
     2620//                              }                               
     2621//                              f1Ray=f1Ray->next;
     2622//                      }
     2623//              }
     2624//              if(intF1!=NULL)
     2625//                      break;
     2626//              f1=f1->next;
     2627//      }
     2628//      if(f1!=NULL && f1->next!=NULL)//Choose another facet, different from f1
     2629//              f2=f1->next;
     2630//      else
     2631//              f2=this->facetPtr;
     2632//      if(intF1==NULL && hasHomInput==TRUE)
     2633//      {
     2634//              intF1 = new intvec(this->numVars);
     2635//              for(int ii=0;ii<this->numVars;ii++)
     2636//                      (*intF1)[ii]=1;
     2637//      }
     2638//      assert(f1); assert(f2);
     2639//      intvec *intF2=f2->getInteriorPoint();
     2640//      mpq_t *qPosRay = new mpq_t[this->numVars];//The positive ray from above
     2641//      mpq_t *qIntPt = new mpq_t[this->numVars];//starting vector a+((b-a)/2)
     2642//      mpq_t *qPosIntPt = new mpq_t[this->numVars];//This should be >0 eventually
     2643//      for(int ii=0;ii<this->numVars;ii++)
     2644//      {
     2645//              mpq_init(qPosRay[ii]);
     2646//              mpq_init(qIntPt[ii]);
     2647//              mpq_init(qPosIntPt[ii]);
     2648//      }       
     2649//      //Compute a+((b-a)/2) && Convert intF1 to mpq
     2650//      for(int ii=0;ii<this->numVars;ii++)
     2651//      {
     2652//              mpq_t a,b;
     2653//              mpq_init(a); mpq_init(b);
     2654//              mpq_set_si(a,(*intF1)[ii],1);
     2655//              mpq_set_si(b,(*intF2)[ii],1);
     2656//              mpq_t diff;
     2657//              mpq_init(diff);
     2658//              mpq_sub(diff,b,a);      //diff=b-a
     2659//              mpq_t quot;
     2660//              mpq_init(quot);
     2661//              mpq_div_2exp(quot,diff,1);      //quot=diff/2=(b-a)/2
     2662//              mpq_clear(diff);
     2663//              //Don't be clever and reuse diff here
     2664//              mpq_t sum; mpq_init(sum);
     2665//              mpq_add(sum,b,quot);    //sum=b+quot=a+(b-a)/2
     2666//              mpq_set(qIntPt[ii],sum);
     2667//              mpq_clear(sum);
     2668//              mpq_clear(quot);
     2669//              mpq_clear(a); mpq_clear(b);
     2670//              //Now for intF1
     2671//              mpq_set_si(qPosRay[ii],(*intF1)[ii],1);
     2672//      }
     2673//      //Now add: qPosIntPt=qPosRay+qIntPt until qPosIntPt >0
     2674//      while(TRUE)
     2675//      {       
     2676//              bool success=FALSE;
     2677//              int posCtr=0;   
     2678//              for(int ii=0;ii<this->numVars;ii++)
     2679//              {
     2680//                      mpq_t sum; mpq_init(sum);
     2681//                      mpq_add(sum,qPosRay[ii],qIntPt[ii]);
     2682//                      mpq_set(qPosIntPt[ii],sum);
     2683//                      mpq_clear(sum);
     2684//                      if(mpq_sgn(qPosIntPt[ii])==1)
     2685//                              posCtr++;
     2686//              }
     2687//              if(posCtr==this->numVars)//qPosIntPt > 0
     2688//                      break;
     2689//              else
     2690//              {
     2691//                      mpq_t qTwo; mpq_init(qTwo);
     2692//                      mpq_set_ui(qTwo,2,1);
     2693//                      for(int jj=0;jj<this->numVars;jj++)
     2694//                      {
     2695//                              mpq_t tmp; mpq_init(tmp);
     2696//                              mpq_mul(tmp,qPosRay[jj],qTwo);
     2697//                              mpq_set( qPosRay[jj], tmp);
     2698//                              mpq_clear(tmp);
     2699//                      }
     2700//                      mpq_clear(qTwo);
     2701//              }
     2702//      }//while
     2703//      //Now qPosIntPt ought to be >0, so convert back to int :D
     2704//      /*Compute lcm of the denominators*/
     2705//      mpz_t *denom = new mpz_t[this->numVars];
     2706//      mpz_t tmp,kgV;
     2707//      mpz_init(tmp); mpz_init(kgV);
     2708//      for (int ii=0;ii<this->numVars;ii++)
     2709//      {
     2710//              mpz_t z;
     2711//              mpz_init(z);
     2712//              mpq_get_den(z,qPosIntPt[ii]);
     2713//              mpz_init(denom[ii]);
     2714//              mpz_set( denom[ii], z);
     2715//              mpz_clear(z);                           
     2716//      }
     2717//              
     2718//      mpz_set(tmp,denom[0]);
     2719//      for (int ii=0;ii<this->numVars;ii++)
     2720//      {
     2721//              mpz_lcm(kgV,tmp,denom[ii]);
     2722//              mpz_set(tmp,kgV);                               
     2723//      }
     2724//      mpz_clear(tmp);
     2725//      /*Multiply the nominators by kgV*/
     2726//      mpq_t qkgV,res;
     2727//      mpq_init(qkgV);
     2728//      mpq_canonicalize(qkgV);         
     2729//      mpq_init(res);
     2730//      mpq_canonicalize(res);
     2731//                              
     2732//      mpq_set_num(qkgV,kgV);
     2733//      intvec *n=new intvec(this->numVars);
     2734//      for (int ii=0;ii<this->numVars;ii++)
     2735//      {
     2736//              mpq_canonicalize(qPosIntPt[ii]);
     2737//              mpq_mul(res,qkgV,qPosIntPt[ii]);
     2738//              (*n)[ii]=(int)mpz_get_d(mpq_numref(res));
     2739//      }
     2740//      this->setIntPoint(n);
     2741//      delete n;
     2742//      delete [] qPosIntPt;
     2743//      delete [] denom;
     2744//      delete [] qPosRay;
     2745//      delete [] qIntPt;
     2746//      mpz_clear(kgV);
     2747//      mpq_clear(qkgV); mpq_clear(res);
     2748// }
    27662749       
    27672750/** \brief Copy a ring and add a weighted ordering in first place
     
    28462829               
    28472830//NOTE not needed anywhere
    2848 ring rCopyAndChangeWeight(ring const &r, intvec *ivw)
    2849 {
    2850         ring res=rCopy0(currRing);
    2851         rComplete(res);
    2852         rSetWeightVec(res,(int64*)ivw);
    2853         //rChangeCurrRing(rnew);
    2854         return res;
    2855 }
     2831// ring rCopyAndChangeWeight(ring const &r, intvec *ivw)
     2832// {
     2833//      ring res=rCopy0(currRing);
     2834//      rComplete(res);
     2835//      rSetWeightVec(res,(int64*)ivw);
     2836//      //rChangeCurrRing(rnew);
     2837//      return res;
     2838// }
    28562839               
    28572840/** \brief Checks whether a given facet is a search facet
     
    30303013       
    30313014#ifdef gfan_DEBUG
    3032         cout << "NoRevs" << endl;
    3033         cout << "Facets are:" << endl;
     3015        printf("NoRevs\n");
     3016        printf("Facets are:\n");
    30343017        gcAct->showFacets();
    30353018#endif                 
     
    32193202#ifdef gfan_DEBUG
    32203203                        if(SearchListRoot!=NULL)
    3221                                 gcTmp->showSLA(*SearchListRoot);
     3204                                showSLA(*SearchListRoot);
    32223205#endif                 
    32233206                        rChangeCurrRing(gcAct->baseRing);
     
    33013284                SearchListAct = SearchListRoot;
    33023285        }
    3303         cout << endl << "Found " << counter << " cones - terminating" << endl;
     3286        printf("\nFound %i cones - terminating\n", counter);
    33043287}//void noRevS(gcone &gc)       
    33053288               
     
    35333516                                slNormal = slAct->getFacetNormal();
    35343517#ifdef gfan_DEBUG
    3535                                 cout << "Checking facet (";fNormal->show(1,1);cout << ") against (";slNormal->show(1,1);cout << ")" << endl;
     3518                                printf("Checking facet (");fNormal->show(1,1);printf(") against (");slNormal->show(1,1);printf(")\n");
    35363519#endif                         
    35373520//                              if( (areEqual(fAct,slAct) && (!areEqual2(fAct,slAct)) ))
     
    35643547                                        }
    35653548#ifdef gfan_DEBUG
    3566                                         cout << "Removing (";fNormal->show(1,1);cout << ") from list" << endl;
     3549                                        printf("Removing (");fNormal->show(1,1);printf(") from list\n");
    35673550#endif
    35683551                                        delete slNormal;
     
    37143697                                removalOccured=FALSE;
    37153698#ifdef gfan_DEBUG
    3716 cout << "Checking facet (";fAct->fNormal->show(1,1);cout << ") against (";slAct->fNormal->show(1,1);cout << ")" << endl;
     3699        printf("Checking facet (");fAct->fNormal->show(1,1);printf(") against (");slAct->fNormal->show(1,1);printf(")\n");
    37173700#endif 
    37183701                                if(areEqual2(fAct,slAct))
     
    37383721                                        gcone::lengthOfSearchList--;
    37393722#ifdef gfan_DEBUG
    3740 cout << "Removing (";fAct->fNormal->show(1,1);cout << ") from list" << endl;
     3723printf("Removing (");fAct->fNormal->show(1,1);printf(") from list");
    37413724#endif
    37423725                                        fDeleteMarker->shallowDelete();//Sets everything to NULL
     
    38483831 * NO LONGER USED
    38493832 */
    3850 inline dd_MatrixPtr gcone::facets2Matrix(const gcone &gc)
    3851 {
    3852         facet *fAct;
    3853         fAct = gc.facetPtr;
    3854        
    3855         dd_MatrixPtr M;
    3856         dd_rowrange ddrows;
    3857         dd_colrange ddcols;
    3858         ddcols=(this->numVars)+1;
    3859         ddrows=this->numFacets;
    3860         dd_NumberType numb = dd_Integer;
    3861         M=dd_CreateMatrix(ddrows,ddcols);                       
    3862                        
    3863         int jj=0;
    3864        
    3865         while(fAct!=NULL)
    3866         {
    3867                 intvec *comp;
    3868                 comp = fAct->getFacetNormal();
    3869                 for(int ii=0;ii<this->numVars;ii++)
    3870                 {
    3871                         dd_set_si(M->matrix[jj][ii+1],(*comp)[ii]);
    3872                 }
    3873                 jj++;
    3874                 delete comp;
    3875                 fAct=fAct->next;                               
    3876         }                       
    3877         return M;
    3878 }
     3833// inline dd_MatrixPtr gcone::facets2Matrix(const gcone &gc)
     3834// {
     3835//      facet *fAct;
     3836//      fAct = gc.facetPtr;
     3837//      
     3838//      dd_MatrixPtr M;
     3839//      dd_rowrange ddrows;
     3840//      dd_colrange ddcols;
     3841//      ddcols=(this->numVars)+1;
     3842//      ddrows=this->numFacets;
     3843//      dd_NumberType numb = dd_Integer;
     3844//      M=dd_CreateMatrix(ddrows,ddcols);                       
     3845//                      
     3846//      int jj=0;
     3847//      
     3848//      while(fAct!=NULL)
     3849//      {
     3850//              intvec *comp;
     3851//              comp = fAct->getFacetNormal();
     3852//              for(int ii=0;ii<this->numVars;ii++)
     3853//              {
     3854//                      dd_set_si(M->matrix[jj][ii+1],(*comp)[ii]);
     3855//              }
     3856//              jj++;
     3857//              delete comp;
     3858//              fAct=fAct->next;                               
     3859//      }                       
     3860//      return M;
     3861// }
    38793862               
    38803863/** \brief Write information about a cone into a file on disk
     
    39203903        if (!gcOutputFile)
    39213904        {
    3922                 cout << "Error opening file for writing in writeConeToFile" << endl;
     3905                WerrorS("Error opening file for writing in writeConeToFile\n");
    39233906        }
    39243907        else
     
    43444327float gcone::t_markings;
    43454328float gcone::t_dd;
    4346 float gcone::t_kStd;
     4329float gcone::t_kStd=0;
    43474330float gcone::time_enqueue;
    43484331float gcone::time_computeInv;
     
    44094392                        {//FIXME
    44104393                                WerrorS("Monomial input - terminating");
    4411                                 lResList->Init(1);
    4412 //                              exit(-1);
    4413 //                              gcAct->getConeNormals(gcAct->gcBasis);
    4414 //                              lResList=lprepareResult(gcAct,1);
    44154394                                dd_free_global_constants();
    44164395                                //This is filthy
    4417                                 return lResList;
     4396                                goto pointOfNoReturn;
     4397                                //return lResList;
    44184398                        }                       
    44194399                        gcAct->getConeNormals(gcAct->gcBasis);
     
    44224402                        gcAct->noRevS(*gcAct);  //Here we go!
    44234403                        //Switch back to the ring the computation was started in
    4424 //                      rChangeCurrRing(inputRing);
     4404                        //rChangeCurrRing(inputRing);
    44254405                        //res=gcAct->gcBasis;
    4426                         //Below is a workaround, since gcAct->gcBasis gets deleted in noRevS
    4427 //                      res = inputIdeal;
     4406                        //Below is a workaround, since gcAct->gcBasis gets deleted in noRevS                   
    44284407                        lResList=lprepareResult(gcRoot,gcRoot->getCounter());
    44294408                        /*Cleanup*/
     
    44444423        {
    44454424                //Simply return an empty list
    4446                 WerrorS("Ring has non-global ordering - terminating");
    4447                 lResList->Init(1);
    4448 //              lResList->m[0].rtyp=INT_CMD;
    4449 //              int ires=0;
    4450 //              lResList->m[0].data=(void*)&ires;
    4451         }
    4452         //gcone::counter=0;
     4425                WerrorS("Ring has non-global ordering.\nThis function requires your current ring to be endowed with a global ordering.\n Now terminating!");
     4426                goto pointOfNoReturn;
     4427        }
    44534428        /*Return result*/
    44544429#ifdef gfanp
     
    44754450        cout << " out of which there were " << gcone::parallelButNotEqual << " parallel but not equal." << endl;
    44764451#endif
    4477         cout << "Maximum lenght of list of facets: " << gcone::maxSize << endl;
    4478 
     4452        printf("Maximum lenght of list of facets: %i", gcone::maxSize);
     4453pointOfNoReturn:
    44794454        return lResList;
    44804455}
  • kernel/gfan.h

    r706b89 r11a7dc  
    6565                unsigned numRays;       //Number of spanning rays of the facet
    6666                ring flipRing;          //the ring on the other side of the facet
    67                 intvec **fRays;
     67//              intvec **fRays;
    6868                               
    6969                /** The default constructor. */
     
    223223                void getExtremalRays(const gcone &gc);
    224224                void flip(ideal gb, facet *f);
    225                 void flip2(const ideal gb, facet *f);
     225                void flip2(const ideal &gb, facet *f);
    226226                void computeInv(const ideal &gb, ideal &inv, const intvec &f);
    227227                //poly restOfDiv(poly const &f, ideal const &I); removed with r12286
    228228                inline ideal ffG(const ideal &H, const ideal &G);
    229229                inline void getGB(ideal const &inputIdeal);             
    230                 void interiorPoint( dd_MatrixPtr &M, intvec &iv);
    231                 void interiorPoint2(); //removed Feb 8th, 2010, new method Feb 19th, 2010
     230                void interiorPoint( dd_MatrixPtr &M, intvec &iv);//used from flip and optionally from getConeNormals
     231//              void interiorPoint2(); //removed Feb 8th, 2010, new method Feb 19th, 2010, again removed Mar 16th, 2010
    232232                void preprocessInequalities(dd_MatrixPtr &M);
    233233                ring rCopyAndAddWeight(const ring &r, intvec *ivw);
    234234                ring rCopyAndAddWeight2(const ring &, const intvec *, const intvec *);
    235                 ring rCopyAndChangeWeight(const ring &r, intvec *ivw);         
     235//              ring rCopyAndChangeWeight(const ring &r, intvec *ivw);  //NOTE remove   
    236236//              void reverseSearch(gcone *gcAct); //NOTE both removed from r12286
    237 //              bool isSearchFacet(gcone &gcTmp, facet *testfacet);
    238 //              void noRevS(gcone &gcRoot, bool usingIntPoint=FALSE);
     237//              bool isSearchFacet(gcone &gcTmp, facet *testfacet); //NOTE remove
    239238                void makeInt(const dd_MatrixPtr &M, const int line, intvec &n);
    240 //              void normalize();
     239//              void normalize();//NOTE REMOVE
    241240                facet * enqueueNewFacets(facet *f);
    242241                facet * enqueue2(facet *f);
    243                 dd_MatrixPtr facets2Matrix(const gcone &gc);
     242//              dd_MatrixPtr facets2Matrix(const gcone &gc);//NOTE remove
    244243                /** Compute the lineality space Ax=0 and return it as dd_MatrixPtr dd_LinealitySpace*/
    245244                dd_MatrixPtr computeLinealitySpace();
Note: See TracChangeset for help on using the changeset viewer.