COIN-OR::LEMON - Graph Library

Changeset 1123:a2e93889a604 in lemon-0.x


Ignore:
Timestamp:
02/04/05 16:32:11 (15 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1522
Message:

Documentation is developing itself, but is not ready yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/alpar/dijkstra.h

    r1119 r1123  
    7373    ///Instantiates a PredMap.
    7474 
    75     ///\todo Please document...
     75    ///This function instantiates a \ref PredMap.
     76    ///\param G is the graph, to which we would like to define the PredMap.
    7677    ///\todo The graph alone may be insufficient for the initialization
    7778    static PredMap *createPredMap(const GR &G)
     
    8788    ///Instantiates a PredNodeMap.
    8889 
    89     ///\todo Please document...
    90     ///
     90    ///This function instantiates a \ref PredNodeMap.
     91    ///\param G is the graph, to which we would like to define the \ref PredNodeMap
    9192    static PredNodeMap *createPredNodeMap(const GR &G)
    9293    {
     
    103104    ///Instantiates a ReachedMap.
    104105 
    105     ///\todo Please document...
    106     ///
     106    ///This function instantiates a \ref ReachedMap.
     107    ///\param G is the graph, to which we would like to define the \ref ReachedMap
    107108    static ReachedMap *createReachedMap(const GR &G)
    108109    {
     
    116117    ///Instantiates a DistMap.
    117118 
    118     ///\todo Please document...
    119     ///
     119    ///This function instantiates a \ref DistMap.
     120    ///\param G is the graph, to which we would like to define the \ref DistMap
    120121    static DistMap *createDistMap(const GR &G)
    121122    {
     
    507508  };
    508509
     510  /// Default traits used by \ref DijkstraWizard
     511
     512  /// To make it easier to use Dijkstra algorithm we created a wizard class.
     513  /// This \ref DijkstraWizard class also needs default traits.
     514  /// The \ref DijkstraWizardBase is a class to be the default traits of the
     515  /// \ref DijkstraWizard class.
    509516  template<class GR,class LM>
    510517  class DijkstraWizardBase : public DijkstraDefaultTraits<GR,LM>
     
    526533    void *_source;
    527534
     535    /// Type of the nodes in the graph.
    528536    typedef typename Base::Graph::Node Node;
    529537
    530538    public:
     539    /// Constructor.
     540   
     541    /// This constructor does not require parameters, therefore it initiates
     542    /// all of the attributes to default values (0, INVALID).
    531543    DijkstraWizardBase() : _g(0), _length(0), _pred(0), _predNode(0),
    532544                       _dist(0), _source(INVALID) {}
    533545
     546    /// Constructor.
     547   
     548    /// This constructor requires some parameters, listed in the parameters list.
     549    /// Others are initiated to 0.
     550    /// \param g is the initial value of  \ref _g
     551    /// \param l is the initial value of  \ref _length
     552    /// \param s is the initial value of  \ref _source
    534553    DijkstraWizardBase(const GR &g,const LM &l, Node s=INVALID) :
    535554      _g((void *)&g), _length((void *)&l), _pred(0), _predNode(0),
     
    538557  };
    539558 
    540   ///\e
    541 
    542   ///\e
     559  /// A class to make easier the usage of Dijkstra algorithm
     560
     561  /// This class is created to make it easier to use Dijkstra algorithm.
     562  /// It uses the functions and features of the plain \ref Dijkstra,
     563  /// but it is much more simple to use it.
    543564  ///
     565  /// Simplicity means that the way to change the types defined
     566  /// in the traits class is based on functions that returns the new class
     567  /// and not on templatable built-in classes. When using the plain \Dijkstra
     568  /// the new class with the modified type comes from the original by using the ::
     569  /// operator. In this case only a function have to be called and it will
     570  /// return the needed class.
     571  ///
     572  /// It does not have own \ref run method. When its \ref run method is called
     573  /// it initiates a plain \ref Dijkstra class, and calls the \ref Dijkstra::run
     574  /// method of it.
    544575  template<class TR>
    545576  class DijkstraWizard : public TR
     
    547578    typedef TR Base;
    548579
    549     //The type of the underlying graph.
     580    ///The type of the underlying graph.
    550581    typedef typename TR::Graph Graph;
    551582    //\e
     
    558589    typedef typename Graph::OutEdgeIt OutEdgeIt;
    559590   
    560     //The type of the map that stores the edge lengths.
     591    ///The type of the map that stores the edge lengths.
    561592    typedef typename TR::LengthMap LengthMap;
    562     //The type of the length of the edges.
     593    ///The type of the length of the edges.
    563594    typedef typename LengthMap::Value Value;
    564     //\brief The type of the map that stores the last
    565     //edges of the shortest paths.
     595    ///\brief The type of the map that stores the last
     596    ///edges of the shortest paths.
    566597    typedef typename TR::PredMap PredMap;
    567     //\brief The type of the map that stores the last but one
    568     //nodes of the shortest paths.
     598    ///\brief The type of the map that stores the last but one
     599    ///nodes of the shortest paths.
    569600    typedef typename TR::PredNodeMap PredNodeMap;
    570     //The type of the map that stores the dists of the nodes.
     601    ///The type of the map that stores the dists of the nodes.
    571602    typedef typename TR::DistMap DistMap;
    572603
    573     //The heap type used by the dijkstra algorithm.
     604    ///The heap type used by the dijkstra algorithm.
    574605    typedef typename TR::Heap Heap;
    575606public:
     607    /// Constructor.
    576608    DijkstraWizard() : TR() {}
    577609
     610    /// Constructor that requires parameters.
     611    /// These parameters will be the default values for the traits class.
    578612    DijkstraWizard(const Graph &g,const LengthMap &l, Node s=INVALID) :
    579613      TR(g,l,s) {}
    580614
     615    ///Copy constructor
    581616    DijkstraWizard(const TR &b) : TR(b) {}
    582617
    583618    ~DijkstraWizard() {}
    584619
    585     ///\e
     620    ///Runs Dijkstra algorithm from a given node.
     621   
     622    ///Runs Dijkstra algorithm from a given node.
     623    ///The node can be given by the \ref source function.
    586624    void run()
    587625    {
     
    594632    }
    595633
    596     ///\e
     634    ///Runs Dijkstra algorithm from a given node.
     635
     636    ///Runs Dijkstra algorithm from a given node.
     637    ///\param s is the given source.
    597638    void run(Node s)
    598639    {
     
    608649    };
    609650   
    610     ///\e
     651    /// \ref named-templ-param "Named parameter" function for setting PredMap type
     652
     653    /// \ref named-templ-param "Named parameter" function for setting PredMap type
    611654    template<class T>
    612655    DijkstraWizard<DefPredMapBase<T> > predMap(const T &t)
     
    624667    };
    625668   
    626     ///\e
     669    /// \ref named-templ-param "Named parameter" function for setting PredNodeMap type
     670
     671    /// \ref named-templ-param "Named parameter" function for setting PredNodeMap type
    627672    template<class T>
    628673    DijkstraWizard<DefPredNodeMapBase<T> > predNodeMap(const T &t)
     
    639684    };
    640685   
    641     ///\e
     686    /// \ref named-templ-param "Named parameter" function for setting DistMap type
     687
     688    /// \ref named-templ-param "Named parameter" function for setting DistMap type
    642689    template<class T>
    643690    DijkstraWizard<DefDistMapBase<T> > distMap(const T &t)
     
    647694    }
    648695   
    649     ///\e
     696    /// Sets the source node, from which the Dijkstra algorithm runs.
     697
     698    /// Sets the source node, from which the Dijkstra algorithm runs.
     699    /// \param s is the source node.
    650700    DijkstraWizard<TR> &source(Node s)
    651701    {
Note: See TracChangeset for help on using the changeset viewer.