COIN-OR::LEMON - Graph Library

Changes in / [1110:489e243cfcb7:1108:e00d7b681d8e] in lemon-main


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/lgf-gen.cc

    r1109 r654  
    247247  struct BeachIt;
    248248
    249   typedef std::multimap<double, BeachIt*> SpikeHeap;
     249  typedef std::multimap<double, BeachIt> SpikeHeap;
    250250
    251251  typedef std::multimap<Part, SpikeHeap::iterator, YLess> Beach;
     
    330330
    331331      if (bit->second != spikeheap.end()) {
    332         delete bit->second->second;
    333332        spikeheap.erase(bit->second);
    334333      }
     
    344343          circle_form(points[prev], points[curr], points[site])) {
    345344        double x = circle_point(points[prev], points[curr], points[site]);
    346         pit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end())));
    347         pit->second->it =
     345        pit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end())));
     346        pit->second.it =
    348347          beach.insert(std::make_pair(Part(prev, curr, site), pit));
    349348      } else {
     
    357356          circle_form(points[site], points[curr],points[next])) {
    358357        double x = circle_point(points[site], points[curr], points[next]);
    359         nit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end())));
    360         nit->second->it =
     358        nit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end())));
     359        nit->second.it =
    361360          beach.insert(std::make_pair(Part(site, curr, next), nit));
    362361      } else {
     
    368367      sweep = spit->first;
    369368
    370       Beach::iterator bit = spit->second->it;
     369      Beach::iterator bit = spit->second.it;
    371370
    372371      int prev = bit->first.prev;
     
    401400      int nnt = nbit->first.next;
    402401
    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
    419406      beach.erase(nbit);
    420407      beach.erase(bit);
     
    426413        double x = circle_point(points[ppv], points[prev], points[next]);
    427414        if (x < sweep) x = sweep;
    428         pit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end())));
    429         pit->second->it =
     415        pit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end())));
     416        pit->second.it =
    430417          beach.insert(std::make_pair(Part(ppv, prev, next), pit));
    431418      } else {
     
    438425        double x = circle_point(points[prev], points[next], points[nnt]);
    439426        if (x < sweep) x = sweep;
    440         nit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end())));
    441         nit->second->it =
     427        nit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end())));
     428        nit->second.it =
    442429          beach.insert(std::make_pair(Part(prev, next, nnt), nit));
    443430      } else {
Note: See TracChangeset for help on using the changeset viewer.