Changeset 9f9b142 in git
- Timestamp:
- Mar 25, 2009, 8:55:50 PM (14 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 54248e343a5d77bfd7f19c65855707d3950619e8
- Parents:
- 66a5f833d02d3288ce452e48c6ece435a1f9ebd0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
r66a5f8 r9f9b142 2 2 Compute the Groebner fan of an ideal 3 3 $Author: monerjan $ 4 $Date: 2009-03-2 4 21:31:49$5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.2 0 2009-03-24 21:31:49monerjan Exp $6 $Id: gfan.cc,v 1.2 0 2009-03-24 21:31:49monerjan Exp $4 $Date: 2009-03-25 19:55:50 $ 5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.21 2009-03-25 19:55:50 monerjan Exp $ 6 $Id: gfan.cc,v 1.21 2009-03-25 19:55:50 monerjan Exp $ 7 7 */ 8 8 … … 39 39 #define gfan_DEBUG 40 40 #endif 41 42 //#include gcone.h 43 41 44 /** 42 45 *\brief Class facet … … 125 128 /*RETURN_TYPE: pointer to first facet */ 126 129 /************************************************/ 127 facet getConeNormals(ideal I)130 facet *getConeNormals(ideal I) 128 131 { 129 132 #ifdef gfan_DEBUG … … 255 258 /*The pointer *fRoot should be the return value of this function*/ 256 259 facet *fRoot = new facet(); //instantiate new facet with intvec with numvar rows, one column and initial values all 0 257 //facet *fRoot;258 260 facet *fAct; //instantiate pointer to active facet 259 fAct = (facet*)&fRoot; 261 fAct = fRoot; //This does not seem to do the trick. fRoot and fAct have to point to the same adress! 262 std::cout << "fRoot = " << fRoot << ", fAct = " << fAct << endl; 260 263 //fAct = fRoot; //Let fAct point to fRoot 261 264 for (int kk = 0; kk<ddrows; kk++) … … 267 270 foo = (double*)ddineq->matrix[kk][jj]; //get entry from actual position 268 271 #ifdef gfan_DEBUG 269 std::cout << "fAct is " << *foo << " at " << fAct << endl;272 std::cout << "fAct is " << *foo << " at " << fAct << std::endl; 270 273 #endif 271 274 /*next two lines commented out. How to store values into intvec? */ 272 275 //load[jj] = (int)*foo; //store typecasted entry at pos jj of load 273 276 //fAct->setFacetNormal(load); 277 //check for flipability here 274 278 if (jj<ddcols) //Is this facet NOT the last facet? Writing while instead of if is a really bad idea :) 275 279 { … … 280 284 } 281 285 /* 282 Now we should have a concatenated list containing the facet normals which we can adress via *f 286 Now we should have a concatenated list containing the facet normals of those facets that are 287 -irredundant 288 -flipable 289 Adressing is done via *fRoot 290 But since we did this in a function probably most if not all is lost after the return. So implement this as a method of gcone 283 291 */ 284 292 … … 286 294 //Clean up but don't delete the return value! (Whatever it will turn out to be) 287 295 dd_FreeMatrix(ddineq); 288 //set_free(ddrows);289 //set_free(ddcols);290 296 set_free(ddredrows); 291 //set_free(ddnumb);292 //set_free(dderr);293 297 free(ddnewpos); 294 //set_free(ddlinset);298 set_free(ddlinset); 295 299 dd_free_global_constants(); 296 300 297 298 return *fRoot; 301 return fRoot; 299 302 } 300 303 … … 304 307 cout << "Now in subroutine gfan" << endl; 305 308 #endif 309 ring rootRing; // The ring associated to the target ordering 306 310 ideal res; 307 311 matrix ineq; //Matrix containing the boundary inequalities 312 facet *fRoot; 313 314 315 rootRing=rCopy0(currRing); 316 rComplete(rootRing); 317 rChangeCurrRing(rootRing); 318 cout << "The current ring is " << endl; 319 rWrite(rootRing); 320 321 gcone *gcRoot = new gcone(); //Instantiate the sink 322 gcone *gcAct; 323 gcAct = gcRoot; 324 325 308 326 /* 309 1. Select target order 327 1. Select target order, say dp. 310 328 2. Compute GB of inputIdeal wrt target order -> newRing, setCurrRing etc... 311 329 3. getConeNormals 312 330 */ 313 331 res=getGB(inputIdeal); 314 getConeNormals(res); 332 fRoot=getConeNormals(res); 333 cout << fRoot << endl; 315 334 return res; 316 335 } 317 #endif 336 /* 337 Since gfan.cc is #included from extra.cc there must not be a int main(){} here 338 */ 339 #endif
Note: See TracChangeset
for help on using the changeset viewer.