Changeset 6d0c34 in git for kernel/gfan.cc
- Timestamp:
- Nov 25, 2009, 4:15:35 PM (14 years ago)
- Branches:
- (u'spielwiese', 'e7cc1ebecb61be8b9ca6c18016352af89940b21a')
- Children:
- 776bf3ed001f80e10ca0f09d6bf2354a7455f93f
- Parents:
- f5a31670a1ddd47c1c3ec05c66843294627af2bb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
rf5a3167 r6d0c34 172 172 } 173 173 delete this->codim2Ptr; 174 idDelete((ideal *)&this->flipGB); 175 rDelete(this->flipRing); 176 this->flipRing=NULL; 174 if(this->flipGB!=NULL) 175 idDelete((ideal *)&this->flipGB); 176 if(this->flipRing!=NULL) 177 rDelete(this->flipRing); 178 // this->flipRing=NULL; 177 179 //this=NULL; 178 180 } … … 419 421 } 420 422 this->counter--; 421 dd_FreeMatrix(this->ddFacets); 423 //should be deleted in noRevS 424 // dd_FreeMatrix(this->ddFacets); 422 425 //dd_FreeMatrix(this->ddFacets); 423 426 } … … 607 610 608 611 dd_rowrange aktmatrixrow=0; // needed to store the diffs of the expvects in the rows of ddineq 609 dd_set_global_constants();612 // dd_set_global_constants(); 610 613 ddrows=rows; 611 614 ddcols=this->numVars; … … 889 892 //codim2Act = this->facetPtr->codim2Ptr; 890 893 891 dd_set_global_constants();894 // dd_set_global_constants(); 892 895 893 896 dd_MatrixPtr ddineq,P,ddakt; … … 961 964 dd_FreePolyhedra(ddpolyh); 962 965 delete iv_intPoint; 966 dd_FreeMatrix(P); 967 set_free(impl_linset); 968 set_free(redset); 969 free(newpos); 963 970 }//for 964 971 dd_FreeMatrix(ddineq); 972 // dd_FreeMatrix(P); 973 // set_free(impl_linset); 974 // set_free(redset); 975 // free(newpos); 976 965 977 } 966 978 … … 1080 1092 * compute the difference accordingly 1081 1093 */ 1082 dd_set_global_constants();1094 // dd_set_global_constants(); 1083 1095 bool markingsAreCorrect=FALSE; 1084 1096 dd_MatrixPtr intPointMatrix; … … 1195 1207 interiorPoint(intPointMatrix, *iv_weight); //iv_weight now contains the interior point 1196 1208 dd_FreeMatrix(intPointMatrix); 1197 dd_free_global_constants();1209 // dd_free_global_constants(); 1198 1210 1199 1211 /*Step 3 … … 1268 1280 for (int ii=0;ii<IDELEMS(gb);ii++) 1269 1281 { 1270 aktpoly = (poly)gb->m[ii];1282 aktpoly = pCopy((poly)gb->m[ii]); 1271 1283 int *v=(int *)omAlloc((this->numVars+1)*sizeof(int)); 1272 1284 int *leadExpV=(int *)omAlloc((this->numVars+1)*sizeof(int)); … … 1277 1289 { 1278 1290 aktpoly=pNext(aktpoly); //next term 1279 pSetm(aktpoly);1291 // pSetm(aktpoly); 1280 1292 pGetExpV(aktpoly,v); 1281 1293 /* Convert (int)v into (intvec)check */ … … 1303 1315 #endif 1304 1316 /*Now initialFormElement must be added to (ideal)initialForm */ 1305 initialForm->m[ii]=initialFormElement[ii]; 1317 initialForm->m[ii]=pCopy(initialFormElement[ii]); 1318 pDelete(&initialFormElement[ii]); 1306 1319 omFree(leadExpV); 1307 1320 omFree(v); 1308 1321 }//for 1309 1322 delete check; 1323 pDelete(&aktpoly); 1310 1324 } 1311 1325 … … 1329 1343 int size=IDELEMS(H); 1330 1344 ideal res=idInit(size,1); 1331 poly temp1, temp2, temp3; //polys to temporarily store values for pSub 1345 poly temp1=pInit(); 1346 poly temp2=pInit(); 1347 poly temp3=pInit(); //polys to temporarily store values for pSub 1332 1348 for (int ii=0;ii<size;ii++) 1333 1349 { 1334 1350 // res->m[ii]=restOfDiv(H->m[ii],G); 1335 res->m[ii]=kNF(G, NULL,H->m[ii],0,0); 1336 temp1=H->m[ii]; 1337 temp2=res->m[ii]; 1351 // res->m[ii]=pCopy(kNF(G, NULL,H->m[ii],0,0)); 1352 temp1=pCopy(H->m[ii]); 1353 // temp2=pCopy(res->m[ii]); 1354 temp2=pCopy(kNF(G, NULL,H->m[ii],0,0)); 1338 1355 temp3=pSub(temp1, temp2); 1339 res->m[ii]= temp3;1356 res->m[ii]=pCopy(temp3); 1340 1357 //res->m[ii]=pSub(temp1,temp2); //buggy 1341 1358 //pSort(res->m[ii]); 1342 1359 //pSetm(res->m[ii]); 1343 1360 //cout << "res->m["<<ii<<"]=";pWrite(res->m[ii]); 1344 } 1361 } 1362 pDelete(&temp1); 1363 // pDelete(&temp2); 1364 // pDelete(&temp3); 1345 1365 return res; 1346 1366 } … … 1511 1531 dd_FreeLPData(lp); 1512 1532 set_free(ddlinset); 1513 set_free(ddredrows); 1533 set_free(ddredrows); 1534 // free(ddnewpos); //segfaults 1514 1535 1515 1536 }//void interiorPoint(dd_MatrixPtr const &M) … … 1745 1766 * Destructor must be equipped with necessary checks. 1746 1767 */ 1747 //idDelete((ideal *)&fAct->flipGB);1748 //rDelete(fAct->flipRing);1768 idDelete((ideal *)&fAct->flipGB); 1769 rDelete(fAct->flipRing); 1749 1770 1750 1771 gcTmp->getConeNormals(gcTmp->gcBasis, FALSE); 1751 1772 gcTmp->getCodim2Normals(*gcTmp); 1752 1773 gcTmp->normalize(); 1774 //gcTmp->ddFacets should not be needed anymore, so 1775 dd_FreeMatrix(gcTmp->ddFacets); 1753 1776 #ifdef gfan_DEBUG 1754 1777 // gcTmp->showFacets(1); … … 1971 1994 * Returns a pointer to new first element of Searchlist 1972 1995 */ 1973 //void enqueueNewFacets(facet &f)1974 1996 facet * gcone::enqueueNewFacets(facet &f) 1975 1997 { … … 1980 2002 facet *slEnd; //Pointer to end of SLA 1981 2003 slEnd = &f; 1982 facet *slEndStatic; //marks the end before a new facet is added2004 // facet *slEndStatic; //marks the end before a new facet is added 1983 2005 facet *fAct; 1984 2006 fAct = this->facetPtr; … … 1992 2014 1993 2015 /** Flag to indicate a facet that should be added to SLA*/ 1994 bool doNotAdd=FALSE;2016 // bool doNotAdd=FALSE; 1995 2017 /** \brief Flag to mark a facet that might be added 1996 2018 * The following case may occur: … … 2001 2023 * If slAct->next==NULL AND maybe==TRUE we know, that fAct must be added 2002 2024 */ 2003 volatile bool maybe=FALSE;2025 // volatile bool maybe=FALSE; 2004 2026 /**A facet was removed, lengthOfSearchlist-- thus we must not rely on 2005 2027 * if(notParallelCtr==lengthOfSearchList) but rather … … 2015 2037 lengthOfSearchList++; 2016 2038 } 2017 slEndStatic = slEnd;2039 // slEndStatic = slEnd; 2018 2040 /*1st step: compare facetNormals*/ 2019 intvec *fNormal=NULL;2020 intvec *f2Normal=NULL;2021 intvec *slNormal=NULL;2022 intvec *sl2Normal=NULL;2041 intvec *fNormal=NULL; 2042 // intvec *f2Normal=NULL; 2043 intvec *slNormal=NULL; 2044 // intvec *sl2Normal=NULL; 2023 2045 2024 2046 while(fAct!=NULL) … … 2026 2048 if(fAct->isFlippable==TRUE) 2027 2049 { 2028 maybe=FALSE;2029 doNotAdd=TRUE;2050 // maybe=FALSE; 2051 // doNotAdd=TRUE; 2030 2052 fNormal=fAct->getFacetNormal(); 2031 2053 slAct = slHead; … … 2121 2143 } 2122 2144 removalOccured=TRUE; 2145 lengthOfSearchList--; 2123 2146 break;//leave the while loop, since we found fAct=slAct thus delete slAct and do not add fAct 2124 2147 } … … 2665 2688 ideal res; 2666 2689 facet *fRoot; 2667 2690 dd_set_global_constants(); 2668 2691 if(method==noRevS) 2669 2692 {
Note: See TracChangeset
for help on using the changeset viewer.