Changeset d4f1b95 in git for kernel/gfan.cc


Ignore:
Timestamp:
Nov 24, 2009, 10:19:36 AM (14 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', '873fc1222e995d7cb33f79d8f1792ce418c8c72c')
Children:
ceaa049b15f01877c8cd64ac61771aff342c1da7
Parents:
d945f30c526b2f3c4c937f5acb82e282284898d9
Message:
Copy constructor for facets
pDelete



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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    rd945f3 rd4f1b95  
    126126facet::facet(const facet& f)
    127127{
     128//      this->setFacetNormal(f.getFacetNormal());
     129//      this->setUCN(f.getUCN());
     130//      this->isFlippable=f.isFlippable;
     131//      facet* f2Copy;
     132//      f2Copy=f.codim2Ptr;
     133//      facet* f2Act;
     134//      f2Act=this->codim2Ptr;
     135//      while(f2Copy!=NULL)
     136//      {
     137//              if(f2Act==NULL)
     138//              {
     139//                      f2Act=new facet(2);                     
     140//              }
     141//              else
     142//              {
     143//                      f2Act->next = new facet(2);
     144//              }
     145//              f2Act->setFacetNormal(f2Copy->getFacetNormal());
     146//              f2Copy = f2Copy->next;
     147//      }
    128148}
    129149               
     
    220240}
    221241               
    222 /** Return the flipped GB*/
     242/** Return the flipped GB
     243Seems not be used
     244Anyhow idCopy would make sense here.
     245*/
    223246ideal facet::getFlipGB()
    224247{
     
    245268int facet::getUCN()
    246269{
    247         if(this!=NULL && ( this!=(facet *)0xfbfbfbfb || this!=(facet *)0xfbfbfbfbfbfbfbfb) )
     270        if(this!=NULL  && this!=(facet *)0xfbfbfbfbfbfbfbfb)// || this!=(facet *)0xfbfbfbfb) )
    248271//      if(this!=NULL && ( this->fNormal!=(intvec *)0xfbfbfbfb || this->fNormal!=(intvec *)0xfbfbfbfbfbfbfbfb) )
    249272                return this->UCN;
     
    409432intvec *gcone::getIntPoint()
    410433{
    411         return this->ivIntPt;
     434        return ivCopy(this->ivIntPt);
    412435}
    413436               
     
    17241747                        gcTmp->normalize();
    17251748#ifdef gfan_DEBUG
    1726                         gcTmp->showFacets(1);
     1749//                      gcTmp->showFacets(1);
    17271750#endif
    17281751                        /*add facets to SLA here*/
     
    17351758                                for(int ii=0;ii<IDELEMS(gcTmp->gcBasis);ii++)
    17361759                                {
    1737                                         gcTmp->gcBasis->m[ii]=(poly)NULL;
     1760//                                      gcTmp->gcBasis->m[ii]=(poly)NULL;
     1761                                        pDelete(&gcTmp->gcBasis->m[ii]);
    17381762                                }
    17391763                        }
    17401764                       
    17411765#if gfan_DEBUG
    1742                         if(SearchListRoot!=NULL)
    1743                                 gcTmp->showSLA(*SearchListRoot);
     1766//                      if(SearchListRoot!=NULL)
     1767//                              gcTmp->showSLA(*SearchListRoot);
    17441768#endif
    17451769                        rChangeCurrRing(gcAct->baseRing);
     
    19882012        slEndStatic = slEnd;
    19892013        /*1st step: compare facetNormals*/
    1990         intvec *fNormal=NULL; //= new intvec(this->numVars);
    1991         intvec *f2Normal=NULL; //= new intvec(this->numVars);
    1992         intvec *slNormal=NULL; //= new intvec(this->numVars);
    1993         intvec *sl2Normal=NULL; //= new intvec(this->numVars);
     2014        intvec *fNormal=NULL;
     2015        intvec *f2Normal=NULL;
     2016        intvec *slNormal=NULL;
     2017        intvec *sl2Normal=NULL;
    19942018                       
    19952019        while(fAct!=NULL)
     
    20552079                                        //while(slAct!=slEndStatic->next)
    20562080                        {
    2057 //                              if(deleteMarker!=NULL)
    2058 //                              {
     2081                                if(deleteMarker!=NULL)
     2082                                {
    20592083//                                      delete deleteMarker;
    20602084//                                      deleteMarker=NULL;
    2061 //                              }
     2085                                }
    20622086                                removalOccured=FALSE;
    20632087                                slNormal = slAct->getFacetNormal();
     
    20722096                                {
    20732097                                        notParallelCtr++;
    2074 //                                                      slAct = slAct->next;
    20752098                                }
    20762099                                else    //fN and slN are parallel
     
    21082131                                                if(slAct==slHead)       //We want to delete the first element of SearchList
    21092132                                                {
    2110                                                         deleteMarker = slHead;                         
     2133                                                        deleteMarker = slAct;                           
    21112134                                                        slHead = slAct->next;                                           
    21122135                                                        if(slHead!=NULL)
    21132136                                                                slHead->prev = NULL;
    2114                                                         /*delete deleteMarker*/;                                       
    2115                                                                         //set a bool flag to mark slAct as to be deleted
     2137//                                                      delete deleteMarker; deleteMarker=NULL;
     2138                                                        //set a bool flag to mark slAct as to be deleted
    21162139                                                }//NOTE find a way to delete without affecting slAct = slAct->next
    21172140                                                else if(slAct==slEndStatic)
     
    21292152                                                                slEndStatic->next->prev = slEndStatic->prev;
    21302153                                                                slEndStatic = slEndStatic->prev;
    2131                                                                                         //slEnd = slEndStatic;
     2154                                                                //slEnd = slEndStatic;
    21322155                                                        }
    21332156                                                }                                                               
     
    21372160                                                        slAct->prev->next = slAct->next;
    21382161                                                        slAct->next->prev = slAct->prev;
    2139                                                 }
    2140                                                                
     2162                                                }                                                               
    21412163                                                //update lengthOfSearchList                                     
    2142                                                 lengthOfSearchList--;
    2143                                                 //delete slAct;
    2144                                                 //slAct=NULL;
    2145                                                 //slAct = slAct->next; //not needed, since facets are equal
    2146 //                                              delete deleteMarker;
    2147                                                 //deleteMarker=NULL;
    2148                                                 //fAct = fAct->next;
     2164                                                lengthOfSearchList--;                                           
    21492165                                                break;
    21502166                                        }//if(ctr==fAct->numCodim2Facets)
     
    21522168                                                //is no other facet later in SLA that might be equal.
    21532169                                        {
    2154                                                 maybe=TRUE;
    2155 //                                                                      if(slAct->next==NULL && maybe==TRUE)
    2156 //                                                                      {
    2157 //                                                                      doNotAdd=FALSE;
    2158 //                                                                      slAct = slAct->next;
    2159 //                                                                      break;
    2160 //                                                                      }
    2161 //                                                                      else
    2162 //                                                                      slAct=slAct->next;
    2163                                         }
    2164                                                         //slAct = slAct->next;
    2165                                                         //delete deleteMarker;                                                 
     2170                                                maybe=TRUE;//                                                                   
     2171                                        }                                                       
    21662172                                }//if(!isParallel(fNormal, slNormal))
    21672173                                if( (slAct->next==NULL) && (maybe==TRUE) )
     
    21762182                                be a way it gets called twice thus ommiting one facet:
    21772183                                slAct = slAct->next;*/                                         
    2178                                                 //delete deleteMarker;
    2179                                                 //deleteMarker=NULL;
     2184//                                              delete deleteMarker;
     2185//                                              deleteMarker=NULL;
    21802186                                                //if slAct was marked as to be deleted, delete it here!
    21812187                        }//while(slAct!=NULL)                                                                   
     
    22062212                                slEnd->prev = marker;
    22072213                                //Copy codim2-facets
    2208                                 intvec *f2Normal;// = new intvec(this->numVars);
     2214                                intvec *f2Normal;
    22092215                                while(f2Act!=NULL)
    22102216                                {
     
    22352241        }//while(fAct!=NULL)                                           
    22362242        return slHead;
    2237 //                      delete sl2Normal;
    2238 //                      delete slNormal;
    2239 //                      delete f2Normal;
    2240 //                      delete fNormal;
    22412243}//addC2N
    22422244               
     
    25742576ring gcone::getBaseRing()
    25752577{
    2576         return this->baseRing;
     2578        return rCopy(this->baseRing);
    25772579}
    25782580/** \brief Gather the output
     
    27402742                gcDel = gcRoot;
    27412743                gcAct = gcRoot;
    2742                 do
     2744                while(gcAct!=NULL)
    27432745                {
    27442746                        gcDel = gcAct;
    27452747                        gcAct = gcAct->next;
    27462748                        delete gcDel;
    2747                 }while(gcAct!=NULL);
     2749                }
    27482750        }
    27492751        dd_free_global_constants();
Note: See TracChangeset for help on using the changeset viewer.