Changeset 94aed9 in git
- Timestamp:
- Jul 15, 2009, 11:49:09 AM (14 years ago)
- Branches:
- (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
- Children:
- d4f44f4f228fbb8258ce8e9927141d37d4470719
- Parents:
- 7ae94bb7c3176ec1860c1447b4e220578a2affa3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
r7ae94b r94aed9 2 2 Compute the Groebner fan of an ideal 3 3 $Author: monerjan $ 4 $Date: 2009-07-1 3 09:03:37$5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.7 6 2009-07-13 09:03:37monerjan Exp $6 $Id: gfan.cc,v 1.7 6 2009-07-13 09:03:37monerjan Exp $4 $Date: 2009-07-15 09:49:09 $ 5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.77 2009-07-15 09:49:09 monerjan Exp $ 6 $Id: gfan.cc,v 1.77 2009-07-15 09:49:09 monerjan Exp $ 7 7 */ 8 8 … … 656 656 ddFacets = dd_CopyMatrix(ddineq); 657 657 #ifdef gfan_DEBUG 658 cout << "Having removed redundancies, the normals now read:" << endl;659 dd_WriteMatrix(stdout,ddineq);658 // cout << "Having removed redundancies, the normals now read:" << endl; 659 // dd_WriteMatrix(stdout,ddineq); 660 660 // cout << "Rows = " << ddrows << endl; 661 661 // cout << "Cols = " << ddcols << endl; … … 664 664 /*Write the normals into class facet*/ 665 665 #ifdef gfan_DEBUG 666 cout << "Creating list of normals" << endl;666 // cout << "Creating list of normals" << endl; 667 667 #endif 668 668 /*The pointer *fRoot should be the return value of this function*/ … … 673 673 //fAct = fRoot; //Seems to do the trick. fRoot and fAct have to point to the same adress! 674 674 //std::cout << "fRoot = " << fRoot << ", fAct = " << fAct << endl; 675 int numNonFlip=0; 675 676 for (int kk = 0; kk<ddrows; kk++) 676 677 { … … 687 688 688 689 /*Quick'n'dirty hack for flippability*/ 689 bool isFlip=FALSE; 690 bool isFlip=FALSE; 691 690 692 for (int jj = 0; jj<load->length(); jj++) 691 693 { … … 703 705 { 704 706 this->numFacets++; 707 numNonFlip++; 705 708 if(this->numFacets==1) 706 709 { … … 742 745 fAct->setUCN(this->getUCN()); 743 746 }//if (isFlippable==FALSE) 744 //delete load; 747 //delete load; 745 748 }//for (int kk = 0; kk<ddrows; kk++) 749 750 //In cases like I=<x-1,y-1> there are only non-flippable facets... 751 if(numNonFlip==this->numFacets) 752 { 753 cerr << "Only non-flippable facets. Terminating..." << endl; 754 } 746 755 747 756 /* … … 799 808 /*Now set appropriate linearity*/ 800 809 dd_PolyhedraPtr ddpolyh; 801 for (int ii=0; ii<this->numFacets; ii++) 802 //while(fAct!=NULL) 810 for (int ii=0; ii<this->numFacets; ii++) 803 811 { 804 812 ddakt = dd_CopyMatrix(ddineq); … … 840 848 codim2Act->setFacetNormal(n); 841 849 delete n; 842 /*intvec *n = new intvec(this->numVars); 843 makeInt(P,jj,*n); 844 codim2Act->setFacetNormal(n); 845 this->facetPtr->numCodim2Facets++; //Honor the creation of a codim-2-facet 846 codim2Act->next = new facet(2); 847 codim2Act = codim2Act->next; 848 delete n;*/ 849 } 850 } 851 /*We check whether the facet spanned by the codim-2 facets 852 * intersects with the positive orthant. Otherwise we define this 853 * facet to be non-flippable 854 */ 855 intvec *iv_intPoint = new intvec(this->numVars); 856 dd_MatrixPtr shiftMatrix; 857 dd_MatrixPtr intPointMatrix; 858 shiftMatrix = dd_CreateMatrix(this->numVars,this->numVars+1); 859 for(int kk=0;kk<this->numVars;kk++) 860 { 861 dd_set_si(shiftMatrix->matrix[kk][0],1); 862 dd_set_si(shiftMatrix->matrix[kk][kk+1],1); 863 } 864 intPointMatrix=dd_MatrixAppend(ddakt,shiftMatrix); 865 //dd_WriteMatrix(stdout,intPointMatrix); 866 interiorPoint(intPointMatrix,*iv_intPoint); 867 for(int ll=0;ll<this->numVars;ll++) 868 { 869 if( (*iv_intPoint)[ll] < 0 ) 870 { 871 fAct->isFlippable=FALSE; 872 break; 873 } 874 } 875 /*End of check*/ 850 876 fAct = fAct->next; 851 877 dd_FreeMatrix(ddakt); … … 972 998 ina=idrCopyR(initialForm,srcRing); 973 999 #ifdef gfan_DEBUG 974 cout << "ina=";975 idShow(ina); cout << endl;1000 // cout << "ina="; 1001 // idShow(ina); cout << endl; 976 1002 #endif 977 1003 ideal H; … … 980 1006 idSkipZeroes(H); 981 1007 #ifdef gfan_DEBUG 982 cout << "H="; idShow(H); cout << endl;1008 // cout << "H="; idShow(H); cout << endl; 983 1009 #endif 984 1010 /*Substep 2.2 … … 990 1016 srcRing_H=idrCopyR(H,tmpRing); 991 1017 #ifdef gfan_DEBUG 992 cout << "srcRing_H = ";993 idShow(srcRing_H); cout << endl;1018 // cout << "srcRing_H = "; 1019 // idShow(srcRing_H); cout << endl; 994 1020 #endif 995 1021 srcRing_HH=ffG(srcRing_H,this->gcBasis); 996 1022 #ifdef gfan_DEBUG 997 cout << "srcRing_HH = ";998 idShow(srcRing_HH); cout << endl;1023 // cout << "srcRing_HH = "; 1024 // idShow(srcRing_HH); cout << endl; 999 1025 #endif 1000 1026 /*Substep 2.2.1 … … 1019 1045 construction of the differences 1020 1046 */ 1021 intPointMatrix = dd_CreateMatrix(iPMatrixRows+ 2,this->numVars+1);1047 intPointMatrix = dd_CreateMatrix(iPMatrixRows+10,this->numVars+1); 1022 1048 intPointMatrix->numbtype=dd_Integer; //NOTE: DO NOT REMOVE OR CHANGE TO dd_Rational 1023 1049 … … 1329 1355 1330 1356 /** \brief Compute an interior point of a given cone 1331 * Result will be written into intvec iv 1357 * Result will be written into intvec iv. 1358 * Any rational point is automatically converted into an integer. 1332 1359 */ 1333 1360 void interiorPoint(dd_MatrixPtr const &M, intvec &iv) //no const &M here since we want to remove redundant rows … … 1758 1785 1759 1786 fAct = gcAct->facetPtr; 1760 gcAct->writeConeToFile(*gcAct);1787 //gcAct->writeConeToFile(*gcAct); 1761 1788 1762 1789 /*End of initialisation*/ … … 1781 1808 gcTmp->getCodim2Normals(*gcTmp); 1782 1809 gcTmp->normalize(); 1783 gcTmp->writeConeToFile(*gcTmp);1810 //gcTmp->writeConeToFile(*gcTmp); 1784 1811 /*add facets to SLA here*/ 1785 1812 SearchListRoot=gcTmp->enqueueNewFacets(*SearchListRoot); 1786 gcTmp->showSLA(*SearchListRoot); 1813 if(SearchListRoot!=NULL) 1814 gcTmp->showSLA(*SearchListRoot); 1787 1815 rChangeCurrRing(gcAct->baseRing); 1788 1816 gcPtr->next=gcTmp; … … 1814 1842 SearchListAct = SearchListRoot; 1815 1843 } 1844 cout << endl << "Found " << counter << " cones - terminating" << endl; 1816 1845 1817 1846 //NOTE Hm, comment in and get a crash for free... … … 2038 2067 { 2039 2068 slHead = slAct->next; 2040 slHead->prev = NULL; 2069 if(slHead!=NULL) 2070 slHead->prev = NULL; 2041 2071 //set a bool flag to mark slAct as to be deleted 2042 2072 }
Note: See TracChangeset
for help on using the changeset viewer.