Changeset 7379a77 in git


Ignore:
Timestamp:
Jul 1, 2009, 11:41:00 AM (14 years ago)
Author:
Martin Monerjan
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
Children:
c4c127743ed450cab07372ff8921b84b9a15e6db
Parents:
2126c0d13d7a85352b229c0bd8232fb6cd6d726d
Message:
Bugfix codim2 computation


git-svn-id: file:///usr/local/Singular/svn/trunk@11925 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    r2126c0d r7379a77  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-06-29 14:46:58 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.68 2009-06-29 14:46:58 monerjan Exp $
    6 $Id: gfan.cc,v 1.68 2009-06-29 14:46:58 monerjan Exp $
     4$Date: 2009-07-01 09:41:00 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.69 2009-07-01 09:41:00 monerjan Exp $
     6$Id: gfan.cc,v 1.69 2009-07-01 09:41:00 monerjan Exp $
    77*/
    88
     
    587587
    588588#ifdef gfan_DEBUG
    589                         cout << "The inequality matrix is" << endl;
    590                         dd_WriteMatrix(stdout, ddineq);
     589//                      cout << "The inequality matrix is" << endl;
     590//                      dd_WriteMatrix(stdout, ddineq);
    591591#endif
    592592
     
    608608                        ddcols = ddineq->colsize;
    609609#ifdef gfan_DEBUG
    610                         cout << "Having removed redundancies, the normals now read:" << endl;
    611                         dd_WriteMatrix(stdout,ddineq);
    612                         cout << "Rows = " << ddrows << endl;
    613                         cout << "Cols = " << ddcols << endl;
     610//                      cout << "Having removed redundancies, the normals now read:" << endl;
     611//                      dd_WriteMatrix(stdout,ddineq);
     612//                      cout << "Rows = " << ddrows << endl;
     613//                      cout << "Cols = " << ddcols << endl;
    614614#endif
    615615                       
     
    655655                                {
    656656#ifdef gfan_DEBUG
    657                                         cout << "Ignoring facet";
     657                                        cout << "Ignoring facet" << endl;
    658658                                        load->show();
     659                                        cout << endl;
    659660                                        //fAct->next=NULL;
    660661#endif
     
    721722                void getCodim2Normals(gcone const &gc)
    722723                {
    723                         //this->facetPtr->codim2Ptr = new facet(2);     //instantiate a (codim-2)-facet                 
     724                        //this->facetPtr->codim2Ptr = new facet(2);     //instantiate a (codim-2)-facet
     725                        facet *fAct;
     726                        fAct = this->facetPtr;         
    724727                        facet *codim2Act;
    725728                        //codim2Act = this->facetPtr->codim2Ptr;
     
    737740                        dd_PolyhedraPtr ddpolyh;
    738741                        for (int ii=0; ii<this->numFacets; ii++)
     742                        //while(fAct!=NULL)
    739743                        {                               
    740744                                ddakt = dd_CopyMatrix(ddineq);
     
    750754                                P=dd_CopyGenerators(ddpolyh);
    751755#ifdef gfan_DEBUG
    752 //                              dd_WriteMatrix(stdout,P);
     756//                              cout << "Codim2 facet:" << endl;
     757//                              dd_WriteMatrix(stdout,P);
     758//                              cout << endl;
    753759#endif
    754760                                       
     
    759765                                for (int jj=1;jj<=P->rowsize;jj++)
    760766                                {
    761                                         this->facetPtr->numCodim2Facets++;
    762                                         if(this->facetPtr->numCodim2Facets==1)
     767                                        //this->facetPtr->numCodim2Facets++;
     768                                        fAct->numCodim2Facets++;
     769                                        if(fAct->numCodim2Facets==1)
     770                                        //if(this->facetPtr->numCodim2Facets==1)                                       
    763771                                        {
    764                                                 this->facetPtr->codim2Ptr = new facet(2);
    765                                                 codim2Act = this->facetPtr->codim2Ptr;
     772                                                //this->facetPtr->codim2Ptr = new facet(2);
     773                                                fAct->codim2Ptr = new facet(2);
     774                                                //codim2Act = this->facetPtr->codim2Ptr;
     775                                                codim2Act = fAct->codim2Ptr;
    766776                                        }
    767777                                        else
     
    782792                                        delete n;*/
    783793                                }                                                                               
    784                                        
     794                                fAct = fAct->next;     
    785795                                dd_FreeMatrix(ddakt);
    786796                                dd_FreePolyhedra(ddpolyh);
    787                         }
     797                        }//while
    788798                }
    789799               
     
    13781388                        }
    13791389#ifdef gfan_DEBUG
    1380                         iv.show();
    1381                         cout << endl;
     1390//                      iv.show();
     1391//                      cout << endl;
    13821392#endif
    13831393                        mpq_clear(qkgV);
     
    13951405               
    13961406                /** \brief Copy a ring and add a weighted ordering in first place
    1397                 * Kudos to walkSupport.cc
     1407                *
    13981408                */
    13991409                ring rCopyAndAddWeight(ring const &r, intvec const *ivw)                               
     
    17201730                                {
    17211731                                        if( gcNext->getUCN() == UCNcounter+1 )
    1722                                         {//NOTE THIS IS BUGGY. Apparently changes to the wrong ring
     1732                                        {
    17231733                                                gcAct = gcNext;
    17241734                                                rAct=rCopy(gcAct->baseRing);
     
    18421852                                        (*n)[ii] = ((*n)[ii])/ggT;
    18431853                                }
     1854                                codim2Act->setFacetNormal(n);
    18441855                                codim2Act = codim2Act->next;                           
    18451856                        }
     
    18681879                        slAct = &f;
    18691880                        facet *slEnd;   //Pointer to end of SLA
    1870                         slEnd = &f;             
     1881                        slEnd = &f;
     1882                        facet *slEndStatic;     //marks the end before a new facet is added             
    18711883                        facet *fAct;
    18721884                        fAct = this->facetPtr;
     
    18801892                                slEnd=slEnd->next;
    18811893                        }
     1894                        slEndStatic = slEnd;
    18821895                        /*1st step: compare facetNormals*/
    18831896                        intvec *fNormal = new intvec(this->numVars);
     
    18871900                        while(fAct!=NULL)
    18881901                        {
    1889                                 doNotAdd=FALSE;
     1902                                doNotAdd=TRUE;
    18901903                                fNormal = fAct->getFacetNormal();
    18911904                                slAct = &f;     //return to start of list
    1892                                 while(slAct!=NULL)
     1905                                codim2Act = fAct->codim2Ptr;
     1906                                while(slAct!=slEndStatic->next)
    18931907                                {
    18941908                                        slNormal = slAct->getFacetNormal();                                     
     
    18981912                                        {
    18991913                                                //NOTE check codim2facets here
    1900 //                                              while(codim2Act!=NULL)
    1901 //                                              {
    1902 //                                                      f2Normal = codim2Act->getFacetNormal();
    1903 //                                                      sl2Act = f.codim2Ptr;
    1904 //                                                      while(sl2Act!=NULL)
    1905 //                                                      {
    1906 //                                                              sl2Normal = sl2Act->getFacetNormal();
    1907 //                                                              if(!isParallel(f2Normal,sl2Normal))
    1908 //                                                              {
    1909 //                                                                      doNotAdd=FALSE;
    1910 //                                                                      break;
    1911 //                                                              }
    1912 //                                                              sl2Act = sl2Act->next;
    1913 //                                                      }
    1914 //                                                      if(doNotAdd==FALSE)
    1915 //                                                              break;
    1916 //                                                      codim2Act = codim2Act->next;
    1917 //                                                     
    1918 //                                              }
    1919                                                 doNotAdd=FALSE;
    1920                                                 break;
     1914                                                codim2Act = fAct->codim2Ptr;
     1915                                                while(codim2Act!=NULL)
     1916                                                {
     1917                                                        f2Normal = codim2Act->getFacetNormal();
     1918                                                        sl2Act = f.codim2Ptr;
     1919                                                        while(sl2Act!=NULL)
     1920                                                        {
     1921                                                                sl2Normal = sl2Act->getFacetNormal();
     1922                                                                if( !(areEqual(f2Normal,sl2Normal)))
     1923                                                                {
     1924                                                                        doNotAdd=FALSE;
     1925                                                                        break;                                         
     1926                                                                       
     1927                                                                }
     1928                                                                sl2Act = sl2Act->next;
     1929                                                        }
     1930                                                        if(doNotAdd==FALSE)
     1931                                                                break;
     1932                                                        codim2Act = codim2Act->next;
     1933                                                       
     1934                                                }
     1935                                                //doNotAdd=FALSE;
     1936                                                //break;
    19211937                                        }
    19221938                                        slAct = slAct->next;
     1939                                       
     1940                                        if(doNotAdd==FALSE)
     1941                                                break;                                 
    19231942                                }
    19241943                                if(doNotAdd==FALSE)
Note: See TracChangeset for help on using the changeset viewer.