COIN-OR::LEMON - Graph Library

Changeset 802:bc0c74eeb151 in lemon-0.x for src


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.
Location:
src/hugo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/bfs.h

    r781 r802  
    3535    ///The type of the underlying graph.
    3636    typedef GR Graph;
     37    ///.
    3738    typedef typename Graph::Node Node;
     39    ///.
    3840    typedef typename Graph::NodeIt NodeIt;
     41    ///.
    3942    typedef typename Graph::Edge Edge;
     43    ///.
    4044    typedef typename Graph::OutEdgeIt OutEdgeIt;
    4145   
     
    5054
    5155  private:
     56    /// Pointer to the underlying graph.
    5257    const Graph *G;
     58    ///Pointer to the map of predecessors edges.
    5359    PredMap *predecessor;
     60    ///Indicates if \ref predecessor is locally allocated (\c true) or not.
    5461    bool local_predecessor;
     62    ///Pointer to the map of predecessors nodes.
    5563    PredNodeMap *pred_node;
     64    ///Indicates if \ref pred_node is locally allocated (\c true) or not.
    5665    bool local_pred_node;
     66    ///Pointer to the map of distances.
    5767    DistMap *distance;
     68    ///Indicates if \ref distance is locally allocated (\c true) or not.
    5869    bool local_distance;
    5970
    60     //The source node of the last execution.
     71    ///The source node of the last execution.
    6172    Node source;
    6273
     
    8091   
    8192  public :   
     93    ///Constructor.
     94   
     95    ///\param _G the graph the algorithm will run on.
    8296    Bfs(const Graph& _G) :
    8397      G(&_G),
     
    87101    { }
    88102   
     103    ///Destructor.
    89104    ~Bfs()
    90105    {
     
    94109    }
    95110
    96     ///Sets the graph the algorithm will run on.
    97 
    98     ///Sets the graph the algorithm will run on.
    99     ///\return <tt> (*this) </tt>
    100     ///\bug What about maps?
    101     ///\todo It may be unnecessary
    102     Bfs &setGraph(const Graph &_G)
    103     {
    104       G = &_G;
    105       return *this;
    106     }
    107111    ///Sets the map storing the predecessor edges.
    108112
     
    250254
    251255    ///Returns \c true if \c v is reachable from the root.
    252     ///\warning The root node is reported to be reached!
     256    ///\note The root node is reported to be reached!
    253257    ///
    254258    ///\pre \ref run() must be called before using this function.
  • src/hugo/dfs.h

    r781 r802  
    3434    ///The type of the underlying graph.
    3535    typedef GR Graph;
     36    /// .
    3637    typedef typename Graph::Node Node;
     38    /// .
    3739    typedef typename Graph::NodeIt NodeIt;
     40    /// .
    3841    typedef typename Graph::Edge Edge;
     42    /// .
    3943    typedef typename Graph::OutEdgeIt OutEdgeIt;
    4044   
     
    4953
    5054  private:
     55    /// Pointer to the underlying graph.
    5156    const Graph *G;
     57    ///Pointer to the map of predecessors edges.
    5258    PredMap *predecessor;
     59    ///Indicates if \ref predecessor is locally allocated (\c true) or not.
    5360    bool local_predecessor;
     61    ///Pointer to the map of predecessors nodes.
    5462    PredNodeMap *pred_node;
     63    ///Indicates if \ref pred_node is locally allocated (\c true) or not.
    5564    bool local_pred_node;
     65    ///Pointer to the map of distances.
    5666    DistMap *distance;
     67    ///Indicates if \ref distance is locally allocated (\c true) or not.
    5768    bool local_distance;
    5869
    59     //The source node of the last execution.
     70    ///The source node of the last execution.
    6071    Node source;
    6172
     
    7990   
    8091  public :   
     92    ///Constructor.
     93   
     94    ///\param _G the graph the algorithm will run on.
    8195    Dfs(const Graph& _G) :
    8296      G(&_G),
     
    86100    { }
    87101   
     102    ///Destructor.
    88103    ~Dfs()
    89104    {
     
    93108    }
    94109
    95     ///Sets the graph the algorithm will run on.
    96 
    97     ///Sets the graph the algorithm will run on.
    98     ///\return <tt> (*this) </tt>
    99     ///\bug What about maps?
    100     ///\todo It may be unnecessary
    101     Dfs &setGraph(const Graph &_G)
    102     {
    103       G = &_G;
    104       return *this;
    105     }
    106110    ///Sets the map storing the predecessor edges.
    107111
     
    254258
    255259    ///Returns \c true if \c v is reachable from the root.
    256     ///\warning The root node is reported to be reached!
     260    ///\note The root node is reported to be reached!
    257261    ///
    258262    ///\pre \ref run() must be called before using this function.
  • 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.