Changeset 11a7dc in git
- Timestamp:
- Mar 16, 2010, 6:38:44 PM (13 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- f524fdf7562a563db23199898e1aa3b16a4619bc
- Parents:
- 706b890c390993bb14ed93acf3c4b09775b93361
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
r706b89 r11a7dc 25 25 #include "prCopy.h" //Needed for idrCopyR 26 26 #include "stairc.h" //For Hilbert series 27 #include <iostream>28 27 // #include <bitset> 29 28 #include <fstream> //read-write cones to files … … 77 76 //NOTE Defining this will slow things down! 78 77 //Only good for very coarse profiling 79 //#define gfanp78 #define gfanp 80 79 #ifdef gfanp 81 80 #include <sys/time.h> 81 #include <iostream> 82 82 #endif 83 83 … … 201 201 { 202 202 #ifdef gfan_DEBUG 203 cout << "shallowdel@UCN " << this->getUCN() << endl;203 printf("shallowdel@UCN %i\n", this->getUCN()); 204 204 #endif 205 205 this->fNormal=NULL; … … 219 219 { 220 220 #ifdef gfan_DEBUG 221 cout << "~facet@UCN " << this->getUCN() << endl;221 printf("~facet@UCN %i\n",this->getUCN()); 222 222 #endif 223 223 if(this->fNormal!=NULL) … … 279 279 #ifdef gfanp 280 280 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)); 282 282 #endif 283 283 return res; … … 357 357 #ifdef gfanp 358 358 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)); 360 360 #endif 361 361 return res; … … 506 506 intvec *fNormal; 507 507 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"); 514 512 while(codim2Act!=NULL) 515 513 { 516 514 intvec *f2Normal; 517 515 f2Normal = codim2Act->getFacetNormal(); 518 cout << "("; 519 f2Normal->show(1,0); 520 cout << ")" << endl; 516 printf("(");f2Normal->show(1,0);printf(")\n"); 521 517 codim2Act = codim2Act->next; 522 518 delete f2Normal; 523 519 } 524 cout << "=======================" << endl;520 printf("=======================\n"); 525 521 delete fNormal; 526 522 } … … 687 683 intvec *iv; 688 684 iv = f->getFacetNormal(); 689 cout << "("; 690 iv->show(1,0); 685 printf("(");iv->show(1,0); 691 686 if(f->isFlippable==FALSE) 692 cout << ")* ";687 printf(")* "); 693 688 else 694 cout << ") ";689 printf(") "); 695 690 delete iv; 696 691 if(codim==2) … … 699 694 while(f2!=NULL) 700 695 { 701 cout << "["; 702 f2->getFacetNormal()->show(1,0); 703 cout << "]"; 696 printf("[");f2->getFacetNormal()->show(1,0);printf("]"); 704 697 f2 = f2->next; 705 698 } 706 cout << endl;699 printf("\n"); 707 700 } 708 701 f=f->next; 709 702 } 710 cout << endl;703 printf("\n"); 711 704 } 712 705 … … 721 714 codim2Act = fAct->codim2Ptr; 722 715 723 cout << endl;716 printf("\n"); 724 717 while(fAct!=NULL) 725 718 { 726 719 intvec *fNormal; 727 720 fNormal=fAct->getFacetNormal(); 728 cout << "("; 729 fNormal->show(1,0); 721 printf("(");fNormal->show(1,0); 730 722 if(fAct->isFlippable==TRUE) 731 cout << ") ";723 printf(") "); 732 724 else 733 cout << ")* ";725 printf(")* "); 734 726 delete fNormal; 735 727 codim2Act = fAct->codim2Ptr; 736 cout << " Codim2: ";728 printf(" Codim2: "); 737 729 while(codim2Act!=NULL) 738 730 { 739 731 intvec *f2Normal; 740 732 f2Normal = codim2Act->getFacetNormal(); 741 cout << "("; 742 f2Normal->show(1,0); 743 cout << ") "; 733 printf("(");f2Normal->show(1,0);printf(") "); 744 734 delete f2Normal; 745 735 codim2Act = codim2Act->next; 746 736 } 747 cout << "UCN = " << fAct->getUCN() << endl;737 printf("UCN = %i",fAct->getUCN()); 748 738 fAct = fAct->next; 749 739 } … … 754 744 { 755 745 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: "); 758 748 for (int ii=0;ii<numElts;ii++) 759 749 { 760 750 pWrite0(pHead(I->m[ii])); 761 cout << ",";762 } 763 cout << endl;751 printf(","); 752 } 753 printf("\n"); 764 754 } 765 755 … … 1124 1114 fAct->setUCN(this->getUCN()); 1125 1115 #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"); 1129 1117 #endif 1130 1118 } … … 1721 1709 #ifdef gfan_DEBUG 1722 1710 // 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()); 1725 1712 fNormal->show(1,0); 1726 cout << ") with UCN " << f->getUCN(); 1727 std::cout << std::endl; 1713 printf(") with UCN %i\n",f->getUCN() ); 1728 1714 #endif 1729 1715 if(this->getUCN() != f->getUCN()) … … 2058 2044 f->flipRing=rCopy(dstRing); //store the ring on the other side 2059 2045 #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"); 2064 2049 #endif 2065 2050 idDelete(&dstRing_I); … … 2087 2072 * Is there a way to construct a vector from \f$ \omega \f$ and the facet normal? 2088 2073 */ 2089 inline void gcone::flip2(const ideal gb, facet *f)2074 inline void gcone::flip2(const ideal &gb, facet *f) 2090 2075 { 2091 2076 #ifdef gfanp … … 2096 2081 fNormal = f->getRef2FacetNormal();/*->getFacetNormal();*/ //read this->fNormal; 2097 2082 #ifdef gfan_DEBUG 2098 std::cout << "flipping UCN " << this->getUCN(); 2099 cout << " over facet ("; 2083 printf("flipping UCN %i over facet(",this->getUCN()); 2100 2084 fNormal->show(1,0); 2101 cout << ") with UCN " << f->getUCN(); 2102 std::cout << std::endl; 2085 printf(") with UCN %i\n",f->getUCN()); 2103 2086 #endif 2104 2087 if(this->getUCN() != f->getUCN()) 2105 { cout << this->getUCN() << " vs " << f->getUCN() << endl;2088 { printf("%i vs %i\n",this->getUCN(), f->getUCN() ); 2106 2089 WerrorS("Uh oh... Trying to flip over facet with incompatible UCN"); 2107 2090 exit(-1); … … 2550 2533 // if (err!=dd_NoError){WerrorS("Error during dd_CopyLPSolution");} 2551 2534 #ifdef gfan_DEBUG 2552 cout << "Interior point: ";2535 printf("Interior point: "); 2553 2536 for (int ii=1; ii<(lpSol->d)-1;ii++) 2554 2537 { 2555 2538 dd_WriteNumber(stdout,lpSol->sol[ii]); 2556 2539 } 2557 cout << endl;2540 printf("\n"); 2558 2541 #endif 2559 2542 //NOTE The following strongly resembles parts of makeInt. … … 2614 2597 *NOTE no longer used nor maintained. MM Mar 9, 2010 2615 2598 */ 2616 void gcone::interiorPoint2()2617 {//idPrint(this->gcBasis);2618 #ifdef gfan_DEBUG2619 if(this->ivIntPt!=NULL)2620 WarnS("Interior point already exists - ovrewriting!");2621 #endif2622 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 f12646 f2=f1->next;2647 else2648 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 above2658 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 eventually2660 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 mpq2667 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-a2676 mpq_t quot;2677 mpq_init(quot);2678 mpq_div_2exp(quot,diff,1); //quot=diff/2=(b-a)/22679 mpq_clear(diff);2680 //Don't be clever and reuse diff here2681 mpq_t sum; mpq_init(sum);2682 mpq_add(sum,b,quot); //sum=b+quot=a+(b-a)/22683 mpq_set(qIntPt[ii],sum);2684 mpq_clear(sum);2685 mpq_clear(quot);2686 mpq_clear(a); mpq_clear(b);2687 //Now for intF12688 mpq_set_si(qPosRay[ii],(*intF1)[ii],1);2689 }2690 //Now add: qPosIntPt=qPosRay+qIntPt until qPosIntPt >02691 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 > 02705 break;2706 else2707 {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 }//while2720 //Now qPosIntPt ought to be >0, so convert back to int :D2721 /*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 // } 2766 2749 2767 2750 /** \brief Copy a ring and add a weighted ordering in first place … … 2846 2829 2847 2830 //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 // } 2856 2839 2857 2840 /** \brief Checks whether a given facet is a search facet … … 3030 3013 3031 3014 #ifdef gfan_DEBUG 3032 cout << "NoRevs" << endl;3033 cout << "Facets are:" << endl;3015 printf("NoRevs\n"); 3016 printf("Facets are:\n"); 3034 3017 gcAct->showFacets(); 3035 3018 #endif … … 3219 3202 #ifdef gfan_DEBUG 3220 3203 if(SearchListRoot!=NULL) 3221 gcTmp->showSLA(*SearchListRoot);3204 showSLA(*SearchListRoot); 3222 3205 #endif 3223 3206 rChangeCurrRing(gcAct->baseRing); … … 3301 3284 SearchListAct = SearchListRoot; 3302 3285 } 3303 cout << endl << "Found " << counter << " cones - terminating" << endl;3286 printf("\nFound %i cones - terminating\n", counter); 3304 3287 }//void noRevS(gcone &gc) 3305 3288 … … 3533 3516 slNormal = slAct->getFacetNormal(); 3534 3517 #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"); 3536 3519 #endif 3537 3520 // if( (areEqual(fAct,slAct) && (!areEqual2(fAct,slAct)) )) … … 3564 3547 } 3565 3548 #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"); 3567 3550 #endif 3568 3551 delete slNormal; … … 3714 3697 removalOccured=FALSE; 3715 3698 #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"); 3717 3700 #endif 3718 3701 if(areEqual2(fAct,slAct)) … … 3738 3721 gcone::lengthOfSearchList--; 3739 3722 #ifdef gfan_DEBUG 3740 cout << "Removing (";fAct->fNormal->show(1,1);cout << ") from list" << endl;3723 printf("Removing (");fAct->fNormal->show(1,1);printf(") from list"); 3741 3724 #endif 3742 3725 fDeleteMarker->shallowDelete();//Sets everything to NULL … … 3848 3831 * NO LONGER USED 3849 3832 */ 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 // } 3879 3862 3880 3863 /** \brief Write information about a cone into a file on disk … … 3920 3903 if (!gcOutputFile) 3921 3904 { 3922 cout << "Error opening file for writing in writeConeToFile" << endl;3905 WerrorS("Error opening file for writing in writeConeToFile\n"); 3923 3906 } 3924 3907 else … … 4344 4327 float gcone::t_markings; 4345 4328 float gcone::t_dd; 4346 float gcone::t_kStd ;4329 float gcone::t_kStd=0; 4347 4330 float gcone::time_enqueue; 4348 4331 float gcone::time_computeInv; … … 4409 4392 {//FIXME 4410 4393 WerrorS("Monomial input - terminating"); 4411 lResList->Init(1);4412 // exit(-1);4413 // gcAct->getConeNormals(gcAct->gcBasis);4414 // lResList=lprepareResult(gcAct,1);4415 4394 dd_free_global_constants(); 4416 4395 //This is filthy 4417 return lResList; 4396 goto pointOfNoReturn; 4397 //return lResList; 4418 4398 } 4419 4399 gcAct->getConeNormals(gcAct->gcBasis); … … 4422 4402 gcAct->noRevS(*gcAct); //Here we go! 4423 4403 //Switch back to the ring the computation was started in 4424 //rChangeCurrRing(inputRing);4404 //rChangeCurrRing(inputRing); 4425 4405 //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 4428 4407 lResList=lprepareResult(gcRoot,gcRoot->getCounter()); 4429 4408 /*Cleanup*/ … … 4444 4423 { 4445 4424 //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 } 4453 4428 /*Return result*/ 4454 4429 #ifdef gfanp … … 4475 4450 cout << " out of which there were " << gcone::parallelButNotEqual << " parallel but not equal." << endl; 4476 4451 #endif 4477 cout << "Maximum lenght of list of facets: " << gcone::maxSize << endl;4478 4452 printf("Maximum lenght of list of facets: %i", gcone::maxSize); 4453 pointOfNoReturn: 4479 4454 return lResList; 4480 4455 } -
kernel/gfan.h
r706b89 r11a7dc 65 65 unsigned numRays; //Number of spanning rays of the facet 66 66 ring flipRing; //the ring on the other side of the facet 67 intvec **fRays;67 // intvec **fRays; 68 68 69 69 /** The default constructor. */ … … 223 223 void getExtremalRays(const gcone &gc); 224 224 void flip(ideal gb, facet *f); 225 void flip2(const ideal gb, facet *f);225 void flip2(const ideal &gb, facet *f); 226 226 void computeInv(const ideal &gb, ideal &inv, const intvec &f); 227 227 //poly restOfDiv(poly const &f, ideal const &I); removed with r12286 228 228 inline ideal ffG(const ideal &H, const ideal &G); 229 229 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, 2010230 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 232 232 void preprocessInequalities(dd_MatrixPtr &M); 233 233 ring rCopyAndAddWeight(const ring &r, intvec *ivw); 234 234 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 236 236 // 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 239 238 void makeInt(const dd_MatrixPtr &M, const int line, intvec &n); 240 // void normalize(); 239 // void normalize();//NOTE REMOVE 241 240 facet * enqueueNewFacets(facet *f); 242 241 facet * enqueue2(facet *f); 243 dd_MatrixPtr facets2Matrix(const gcone &gc); 242 // dd_MatrixPtr facets2Matrix(const gcone &gc);//NOTE remove 244 243 /** Compute the lineality space Ax=0 and return it as dd_MatrixPtr dd_LinealitySpace*/ 245 244 dd_MatrixPtr computeLinealitySpace();
Note: See TracChangeset
for help on using the changeset viewer.