Changes in / [1110:489e243cfcb7:1108:e00d7b681d8e] in lemon-main
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/lgf-gen.cc
r1109 r654 247 247 struct BeachIt; 248 248 249 typedef std::multimap<double, BeachIt *> SpikeHeap;249 typedef std::multimap<double, BeachIt> SpikeHeap; 250 250 251 251 typedef std::multimap<Part, SpikeHeap::iterator, YLess> Beach; … … 330 330 331 331 if (bit->second != spikeheap.end()) { 332 delete bit->second->second;333 332 spikeheap.erase(bit->second); 334 333 } … … 344 343 circle_form(points[prev], points[curr], points[site])) { 345 344 double x = circle_point(points[prev], points[curr], points[site]); 346 pit = spikeheap.insert(std::make_pair(x, newBeachIt(beach.end())));347 pit->second ->it =345 pit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end()))); 346 pit->second.it = 348 347 beach.insert(std::make_pair(Part(prev, curr, site), pit)); 349 348 } else { … … 357 356 circle_form(points[site], points[curr],points[next])) { 358 357 double x = circle_point(points[site], points[curr], points[next]); 359 nit = spikeheap.insert(std::make_pair(x, newBeachIt(beach.end())));360 nit->second ->it =358 nit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end()))); 359 nit->second.it = 361 360 beach.insert(std::make_pair(Part(site, curr, next), nit)); 362 361 } else { … … 368 367 sweep = spit->first; 369 368 370 Beach::iterator bit = spit->second ->it;369 Beach::iterator bit = spit->second.it; 371 370 372 371 int prev = bit->first.prev; … … 401 400 int nnt = nbit->first.next; 402 401 403 if (bit->second != spikeheap.end()) 404 { 405 delete bit->second->second; 406 spikeheap.erase(bit->second); 407 } 408 if (pbit->second != spikeheap.end()) 409 { 410 delete pbit->second->second; 411 spikeheap.erase(pbit->second); 412 } 413 if (nbit->second != spikeheap.end()) 414 { 415 delete nbit->second->second; 416 spikeheap.erase(nbit->second); 417 } 418 402 if (bit->second != spikeheap.end()) spikeheap.erase(bit->second); 403 if (pbit->second != spikeheap.end()) spikeheap.erase(pbit->second); 404 if (nbit->second != spikeheap.end()) spikeheap.erase(nbit->second); 405 419 406 beach.erase(nbit); 420 407 beach.erase(bit); … … 426 413 double x = circle_point(points[ppv], points[prev], points[next]); 427 414 if (x < sweep) x = sweep; 428 pit = spikeheap.insert(std::make_pair(x, newBeachIt(beach.end())));429 pit->second ->it =415 pit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end()))); 416 pit->second.it = 430 417 beach.insert(std::make_pair(Part(ppv, prev, next), pit)); 431 418 } else { … … 438 425 double x = circle_point(points[prev], points[next], points[nnt]); 439 426 if (x < sweep) x = sweep; 440 nit = spikeheap.insert(std::make_pair(x, newBeachIt(beach.end())));441 nit->second ->it =427 nit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end()))); 428 nit->second.it = 442 429 beach.insert(std::make_pair(Part(prev, next, nnt), nit)); 443 430 } else {
Note: See TracChangeset
for help on using the changeset viewer.