- Timestamp:
- Oct 1, 2009, 8:36:23 AM (15 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
- Children:
- ac6e45db1f490e638b067d932fc2c4100bc9526c
- Parents:
- a51188ce7774d67642def70c783997021d31d082
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
ra51188 r4042c2 2 2 Compute the Groebner fan of an ideal 3 3 $Author: monerjan $ 4 $Date: 2009- 09-29 06:03:16$5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.9 0 2009-09-29 06:03:16monerjan Exp $6 $Id: gfan.cc,v 1.9 0 2009-09-29 06:03:16monerjan Exp $4 $Date: 2009-10-01 06:36:23 $ 5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.91 2009-10-01 06:36:23 monerjan Exp $ 6 $Id: gfan.cc,v 1.91 2009-10-01 06:36:23 monerjan Exp $ 7 7 */ 8 8 … … 60 60 61 61 #ifndef gfan_DEBUG 62 //#define gfan_DEBUG62 #define gfan_DEBUG 63 63 #ifndef gfan_DEBUGLEVEL 64 64 #define gfan_DEBUGLEVEL 1 … … 255 255 int getUCN() 256 256 { 257 if(this!=NULL && this!=(facet *)0xfbfbfbfbfbfbfbfb)257 if(this!=NULL && ( this!=0xfbfbfbfb || this!=(facet *)0xfbfbfbfbfbfbfbfb) ) 258 258 return this->UCN; 259 259 else … … 309 309 } 310 310 cout << "=======================" << endl; 311 } 312 313 /*bool isFlippable(intvec &load) 314 { 315 bool res=TRUE; 316 int jj; 317 for (int jj = 0; jj<load.length(); jj++) 318 { 319 intvec *ivCanonical = new intvec(load.length()); 320 (*ivCanonical)[jj]=1; 321 if (ivMult(&load,ivCanonical)<0) 322 { 323 res=FALSE; 324 break; 325 } 326 } 327 return res; 328 329 /*while (dotProduct(load,ivCanonical)>=0) 330 { 331 if (jj!=this->numVars) 332 { 333 intvec *ivCanonical = new intvec(this->numVars); 334 (*ivCanonical)[jj]=1; 335 res=TRUE; 336 jj += 1; 337 } 338 } 339 if (jj==this->numVars) 340 { 341 delete ivCanonical; 342 return FALSE; 343 } 344 else 345 { 346 delete ivCanonical; 347 return TRUE; 348 }*/ 349 //}//bool isFlippable(facet &f) 350 311 } 351 312 352 313 friend class gcone; //Bad style … … 1236 1197 rComplete(dstRing); 1237 1198 rChangeCurrRing(dstRing); 1238 rDelete(tmpRing);1199 //rDelete(tmpRing); 1239 1200 delete iv_weight; 1240 1201 //#ifdef gfan_DEBUG … … 1274 1235 //#endif 1275 1236 rChangeCurrRing(srcRing); //return to the ring we started the computation of flipGB in 1276 rDelete(dstRing);1237 // rDelete(dstRing); 1277 1238 }//void flip(ideal gb, facet *f) 1278 1239 … … 1399 1360 intvec *res = new intvec(iv->length()); 1400 1361 res=ivCopy(iv); 1401 *res *= (int)-1; 1402 //for(int ii=0;ii<this->numVars;ii++) 1403 //{ 1404 //(res)[ii] = (*res[ii])*(int)(-1); 1405 //} 1406 //res->show(1,0); 1362 *res *= (int)-1; 1407 1363 return res; 1408 1364 } … … 1413 1369 */ 1414 1370 int dotProduct(intvec const &iva, intvec const &ivb) 1415 { 1416 //intvec iva=a; 1417 //intvec ivb=b; 1371 { 1418 1372 int res=0; 1419 1373 for (int i=0;i<this->numVars;i++) … … 1890 1844 We always choose the first facet from fListPtr as facet to be flipped 1891 1845 */ 1892 while((SearchListAct!=NULL))// && counter<1 60)1846 while((SearchListAct!=NULL))// && counter<10) 1893 1847 {//NOTE See to it that the cone is only changed after ALL facets have been flipped! 1894 1848 fAct = SearchListAct; 1895 //while( ( (fAct->next!=NULL) && (fAct->getUCN()==fAct->next->getUCN() ) ) ) 1896 //do 1849 1897 1850 while(fAct!=NULL) 1898 1851 { //Since SLA should only contain flippables there should be no need to check for that … … 1916 1869 #endif 1917 1870 rChangeCurrRing(gcAct->baseRing); 1918 rDelete(rTmp);1871 //rDelete(rTmp); 1919 1872 gcPtr->next=gcTmp; 1920 1873 gcPtr=gcPtr->next; … … 1986 1939 mpz_clear(z); 1987 1940 } 1988 1989 //Check whether denom is all ones, in which case we will divide out the gcd of the nominators 1990 // mpz_t checksum; mpz_t rop; 1991 // mpz_init(checksum); 1992 // mpz_init(rop); 1993 // bool divideOutGcd=FALSE; 1994 // for(int ii=0;ii<this->numVars;ii++) 1995 // { 1996 // mpz_add(rop, checksum, denom[ii]); 1997 // mpz_set(checksum, rop); 1998 // } 1999 // if( (int)mpz_get_ui(checksum)==this->numVars) 2000 // { 2001 // divideOutGcd=TRUE; 2002 // } 2003 1941 2004 1942 /*Compute lcm of the denominators*/ 2005 1943 mpz_set(tmp,denom[0]); … … 2066 2004 fAct = fAct->next; 2067 2005 } 2068 2069 //delete n; 2070 /*codim2Act = this->facetPtr->codim2Ptr; //reset to start of linked list 2071 while(codim2Act!=NULL) 2072 { 2073 n=codim2Act->getFacetNormal(); 2074 intvec *new_n = new intvec(this->numVars); 2075 for(int ii=0;ii<this->numVars;ii++) 2076 { 2077 (*new_n)[ii] = (*n)[ii]*ggT; 2078 } 2079 codim2Act->setFacetNormal(new_n); 2080 codim2Act = codim2Act->next; 2081 //delete n; 2082 //delete new_n; 2083 } */ 2006 2084 2007 } 2085 2008 /** \brief Enqueue new facets into the searchlist … … 2207 2130 //while(slAct!=slEndStatic->next) 2208 2131 { 2132 // if(deleteMarker!=NULL) 2133 // { 2134 // delete deleteMarker; 2135 // deleteMarker=NULL; 2136 // } 2209 2137 removalOccured=FALSE; 2210 2138 slNormal = slAct->getFacetNormal(); … … 2288 2216 lengthOfSearchList--; 2289 2217 //delete slAct; 2218 //slAct=NULL; 2290 2219 //slAct = slAct->next; //not needed, since facets are equal 2291 2220 //delete deleteMarker; … … 2322 2251 slAct = slAct->next;*/ 2323 2252 //delete deleteMarker; 2324 deleteMarker=NULL;2253 //deleteMarker=NULL; 2325 2254 //if slAct was marked as to be deleted, delete it here! 2326 2255 }//while(slAct!=NULL)
Note: See TracChangeset
for help on using the changeset viewer.