Changeset cef7ee in git


Ignore:
Timestamp:
May 14, 2009, 11:55:36 AM (15 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
c0e207fbb11405ebf5b0060af0a525225c8f26e7
Parents:
787685e7e497280120367f7fab407e5a43d7c629
Message:
*** empty log message ***


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    r787685 rcef7ee  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-05-12 15:30:29 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.50 2009-05-12 15:30:29 monerjan Exp $
    6 $Id: gfan.cc,v 1.50 2009-05-12 15:30:29 monerjan Exp $
     4$Date: 2009-05-14 09:55:36 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.51 2009-05-14 09:55:36 monerjan Exp $
     6$Id: gfan.cc,v 1.51 2009-05-14 09:55:36 monerjan Exp $
    77*/
    88
     
    266266                * direction of the according facet normal
    267267                */                     
     268                //NOTE Prolly need to specify the facet to flip over
    268269                gcone(const gcone& gc)         
    269270                {
     
    13161317                /** \brief The new method of Markwig and Jensen
    13171318                */
    1318                 void noRevS(gcone &gc)
     1319                void noRevS(gcone &gc, bool usingIntPoint=FALSE)
    13191320                {
    13201321                        facet *fListPtr = new facet();                 
     
    13271328                        ddrows=2;       //Each facet is described by its normal
    13281329                        ddcols=gc.numVars+1;    // plus one for the standard simplex
    1329                        
    1330                         while(fAct->next!=NULL)
    1331                         {
    1332                                 /*Compute an interior point for each facet*/                           
    1333                                 dd_MatrixPtr ddineq;   
    1334                                 ddineq=dd_CreateMatrix(ddrows,ddcols);
    1335                                 intvec *comp = new intvec(this->numVars);
    1336                                 comp=fAct->getFacetNormal();                           
    1337                                 for(int ii=0; ii<this->numVars; ii++)                                   
    1338                                 {                                                                               
    1339                                         dd_set_si(ddineq->matrix[0][ii+1],(*comp)[ii]);
    1340                                         dd_set_si(ddineq->matrix[1][ii+1],1);   //Assure we search in the pos. orthant                 
    1341                                 }
    1342                                 set_addelem(ddineq->linset,1);  //We want equality in the first row
    1343                                 //dd_WriteMatrix(stdout,ddineq);
    1344                                 interiorPoint(ddineq,*comp);                           
    1345                                 /**/
    1346 #ifdef gfan_DEBUG
    1347                                 cout << "IP is";
    1348                                 comp->show(); cout << endl;
    1349 #endif
    1350                                 //Store the interior point and the UCN
    1351                                 fListPtr->setInteriorPoint( comp );                             
    1352                                 fListPtr->setUCN( gc.getUCN() );       
    1353                                                        
    1354                                 dd_FreeMatrix(ddineq);
    1355                                 fAct=fAct->next;        //iterate
    1356                         }                       
     1330                        if(usingIntPoint){
     1331                                while(fAct->next!=NULL)
     1332                                {
     1333                                        /*Compute an interior point for each facet*/                           
     1334                                        dd_MatrixPtr ddineq;   
     1335                                        ddineq=dd_CreateMatrix(ddrows,ddcols);
     1336                                        intvec *comp = new intvec(this->numVars);
     1337                                        comp=fAct->getFacetNormal();                           
     1338                                        for(int ii=0; ii<this->numVars; ii++)                                   
     1339                                        {                                                                               
     1340                                                dd_set_si(ddineq->matrix[0][ii+1],(*comp)[ii]);
     1341                                                dd_set_si(ddineq->matrix[1][ii+1],1);   //Assure we search in the pos. orthant         
     1342                                        }
     1343                                        set_addelem(ddineq->linset,1);  //We want equality in the first row
     1344                                        //dd_WriteMatrix(stdout,ddineq);
     1345                                        interiorPoint(ddineq,*comp);                           
     1346                                        /**/
     1347#ifdef gfan_DEBUG
     1348                                        cout << "IP is";
     1349                                        comp->show(); cout << endl;
     1350#endif
     1351                                        //Store the interior point and the UCN
     1352                                        fListPtr->setInteriorPoint( comp );                             
     1353                                        fListPtr->setUCN( gc.getUCN() );       
     1354                                                               
     1355                                        dd_FreeMatrix(ddineq);
     1356                                        fAct=fAct->next;        //iterate
     1357                                }       
     1358                        }               
    13571359                       
    13581360                        //NOTE Hm, comment in and get a crash for free...
     
    13801382                * Each section starts with its name in CAPITALS
    13811383                */
    1382                 void writeConeToFile(gcone const &gc)
     1384                void writeConeToFile(gcone const &gc, bool usingIntPoints=FALSE)
    13831385                {
    13841386                        ofstream gcOutputFile("/tmp/cone1.gc");
     
    14001402                                fAct = gc.facetPtr;
    14011403                                gcOutputFile << "FACETS" << endl;                                                               
    1402                                 while(fAct!=NULL)
     1404                                while(fAct->next!=NULL)
    14031405                                {       
    14041406                                        intvec *iv = new intvec(gc.numVars);
Note: See TracChangeset for help on using the changeset viewer.