COIN-OR::LEMON - Graph Library

Changeset 831:b6ae3446098a in lemon-0.x for src/hugo/skeletons/path.h


Ignore:
Timestamp:
09/12/04 23:46:26 (16 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1129
Message:

The first version of new path test program. The old became old_path_test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/skeletons/path.h

    r823 r831  
    1 #define SKELETON
    21// -*- c++ -*- //
    32
     
    65///\brief Classes for representing paths in graphs.
    76
    8 #ifndef HUGO_PATH_H
    9 #define HUGO_PATH_H
     7#ifndef HUGO_SKELETON_PATH_H
     8#define HUGO_SKELETON_PATH_H
    109
    1110#include <hugo/invalid.h>
     
    1514    /// \addtogroup skeletons
    1615    /// @{
    17    
    18    
     16
     17
    1918    //! \brief A skeletom structure for representing directed paths in a graph.
    2019    //!
    2120    //! A skeleton structure for representing directed paths in a graph.
    2221    //! \param GR The graph type in which the path is.
    23     //! 
     22    //!
    2423    //! In a sense, the path can be treated as a graph, for is has \c NodeIt
    2524    //! and \c EdgeIt with the same usage. These types converts to the \c Node
     
    2827    class Path {
    2928    public:
    30      
     29
    3130      /// Type of the underlying graph.
    3231      typedef /*typename*/ GR Graph;
    3332      /// Edge type of the underlying graph.
    34       typedef typename Graph::Edge GraphEdge; 
     33      typedef typename Graph::Edge GraphEdge;
    3534      /// Node type of the underlying graph.
    3635     typedef typename Graph::Node GraphNode;
    3736      class NodeIt;
    3837      class EdgeIt;
    39      
     38
    4039      /// \param _G The graph in which the path is.
    4140      ///
    4241      Path(const Graph &_G) {}
    43      
     42
    4443      /// Length of the path.
    4544      size_t length() const {return 0;}
    4645      /// Returns whether the path is empty.
    47       bool empty() const {}
    48      
     46      bool empty() const { return true;}
     47
    4948      /// Resets the path to an empty path.
    5049      void clear() {}
     
    7271      /// Returns node iterator pointing to the head node of the
    7372      /// given edge iterator.
    74       NodeIt head(const EdgeIt& e) const {}
     73      NodeIt head(const EdgeIt& e) const {return INVALID;}
    7574
    7675      /// \brief The tail of an edge.
     
    7877      /// Returns node iterator pointing to the tail node of the
    7978      /// given edge iterator.
    80       NodeIt tail(const EdgeIt& e) const {}
     79      NodeIt tail(const EdgeIt& e) const {return INVALID;}
    8180
    8281
     
    8584      /**
    8685       * \brief Iterator class to iterate on the edges of the paths
    87        * 
     86       *
    8887       * \ingroup skeletons
    8988       * This class is used to iterate on the edges of the paths
    9089       *
    9190       * Of course it converts to Graph::Edge
    92        * 
     91       *
    9392       */
    9493      class EdgeIt {
     
    104103
    105104        /// Next edge
    106         EdgeIt& operator++() {}
     105        EdgeIt& operator++() {return *this;}
    107106
    108107        /// Comparison operator
     
    118117      /**
    119118       * \brief Iterator class to iterate on the nodes of the paths
    120        * 
     119       *
    121120       * \ingroup skeletons
    122121       * This class is used to iterate on the nodes of the paths
    123122       *
    124123       * Of course it converts to Graph::Node.
    125        * 
     124       *
    126125       */
    127126      class NodeIt {
     
    137136        operator const GraphNode& () const {}
    138137        /// Next node
    139         NodeIt& operator++() {}
    140 
    141         /// Comparison operator
    142         bool operator==(const NodeIt& e) const {}
    143         /// Comparison operator
    144         bool operator!=(const NodeIt& e) const {}
     138        NodeIt& operator++() {return *this;}
     139
     140        /// Comparison operator
     141        bool operator==(const NodeIt& e) const {return true;}
     142        /// Comparison operator
     143        bool operator!=(const NodeIt& e) const {return true;}
    145144//      /// Comparison operator
    146145//      /// \todo It is not clear what is the "natural" ordering.
     
    149148      };
    150149
    151       friend class Builder;   
     150      friend class Builder;
    152151
    153152      /**
    154153       * \brief Class to build paths
    155        * 
     154       *
    156155       * \ingroup skeletons
    157156       * This class is used to fill a path with edges.
     
    175174
    176175        /// Sets the starting node of the path.
    177      
     176
    178177        /// Sets the starting node of the path. Edge added to the path
    179178        /// afterwards have to be incident to this node.
     
    218217  ///@}
    219218  }
    220  
     219
    221220} // namespace hugo
    222221
    223 #endif // HUGO_PATH_H
     222#endif // HUGO_SKELETON_PATH_H
Note: See TracChangeset for help on using the changeset viewer.