Changeset 706b89 in git
- Timestamp:
- Mar 16, 2010, 9:26:07 AM (13 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 11a7dcbdadc31dae36c0918d33c19539f050e5ab
- Parents:
- ce41a2e25be4abf8c322bc11839ec929ea281509
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
rce41a2e r706b89 3188 3188 idDelete((ideal *)&fAct->flipGB); 3189 3189 rDelete(fAct->flipRing); 3190 3191 gcTmp->getConeNormals(gcTmp->gcBasis , FALSE); //TODO FALSE is default, so should not be needed here3190 3191 gcTmp->getConeNormals(gcTmp->gcBasis/*, FALSE*/); //TODO FALSE is default, so should not be needed here 3192 3192 // gcTmp->getCodim2Normals(*gcTmp); 3193 3193 gcTmp->getExtremalRays(*gcTmp); 3194 // gcTmp->normalize();// will be done in g2c 3195 //gcTmp->ddFacets should not be needed anymore, so 3194 3195 3196 3196 // //NOTE If flip2 is used we need to get an interior point of gcTmp 3197 3197 // // and replace gcTmp->baseRing with an appropriate ring with only … … 3199 3199 // gcTmp->interiorPoint2(); 3200 3200 gcTmp->replaceDouble_ringorder_a_ByASingleOne(); 3201 //gcTmp->ddFacets should not be needed anymore, so 3201 3202 dd_FreeMatrix(gcTmp->ddFacets); 3202 3203 #ifdef gfan_DEBUG … … 3209 3210 SearchListRoot=gcTmp->enqueueNewFacets(SearchListRoot); 3210 3211 #endif 3212 gcTmp->writeConeToFile(*gcTmp); 3211 3213 if(gfanHeuristic==1) 3212 3214 { 3213 gcTmp->writeConeToFile(*gcTmp);3215 // gcTmp->writeConeToFile(*gcTmp); 3214 3216 idDelete((ideal*)&gcTmp->gcBasis);//Whonder why? 3215 3217 rDelete(gcTmp->baseRing); … … 3279 3281 } 3280 3282 } 3283 // else if(gcNext->getUCN() < SearchListRoot->getUCN() ) 3284 // { 3285 // idDelete( (ideal*)&gcNext->gcBasis ); 3286 // rDelete(gcNext->baseRing); 3287 // } 3281 3288 /*else 3282 3289 { … … 3292 3299 } 3293 3300 UCNcounter++; 3294 //SearchListAct = SearchListAct->next;3295 //SearchListAct = fAct->next;3296 3301 SearchListAct = SearchListRoot; 3297 3302 } … … 3377 3382 * Actually we now also normalize the facet normals. 3378 3383 */ 3379 void gcone::normalize()3380 {3384 // void gcone::normalize() 3385 // { 3381 3386 // int *ggT = new int; 3382 3387 // *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-trivial3398 {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 // } 3432 3437 3433 3438 /** \brief Enqueue new facets into the searchlist … … 4159 4164 // pDelete(&strPoly); //NOTE Crashes - already deleted by pAdd 4160 4165 } 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 } 4163 4192 }//while(!gcInputFile.eof()) 4164 4193 gcInputFile.close(); -
kernel/gfan.h
rce41a2e r706b89 238 238 // void noRevS(gcone &gcRoot, bool usingIntPoint=FALSE); 239 239 void makeInt(const dd_MatrixPtr &M, const int line, intvec &n); 240 void normalize();240 // void normalize(); 241 241 facet * enqueueNewFacets(facet *f); 242 242 facet * enqueue2(facet *f);
Note: See TracChangeset
for help on using the changeset viewer.