COIN-OR::LEMON - Graph Library

Changeset 802:bc0c74eeb151 in lemon-0.x for src/hugo/dijkstra.h


Ignore:
Timestamp:
09/05/04 22:11:47 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1096
Message:
  • Changes in doc
  • setGraph(...) finally removed from Dijkstra, Bfs and Dfs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/dijkstra.h

    r785 r802  
    5656    ///The type of the underlying graph.
    5757    typedef GR Graph;
     58    ///.
    5859    typedef typename Graph::Node Node;
     60    ///.
    5961    typedef typename Graph::NodeIt NodeIt;
     62    ///.
    6063    typedef typename Graph::Edge Edge;
     64    ///.
    6165    typedef typename Graph::OutEdgeIt OutEdgeIt;
    6266   
     
    7579
    7680  private:
     81    /// Pointer to the underlying graph.
    7782    const Graph *G;
     83    /// Pointer to the length map
    7884    const LM *length;
    79     //    bool local_length;
     85    ///Pointer to the map of predecessors edges.
    8086    PredMap *predecessor;
     87    ///Indicates if \ref predecessor is locally allocated (\c true) or not.
    8188    bool local_predecessor;
     89    ///Pointer to the map of predecessors nodes.
    8290    PredNodeMap *pred_node;
     91    ///Indicates if \ref pred_node is locally allocated (\c true) or not.
    8392    bool local_pred_node;
     93    ///Pointer to the map of distances.
    8494    DistMap *distance;
     95    ///Indicates if \ref distance is locally allocated (\c true) or not.
    8596    bool local_distance;
    8697
    87     //The source node of the last execution.
     98    ///The source node of the last execution.
    8899    Node source;
    89100
     
    94105    void init_maps()
    95106    {
    96 //       if(!length) {
    97 //      local_length = true;
    98 //      length = new LM(G);
    99 //       }
    100107      if(!predecessor) {
    101108        local_predecessor = true;
     
    113120   
    114121  public :
    115    
     122    ///Constructor.
     123   
     124    ///\param _G the graph the algorithm will run on.
     125    ///\param _length the length map used by the algorithm.
    116126    Dijkstra(const Graph& _G, const LM& _length) :
    117127      G(&_G), length(&_length),
     
    121131    { }
    122132   
     133    ///Destructor.
    123134    ~Dijkstra()
    124135    {
    125       //      if(local_length) delete length;
    126136      if(local_predecessor) delete predecessor;
    127137      if(local_pred_node) delete pred_node;
     
    129139    }
    130140
    131     ///Sets the graph the algorithm will run on.
    132 
    133     ///Sets the graph the algorithm will run on.
    134     ///\return <tt> (*this) </tt>
    135     ///\bug What about maps?
    136     ///\todo It may be unnecessary
    137     Dijkstra &setGraph(const Graph &_G)
    138     {
    139       G = &_G;
    140       return *this;
    141     }
    142141    ///Sets the length map.
    143142
     
    146145    Dijkstra &setLengthMap(const LM &m)
    147146    {
    148 //       if(local_length) {
    149 //      delete length;
    150 //      local_length=false;
    151 //       }
    152147      length = &m;
    153148      return *this;
     
    318313
    319314    ///Returns \c true if \c v is reachable from the root.
    320     ///\warning the root node is reported to be reached!
     315    ///\note The root node is reported to be reached!
    321316    ///\pre \ref run() must be called before using this function.
    322317    ///
Note: See TracChangeset for help on using the changeset viewer.