Changeset ca02ab in git


Ignore:
Timestamp:
Jun 19, 2009, 1:22:06 PM (14 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
4c4979113300821a84ed183fecde7b3efce05832
Parents:
0724284e35457907e97c6df4677bb5a0677b2501
Message:
Enabled writeConeToFile to write files depending on UCN


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    r0724284 rca02ab  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-06-16 15:49:43 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.62 2009-06-16 15:49:43 monerjan Exp $
    6 $Id: gfan.cc,v 1.62 2009-06-16 15:49:43 monerjan Exp $
     4$Date: 2009-06-19 11:22:06 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.63 2009-06-19 11:22:06 monerjan Exp $
     6$Id: gfan.cc,v 1.63 2009-06-19 11:22:06 monerjan Exp $
    77*/
    88
     
    2525#include <fstream>      //read-write cones to files
    2626#include <gmp.h>
     27#include <string>
     28#include <sstream>
    2729//#include <gmpxx.h>
    2830
     
    16231625                        We always choose the first facet from fListPtr as facet to be flipped
    16241626                        */
    1625                         while(SearchListAct->next!=NULL)
     1627                        while(SearchListAct->next!=NULL)
    16261628                        {//NOTE See to it that the cone is only changed after ALL facets have been flipped!
    16271629                                //As of now this is not the case!
    16281630                                int flag=1;
    1629 //                              while(fAct->next!=NULL)
    1630 //                              {
    1631 //                                      gcAct->flip(gcAct->gcBasis,SearchListAct);
    1632 //                                      ring rTmp=rCopy(SearchListAct->flipRing);
    1633 //                                      //NOTE It is absolutely crucial to go to the new ring before constructing a new cone!
    1634 //                                      rComplete(rTmp);
    1635 //                                      rChangeCurrRing(rTmp);
    1636 //                                      gcone *gcTmp = new gcone::gcone(*gcAct,*SearchListAct);
    1637 //                                      gcTmp->getConeNormals(gcTmp->gcBasis, FALSE);
    1638 //                                      gcTmp->getCodim2Normals(*gcTmp);
    1639 //                                      /*add facets to SLA here*/                                     
    1640 //                                      rChangeCurrRing(gcAct->baseRing);
    1641 //                                      gcPtr->next=gcTmp;
    1642 //                                      if(flag==1)
    1643 //                                              gcAct->next=gcTmp;
    1644 //                                      gcPtr=gcPtr->next;
    1645 //                                      fAct=fAct->next;
    1646 //                                      flag++;
    1647 //                              }
    1648 //                             
    1649 //                              if(SearchListAct->getUCN()!=SearchListAct->next->getUCN())
    1650 //                              {
    1651 //                                      ring r=rCopy(SearchListAct->flipRing);
    1652 //                                      rComplete(r);
    1653 //                                      rChangeCurrRing(r);
    1654 //                                      gcAct = gcAct->next;
    1655 //                              }
    1656 //                              SearchListAct = SearchListAct->next;
    16571631                                fAct = SearchListAct;
    1658                                 while( (fAct->next!=NULL) && (fAct->getUCN()==fAct->next->getUCN() ) )
     1632                                //while( ( (fAct->next!=NULL) && (fAct->getUCN()==fAct->next->getUCN() ) ) )
     1633                                do
    16591634                                {
    16601635                                        gcAct->flip(gcAct->gcBasis,fAct);
     
    16711646                                                gcAct->next=gcTmp;
    16721647                                        gcPtr=gcPtr->next;
    1673                                         fAct=fAct->next;
     1648                                        if(fAct->getUCN() == fAct->next->getUCN())
     1649                                        {
     1650                                                fAct=fAct->next;
     1651                                        }
     1652                                        else
     1653                                                break;
    16741654                                        flag++;
     1655                                }while( ( (fAct->next!=NULL) && (fAct->getUCN()==fAct->next->getUCN() ) ) );   
     1656                                if (fAct->next!=NULL)
     1657                                {
     1658                                        SearchListAct=fAct->next;
     1659                                        ring r=rCopy(SearchListAct->flipRing);
     1660                                        rComplete(r);
     1661                                        rChangeCurrRing(r);
     1662                                        gcAct = gcAct->next;
    16751663                                }
    1676                                 SearchListAct=fAct->next;
    1677                                 ring r=rCopy(SearchListAct->flipRing);
    1678                                 rComplete(r);
    1679                                 rChangeCurrRing(r);
    1680                                 gcAct = gcAct->next;
     1664                                else
     1665                                {
     1666                                        SearchListAct=NULL;
     1667                                }
    16811668                               
    16821669                        }                       
     
    18521839                void writeConeToFile(gcone const &gc, bool usingIntPoints=FALSE)
    18531840                {
    1854                         ofstream gcOutputFile("/tmp/cone1.gc");
    1855                         facet *fAct = new facet();
    1856                         fAct = gc.facetPtr;
     1841                        int UCN=gc.UCN;
     1842                        stringstream ss;
     1843                        ss << UCN;
     1844                        string UCNstr = ss.str();               
     1845                       
     1846                        char prefix[]="/tmp/cone";
     1847                        char *UCNstring;
     1848                        strcpy(UCNstring,UCNstr.c_str());
     1849                        char suffix[]=".sg";
     1850                        char *filename=strcat(prefix,UCNstring);
     1851                        strcat(filename,suffix);
     1852                                       
     1853                        ofstream gcOutputFile(filename);
     1854                        facet *fAct = new facet(); //NOTE Why new?
     1855                        fAct = gc.facetPtr;                     
    18571856                       
    18581857                        char *ringString = rString(currRing);
Note: See TracChangeset for help on using the changeset viewer.