COIN-OR::LEMON - Graph Library

Changeset 606:c5fd2d996909 in lemon for lemon/dijkstra.h


Ignore:
Timestamp:
03/29/09 23:08:20 (11 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Various doc improvements (#248)

  • Rename all the ugly template parameters (too long and/or starting with an underscore).
  • Rename function parameters starting with an underscore.
  • Extend the doc for many classes.
  • Use LaTeX-style O(...) expressions only for the complicated ones.
  • A lot of small unification changes.
  • Small fixes.
  • Some other improvements.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/dijkstra.h

    r525 r606  
    3939  /// This operation traits class defines all computational operations and
    4040  /// constants which are used in the Dijkstra algorithm.
    41   template <typename Value>
     41  template <typename V>
    4242  struct DijkstraDefaultOperationTraits {
     43    /// \e
     44    typedef V Value;
    4345    /// \brief Gives back the zero value of the type.
    4446    static Value zero() {
     
    5961  ///Default traits class of Dijkstra class.
    6062  ///\tparam GR The type of the digraph.
    61   ///\tparam LM The type of the length map.
    62   template<class GR, class LM>
     63  ///\tparam LEN The type of the length map.
     64  template<typename GR, typename LEN>
    6365  struct DijkstraDefaultTraits
    6466  {
     
    7072    ///The type of the map that stores the arc lengths.
    7173    ///It must meet the \ref concepts::ReadMap "ReadMap" concept.
    72     typedef LM LengthMap;
     74    typedef LEN LengthMap;
    7375    ///The type of the length of the arcs.
    74     typedef typename LM::Value Value;
     76    typedef typename LEN::Value Value;
    7577
    7678    /// Operation traits for %Dijkstra algorithm.
     
    101103    ///\sa BinHeap
    102104    ///\sa Dijkstra
    103     typedef BinHeap<typename LM::Value, HeapCrossRef, std::less<Value> > Heap;
     105    typedef BinHeap<typename LEN::Value, HeapCrossRef, std::less<Value> > Heap;
    104106    ///Instantiates a \c Heap.
    105107
     
    151153    ///The type of the map that stores the distances of the nodes.
    152154    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    153     typedef typename Digraph::template NodeMap<typename LM::Value> DistMap;
     155    typedef typename Digraph::template NodeMap<typename LEN::Value> DistMap;
    154156    ///Instantiates a \c DistMap.
    155157
     
    181183  ///\tparam GR The type of the digraph the algorithm runs on.
    182184  ///The default type is \ref ListDigraph.
    183   ///\tparam LM A \ref concepts::ReadMap "readable" arc map that specifies
     185  ///\tparam LEN A \ref concepts::ReadMap "readable" arc map that specifies
    184186  ///the lengths of the arcs.
    185187  ///It is read once for each arc, so the map may involve in
     
    188190  ///concepts::Digraph::ArcMap "GR::ArcMap<int>".
    189191#ifdef DOXYGEN
    190   template <typename GR, typename LM, typename TR>
     192  template <typename GR, typename LEN, typename TR>
    191193#else
    192194  template <typename GR=ListDigraph,
    193             typename LM=typename GR::template ArcMap<int>,
    194             typename TR=DijkstraDefaultTraits<GR,LM> >
     195            typename LEN=typename GR::template ArcMap<int>,
     196            typename TR=DijkstraDefaultTraits<GR,LEN> >
    195197#endif
    196198  class Dijkstra {
     
    914916  ///Default traits class of dijkstra() function.
    915917  ///\tparam GR The type of the digraph.
    916   ///\tparam LM The type of the length map.
    917   template<class GR, class LM>
     918  ///\tparam LEN The type of the length map.
     919  template<class GR, class LEN>
    918920  struct DijkstraWizardDefaultTraits
    919921  {
     
    924926    ///The type of the map that stores the arc lengths.
    925927    ///It must meet the \ref concepts::ReadMap "ReadMap" concept.
    926     typedef LM LengthMap;
     928    typedef LEN LengthMap;
    927929    ///The type of the length of the arcs.
    928     typedef typename LM::Value Value;
     930    typedef typename LEN::Value Value;
    929931
    930932    /// Operation traits for Dijkstra algorithm.
     
    10081010    ///The type of the map that stores the distances of the nodes.
    10091011    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    1010     typedef typename Digraph::template NodeMap<typename LM::Value> DistMap;
     1012    typedef typename Digraph::template NodeMap<typename LEN::Value> DistMap;
    10111013    ///Instantiates a DistMap.
    10121014
     
    10341036  /// The \ref DijkstraWizardBase is a class to be the default traits of the
    10351037  /// \ref DijkstraWizard class.
    1036   template<class GR,class LM>
    1037   class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LM>
     1038  template<typename GR, typename LEN>
     1039  class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LEN>
    10381040  {
    1039     typedef DijkstraWizardDefaultTraits<GR,LM> Base;
     1041    typedef DijkstraWizardDefaultTraits<GR,LEN> Base;
    10401042  protected:
    10411043    //The type of the nodes in the digraph.
     
    10711073    /// \param g The digraph the algorithm runs on.
    10721074    /// \param l The length map.
    1073     DijkstraWizardBase(const GR &g,const LM &l) :
     1075    DijkstraWizardBase(const GR &g,const LEN &l) :
    10741076      _g(reinterpret_cast<void*>(const_cast<GR*>(&g))),
    1075       _length(reinterpret_cast<void*>(const_cast<LM*>(&l))),
     1077      _length(reinterpret_cast<void*>(const_cast<LEN*>(&l))),
    10761078      _processed(0), _pred(0), _dist(0), _path(0), _di(0) {}
    10771079
     
    12821284  ///\sa DijkstraWizard
    12831285  ///\sa Dijkstra
    1284   template<class GR, class LM>
    1285   DijkstraWizard<DijkstraWizardBase<GR,LM> >
    1286   dijkstra(const GR &digraph, const LM &length)
     1286  template<typename GR, typename LEN>
     1287  DijkstraWizard<DijkstraWizardBase<GR,LEN> >
     1288  dijkstra(const GR &digraph, const LEN &length)
    12871289  {
    1288     return DijkstraWizard<DijkstraWizardBase<GR,LM> >(digraph,length);
     1290    return DijkstraWizard<DijkstraWizardBase<GR,LEN> >(digraph,length);
    12891291  }
    12901292
Note: See TracChangeset for help on using the changeset viewer.