COIN-OR::LEMON - Graph Library

Changeset 525:9605e051942f in lemon for lemon/dijkstra.h


Ignore:
Timestamp:
02/23/09 12:10:26 (15 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Various doc improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/dijkstra.h

    r463 r525  
    7474    typedef typename LM::Value Value;
    7575
    76     /// Operation traits for Dijkstra algorithm.
     76    /// Operation traits for %Dijkstra algorithm.
    7777
    7878    /// This class defines the operations that are used in the algorithm.
     
    8585    /// Usually it is \c Digraph::NodeMap<int>.
    8686    typedef typename Digraph::template NodeMap<int> HeapCrossRef;
    87     ///Instantiates a \ref HeapCrossRef.
     87    ///Instantiates a \c HeapCrossRef.
    8888
    8989    ///This function instantiates a \ref HeapCrossRef.
     
    9595    }
    9696
    97     ///The heap type used by the Dijkstra algorithm.
     97    ///The heap type used by the %Dijkstra algorithm.
    9898
    9999    ///The heap type used by the Dijkstra algorithm.
     
    102102    ///\sa Dijkstra
    103103    typedef BinHeap<typename LM::Value, HeapCrossRef, std::less<Value> > Heap;
    104     ///Instantiates a \ref Heap.
     104    ///Instantiates a \c Heap.
    105105
    106106    ///This function instantiates a \ref Heap.
     
    117117    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    118118    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    119     ///Instantiates a PredMap.
    120 
    121     ///This function instantiates a PredMap.
     119    ///Instantiates a \c PredMap.
     120
     121    ///This function instantiates a \ref PredMap.
    122122    ///\param g is the digraph, to which we would like to define the
    123     ///PredMap.
     123    ///\ref PredMap.
    124124    static PredMap *createPredMap(const Digraph &g)
    125125    {
     
    133133    ///By default it is a NullMap.
    134134    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    135     ///Instantiates a ProcessedMap.
    136 
    137     ///This function instantiates a ProcessedMap.
     135    ///Instantiates a \c ProcessedMap.
     136
     137    ///This function instantiates a \ref ProcessedMap.
    138138    ///\param g is the digraph, to which
    139     ///we would like to define the ProcessedMap
     139    ///we would like to define the \ref ProcessedMap.
    140140#ifdef DOXYGEN
    141141    static ProcessedMap *createProcessedMap(const Digraph &g)
     
    152152    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    153153    typedef typename Digraph::template NodeMap<typename LM::Value> DistMap;
    154     ///Instantiates a DistMap.
    155 
    156     ///This function instantiates a DistMap.
     154    ///Instantiates a \c DistMap.
     155
     156    ///This function instantiates a \ref DistMap.
    157157    ///\param g is the digraph, to which we would like to define
    158     ///the DistMap
     158    ///the \ref DistMap.
    159159    static DistMap *createDistMap(const Digraph &g)
    160160    {
     
    217217    ///The heap type used by the algorithm.
    218218    typedef typename TR::Heap Heap;
    219     ///The operation traits class.
     219    ///\brief The \ref DijkstraDefaultOperationTraits "operation traits class"
     220    ///of the algorithm.
    220221    typedef typename TR::OperationTraits OperationTraits;
    221222
     
    233234    const Digraph *G;
    234235    //Pointer to the length map.
    235     const LengthMap *length;
     236    const LengthMap *_length;
    236237    //Pointer to the map of predecessors arcs.
    237238    PredMap *_pred;
     
    298299    };
    299300    ///\brief \ref named-templ-param "Named parameter" for setting
    300     ///PredMap type.
     301    ///\c PredMap type.
    301302    ///
    302303    ///\ref named-templ-param "Named parameter" for setting
    303     ///PredMap type.
     304    ///\c PredMap type.
    304305    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    305306    template <class T>
     
    319320    };
    320321    ///\brief \ref named-templ-param "Named parameter" for setting
    321     ///DistMap type.
     322    ///\c DistMap type.
    322323    ///
    323324    ///\ref named-templ-param "Named parameter" for setting
    324     ///DistMap type.
     325    ///\c DistMap type.
    325326    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    326327    template <class T>
     
    340341    };
    341342    ///\brief \ref named-templ-param "Named parameter" for setting
    342     ///ProcessedMap type.
     343    ///\c ProcessedMap type.
    343344    ///
    344345    ///\ref named-templ-param "Named parameter" for setting
    345     ///ProcessedMap type.
     346    ///\c ProcessedMap type.
    346347    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    347348    template <class T>
     
    359360    };
    360361    ///\brief \ref named-templ-param "Named parameter" for setting
    361     ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
     362    ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
    362363    ///
    363364    ///\ref named-templ-param "Named parameter" for setting
    364     ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
     365    ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
    365366    ///If you don't set it explicitly, it will be automatically allocated.
    366367    struct SetStandardProcessedMap
     
    440441    ///
    441442    ///\ref named-templ-param "Named parameter" for setting
    442     ///\ref OperationTraits type.
     443    ///\c OperationTraits type.
    443444    template <class T>
    444445    struct SetOperationTraits
     
    459460
    460461    ///Constructor.
    461     ///\param _g The digraph the algorithm runs on.
    462     ///\param _length The length map used by the algorithm.
    463     Dijkstra(const Digraph& _g, const LengthMap& _length) :
    464       G(&_g), length(&_length),
     462    ///\param g The digraph the algorithm runs on.
     463    ///\param length The length map used by the algorithm.
     464    Dijkstra(const Digraph& g, const LengthMap& length) :
     465      G(&g), _length(&length),
    465466      _pred(NULL), local_pred(false),
    466467      _dist(NULL), local_dist(false),
     
    486487    Dijkstra &lengthMap(const LengthMap &m)
    487488    {
    488       length = &m;
     489      _length = &m;
    489490      return *this;
    490491    }
     
    639640        switch(_heap->state(w)) {
    640641        case Heap::PRE_HEAP:
    641           _heap->push(w,OperationTraits::plus(oldvalue, (*length)[e]));
     642          _heap->push(w,OperationTraits::plus(oldvalue, (*_length)[e]));
    642643          _pred->set(w,e);
    643644          break;
    644645        case Heap::IN_HEAP:
    645646          {
    646             Value newvalue = OperationTraits::plus(oldvalue, (*length)[e]);
     647            Value newvalue = OperationTraits::plus(oldvalue, (*_length)[e]);
    647648            if ( OperationTraits::less(newvalue, (*_heap)[w]) ) {
    648649              _heap->decrease(w, newvalue);
Note: See TracChangeset for help on using the changeset viewer.