COIN-OR::LEMON - Graph Library

Changeset 2386:81b47fc5c444 in lemon-0.x for lemon/dijkstra.h


Ignore:
Timestamp:
03/02/07 19:04:28 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3217
Message:

Hard Warning checking

  • based on the remark of the ZIB user
  • we do not use -Winline
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/dijkstra.h

    r2376 r2386  
    488488    ///automatically allocated heap and cross reference, of course.
    489489    ///\return <tt> (*this) </tt>
    490     Dijkstra &heap(Heap& heap, HeapCrossRef &crossRef)
     490    Dijkstra &heap(Heap& hp, HeapCrossRef &cr)
    491491    {
    492492      if(local_heap_cross_ref) {
     
    494494        local_heap_cross_ref=false;
    495495      }
    496       _heap_cross_ref = &crossRef;
     496      _heap_cross_ref = &cr;
    497497      if(local_heap) {
    498498        delete _heap;
    499499        local_heap=false;
    500500      }
    501       _heap = &heap;
     501      _heap = &hp;
    502502      return *this;
    503503    }
     
    963963    /// \param s is the initial value of  \ref _source
    964964    DijkstraWizardBase(const GR &g,const LM &l, Node s=INVALID) :
    965       _g((void *)&g), _length((void *)&l), _pred(0),
    966       _dist(0), _source(s) {}
     965      _g(reinterpret_cast<void*>(const_cast<GR*>(&g))),
     966      _length(reinterpret_cast<void*>(const_cast<LM*>(&l))),
     967      _pred(0), _dist(0), _source(s) {}
    967968
    968969  };
     
    10381039      if(Base::_source==INVALID) throw UninitializedParameter();
    10391040      Dijkstra<Graph,LengthMap,TR>
    1040         dij(*(Graph*)Base::_g,*(LengthMap*)Base::_length);
    1041       if(Base::_pred) dij.predMap(*(PredMap*)Base::_pred);
    1042       if(Base::_dist) dij.distMap(*(DistMap*)Base::_dist);
     1041        dij(*reinterpret_cast<const Graph*>(Base::_g),
     1042            *reinterpret_cast<const LengthMap*>(Base::_length));
     1043      if(Base::_pred) dij.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
     1044      if(Base::_dist) dij.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
    10431045      dij.run(Base::_source);
    10441046    }
     
    10701072    DijkstraWizard<DefPredMapBase<T> > predMap(const T &t)
    10711073    {
    1072       Base::_pred=(void *)&t;
     1074      Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t));
    10731075      return DijkstraWizard<DefPredMapBase<T> >(*this);
    10741076    }
     
    10901092    DijkstraWizard<DefDistMapBase<T> > distMap(const T &t)
    10911093    {
    1092       Base::_dist=(void *)&t;
     1094      Base::_dist=reinterpret_cast<void*>(const_cast<T*>(&t));
    10931095      return DijkstraWizard<DefDistMapBase<T> >(*this);
    10941096    }
Note: See TracChangeset for help on using the changeset viewer.