Changeset 831:b6ae3446098a in lemon-0.x for src/hugo/skeletons
- Timestamp:
- 09/12/04 23:46:26 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1129
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/skeletons/path.h
r823 r831 1 #define SKELETON2 1 // -*- c++ -*- // 3 2 … … 6 5 ///\brief Classes for representing paths in graphs. 7 6 8 #ifndef HUGO_ PATH_H9 #define HUGO_ PATH_H7 #ifndef HUGO_SKELETON_PATH_H 8 #define HUGO_SKELETON_PATH_H 10 9 11 10 #include <hugo/invalid.h> … … 15 14 /// \addtogroup skeletons 16 15 /// @{ 17 18 16 17 19 18 //! \brief A skeletom structure for representing directed paths in a graph. 20 19 //! 21 20 //! A skeleton structure for representing directed paths in a graph. 22 21 //! \param GR The graph type in which the path is. 23 //! 22 //! 24 23 //! In a sense, the path can be treated as a graph, for is has \c NodeIt 25 24 //! and \c EdgeIt with the same usage. These types converts to the \c Node … … 28 27 class Path { 29 28 public: 30 29 31 30 /// Type of the underlying graph. 32 31 typedef /*typename*/ GR Graph; 33 32 /// Edge type of the underlying graph. 34 typedef typename Graph::Edge GraphEdge; 33 typedef typename Graph::Edge GraphEdge; 35 34 /// Node type of the underlying graph. 36 35 typedef typename Graph::Node GraphNode; 37 36 class NodeIt; 38 37 class EdgeIt; 39 38 40 39 /// \param _G The graph in which the path is. 41 40 /// 42 41 Path(const Graph &_G) {} 43 42 44 43 /// Length of the path. 45 44 size_t length() const {return 0;} 46 45 /// Returns whether the path is empty. 47 bool empty() const { }48 46 bool empty() const { return true;} 47 49 48 /// Resets the path to an empty path. 50 49 void clear() {} … … 72 71 /// Returns node iterator pointing to the head node of the 73 72 /// given edge iterator. 74 NodeIt head(const EdgeIt& e) const { }73 NodeIt head(const EdgeIt& e) const {return INVALID;} 75 74 76 75 /// \brief The tail of an edge. … … 78 77 /// Returns node iterator pointing to the tail node of the 79 78 /// given edge iterator. 80 NodeIt tail(const EdgeIt& e) const { }79 NodeIt tail(const EdgeIt& e) const {return INVALID;} 81 80 82 81 … … 85 84 /** 86 85 * \brief Iterator class to iterate on the edges of the paths 87 * 86 * 88 87 * \ingroup skeletons 89 88 * This class is used to iterate on the edges of the paths 90 89 * 91 90 * Of course it converts to Graph::Edge 92 * 91 * 93 92 */ 94 93 class EdgeIt { … … 104 103 105 104 /// Next edge 106 EdgeIt& operator++() { }105 EdgeIt& operator++() {return *this;} 107 106 108 107 /// Comparison operator … … 118 117 /** 119 118 * \brief Iterator class to iterate on the nodes of the paths 120 * 119 * 121 120 * \ingroup skeletons 122 121 * This class is used to iterate on the nodes of the paths 123 122 * 124 123 * Of course it converts to Graph::Node. 125 * 124 * 126 125 */ 127 126 class NodeIt { … … 137 136 operator const GraphNode& () const {} 138 137 /// 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;} 145 144 // /// Comparison operator 146 145 // /// \todo It is not clear what is the "natural" ordering. … … 149 148 }; 150 149 151 friend class Builder; 150 friend class Builder; 152 151 153 152 /** 154 153 * \brief Class to build paths 155 * 154 * 156 155 * \ingroup skeletons 157 156 * This class is used to fill a path with edges. … … 175 174 176 175 /// Sets the starting node of the path. 177 176 178 177 /// Sets the starting node of the path. Edge added to the path 179 178 /// afterwards have to be incident to this node. … … 218 217 ///@} 219 218 } 220 219 221 220 } // namespace hugo 222 221 223 #endif // HUGO_ PATH_H222 #endif // HUGO_SKELETON_PATH_H
Note: See TracChangeset
for help on using the changeset viewer.