Changeset 706b89 in git


Ignore:
Timestamp:
Mar 16, 2010, 9:26:07 AM (13 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
11a7dcbdadc31dae36c0918d33c19539f050e5ab
Parents:
ce41a2e25be4abf8c322bc11839ec929ea281509
Message:
The cones are written to disk by default. Rereading must still be
enabled
Prepared for deletion and reconstruction of facet normals
gcone::normalize removed


git-svn-id: file:///usr/local/Singular/svn/trunk@12648 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    rce41a2e r706b89  
    31883188                        idDelete((ideal *)&fAct->flipGB);
    31893189                        rDelete(fAct->flipRing);
    3190                        
    3191                         gcTmp->getConeNormals(gcTmp->gcBasis, FALSE);   //TODO FALSE is default, so should not be needed here
     3190
     3191                        gcTmp->getConeNormals(gcTmp->gcBasis/*, FALSE*/);       //TODO FALSE is default, so should not be needed here
    31923192//                      gcTmp->getCodim2Normals(*gcTmp);
    31933193                        gcTmp->getExtremalRays(*gcTmp);
    3194 //                      gcTmp->normalize();// will be done in g2c
    3195                         //gcTmp->ddFacets should not be needed anymore, so
     3194
     3195
    31963196//                      //NOTE If flip2 is used we need to get an interior point of gcTmp
    31973197//                      // and replace gcTmp->baseRing with an appropriate ring with only
     
    31993199//                      gcTmp->interiorPoint2();
    32003200                        gcTmp->replaceDouble_ringorder_a_ByASingleOne();
     3201                        //gcTmp->ddFacets should not be needed anymore, so
    32013202                        dd_FreeMatrix(gcTmp->ddFacets);
    32023203#ifdef gfan_DEBUG
     
    32093210                        SearchListRoot=gcTmp->enqueueNewFacets(SearchListRoot);
    32103211#endif
     3212                        gcTmp->writeConeToFile(*gcTmp);
    32113213                        if(gfanHeuristic==1)
    32123214                        {
    3213                                 gcTmp->writeConeToFile(*gcTmp);
     3215//                              gcTmp->writeConeToFile(*gcTmp);
    32143216                                idDelete((ideal*)&gcTmp->gcBasis);//Whonder why?
    32153217                                rDelete(gcTmp->baseRing);
     
    32793281                                }                               
    32803282                        }
     3283//                      else if(gcNext->getUCN() < SearchListRoot->getUCN() )
     3284//                      {
     3285//                              idDelete( (ideal*)&gcNext->gcBasis );
     3286//                              rDelete(gcNext->baseRing);
     3287//                      }
    32813288                        /*else
    32823289                        {
     
    32923299                }
    32933300                UCNcounter++;
    3294                 //SearchListAct = SearchListAct->next;
    3295                 //SearchListAct = fAct->next;
    32963301                SearchListAct = SearchListRoot;
    32973302        }
     
    33773382 * Actually we now also normalize the facet normals.
    33783383 */
    3379 void gcone::normalize()
    3380 {
     3384// void gcone::normalize()
     3385// {
    33813386//      int *ggT = new int;
    33823387//              *ggT=1;
    3383         facet *fAct;
    3384         facet *codim2Act;
    3385         fAct = this->facetPtr;
    3386         codim2Act = fAct->codim2Ptr;
    3387         while(fAct!=NULL)
    3388         {
    3389                 intvec *fNormal;
    3390                 fNormal = fAct->getFacetNormal();
    3391                 int *ggT = new int;
    3392                 *ggT=1;
    3393                 for(int ii=0;ii<this->numVars;ii++)
    3394                 {
    3395                         *ggT=intgcd((*ggT),(*fNormal)[ii]);
    3396                 }
    3397                 if(*ggT>1)//We only need to do this if the ggT is non-trivial
    3398                 {
    3399 //                      intvec *fCopy = fAct->getFacetNormal();
    3400                         for(int ii=0;ii<this->numVars;ii++)
    3401                                 (*fNormal)[ii] = ((*fNormal)[ii])/(*ggT);
    3402                         fAct->setFacetNormal(fNormal);
    3403                 }               
    3404                 delete fNormal;
    3405                 delete ggT;
    3406                 /*And now for the codim2*/
    3407                 while(codim2Act!=NULL)
    3408                 {                               
    3409                         intvec *n;
    3410                         n=codim2Act->getFacetNormal();
    3411                         int *ggT=new int;
    3412                         *ggT=1;
    3413                         for(int ii=0;ii<this->numVars;ii++)
    3414                         {
    3415                                 *ggT = intgcd((*ggT),(*n)[ii]);
    3416                         }
    3417                         if(*ggT>1)
    3418                         {
    3419                                 for(int ii=0;ii<this->numVars;ii++)
    3420                                 {
    3421                                         (*n)[ii] = ((*n)[ii])/(*ggT);
    3422                                 }
    3423                                 codim2Act->setFacetNormal(n);
    3424                         }
    3425                         codim2Act = codim2Act->next;
    3426                         delete n;
    3427                         delete ggT;
    3428                 }
    3429                 fAct = fAct->next;
    3430         }
    3431 }
     3388//      facet *fAct;
     3389//      facet *codim2Act;
     3390//      fAct = this->facetPtr;
     3391//      codim2Act = fAct->codim2Ptr;
     3392//      while(fAct!=NULL)
     3393//      {
     3394//              intvec *fNormal;
     3395//              fNormal = fAct->getFacetNormal();
     3396//              int *ggT = new int;
     3397//              *ggT=1;
     3398//              for(int ii=0;ii<this->numVars;ii++)
     3399//              {
     3400//                      *ggT=intgcd((*ggT),(*fNormal)[ii]);
     3401//              }
     3402//              if(*ggT>1)//We only need to do this if the ggT is non-trivial
     3403//              {
     3404// //                   intvec *fCopy = fAct->getFacetNormal();
     3405//                      for(int ii=0;ii<this->numVars;ii++)
     3406//                              (*fNormal)[ii] = ((*fNormal)[ii])/(*ggT);
     3407//                      fAct->setFacetNormal(fNormal);
     3408//              }               
     3409//              delete fNormal;
     3410//              delete ggT;
     3411//              /*And now for the codim2*/
     3412//              while(codim2Act!=NULL)
     3413//              {                               
     3414//                      intvec *n;
     3415//                      n=codim2Act->getFacetNormal();
     3416//                      int *ggT=new int;
     3417//                      *ggT=1;
     3418//                      for(int ii=0;ii<this->numVars;ii++)
     3419//                      {
     3420//                              *ggT = intgcd((*ggT),(*n)[ii]);
     3421//                      }
     3422//                      if(*ggT>1)
     3423//                      {
     3424//                              for(int ii=0;ii<this->numVars;ii++)
     3425//                              {
     3426//                                      (*n)[ii] = ((*n)[ii])/(*ggT);
     3427//                              }
     3428//                              codim2Act->setFacetNormal(n);
     3429//                      }
     3430//                      codim2Act = codim2Act->next;
     3431//                      delete n;
     3432//                      delete ggT;
     3433//              }
     3434//              fAct = fAct->next;
     3435//      }
     3436// }
    34323437
    34333438/** \brief Enqueue new facets into the searchlist
     
    41594164//                              pDelete(&strPoly);      //NOTE Crashes - already deleted by pAdd                               
    41604165                        }
    4161                         break;
    4162                 }//if(line=="GCBASIS")         
     4166//                      break;
     4167                }//if(line=="GCBASIS") 
     4168                if(line=="FACETS")
     4169                {
     4170                        facet *fAct=gc->facetPtr;
     4171                        for(int ll=0;ll<this->numFacets;ll++)
     4172                        {
     4173                                getline(gcInputFile,line);
     4174                                found = line.find("\t");
     4175                                string normalString=line.substr(0,found);
     4176                                intvec *fN = new intvec(this->numVars);
     4177                                for(int ii=0;ii<this->numVars;ii++)
     4178                                {
     4179                                        string component;
     4180                                        found = normalString.find(",");
     4181                                        component=normalString.substr(0,found);
     4182                                        (*fN)[ii]=atol(component.c_str());
     4183                                        normalString.erase(0,found+1);
     4184                                }
     4185                                /*Only the following line needs to be commented out if you decide not to delete fNormals*/
     4186//                              fAct->setFacetNormal(fN);
     4187                                delete(fN);
     4188                                fAct = fAct->next;      //Booh, this is ugly
     4189                        }                       
     4190                        break; //NOTE Must always be in the last if-block!
     4191                }
    41634192        }//while(!gcInputFile.eof())   
    41644193        gcInputFile.close();
  • kernel/gfan.h

    rce41a2e r706b89  
    238238//              void noRevS(gcone &gcRoot, bool usingIntPoint=FALSE);
    239239                void makeInt(const dd_MatrixPtr &M, const int line, intvec &n);
    240                 void normalize();
     240//              void normalize();
    241241                facet * enqueueNewFacets(facet *f);
    242242                facet * enqueue2(facet *f);
Note: See TracChangeset for help on using the changeset viewer.