A sample file.
6 ///\brief Classes for representing paths in graphs.
11 #include <lemon/invalid.h>
15 /// \addtogroup concept
19 //! \brief A skeleton structure for representing directed paths in a graph.
21 //! A skeleton structure for representing directed paths in a graph.
22 //! \param GR The graph type in which the path is.
24 //! In a sense, the path can be treated as a graph, for is has \c NodeIt
25 //! and \c EdgeIt with the same usage. These types converts to the \c Node
26 //! and \c Edge of the original graph.
31 /// Type of the underlying graph.
32 typedef /*typename*/ GR Graph;
33 /// Edge type of the underlying graph.
34 typedef typename Graph::Edge GraphEdge;
35 /// Node type of the underlying graph.
36 typedef typename Graph::Node GraphNode;
40 /// \param _G The graph in which the path is.
42 Path(const Graph &_G) {}
44 /// Length of the path.
45 size_t length() const {}
46 /// Returns whether the path is empty.
49 /// Resets the path to an empty path.
52 /// \brief Starting point of the path.
54 /// Starting point of the path.
55 /// Returns INVALID if the path is empty.
56 GraphNode target() const {}
57 /// \brief End point of the path.
59 /// End point of the path.
60 /// Returns INVALID if the path is empty.
61 GraphNode source() const {}
63 /// \brief First NodeIt/EdgeIt.
65 /// Initializes node or edge iterator to point to the first
68 It& first(It &i) const { return i=It(*this); }
70 /// \brief The target of an edge.
72 /// Returns node iterator pointing to the target node of the
73 /// given edge iterator.
74 NodeIt target(const EdgeIt& e) const {}
76 /// \brief The source of an edge.
78 /// Returns node iterator pointing to the source node of the
79 /// given edge iterator.
80 NodeIt source(const EdgeIt& e) const {}
83 /* Iterator classes */
86 * \brief Iterator class to iterate on the edges of the paths
89 * This class is used to iterate on the edges of the paths
91 * Of course it converts to Graph::Edge
96 /// Default constructor
98 /// Invalid constructor
100 /// Constructor with starting point
101 EdgeIt(const Path &_p) {}
103 operator GraphEdge () const {}
106 EdgeIt& operator++() {}
108 /// Comparison operator
109 bool operator==(const EdgeIt& e) const {}
110 /// Comparison operator
111 bool operator!=(const EdgeIt& e) const {}
112 // /// Comparison operator
113 // /// \todo It is not clear what is the "natural" ordering.
114 // bool operator<(const EdgeIt& e) const {}
119 * \brief Iterator class to iterate on the nodes of the paths
122 * This class is used to iterate on the nodes of the paths
124 * Of course it converts to Graph::Node.
129 /// Default constructor
131 /// Invalid constructor
133 /// Constructor with starting point
134 NodeIt(const Path &_p) {}
136 ///Conversion to Graph::Node
137 operator const GraphNode& () const {}
139 NodeIt& operator++() {}
141 /// Comparison operator
142 bool operator==(const NodeIt& e) const {}
143 /// Comparison operator
144 bool operator!=(const NodeIt& e) const {}
145 // /// Comparison operator
146 // /// \todo It is not clear what is the "natural" ordering.
147 // bool operator<(const NodeIt& e) const {}
151 friend class Builder;
154 * \brief Class to build paths
157 * This class is used to fill a path with edges.
159 * You can push new edges to the front and to the back of the path in
160 * arbitrary order then you should commit these changes to the graph.
162 * While the builder is active (after the first modifying
163 * operation and until the call of \ref commit())
164 * the underlining Path is in a
165 * "transitional" state (operations on it have undefined result).
172 ///\param _P the path you want to fill in.
174 Builder(Path &_P) : P(_P) {}
176 /// Sets the starting node of the path.
178 /// Sets the starting node of the path. Edge added to the path
179 /// afterwards have to be incident to this node.
180 /// You \em must start building an empry path with this functions.
181 /// (And you \em must \em not use it later).
184 void setStartNode(const GraphNode &) {}
186 ///Push a new edge to the front of the path
188 ///Push a new edge to the front of the path.
189 ///If the path is empty, you \em must call \ref setStartNode() before
190 ///the first use of \ref pushFront().
191 void pushFront(const GraphEdge& e) {}
193 ///Push a new edge to the back of the path
195 ///Push a new edge to the back of the path.
196 ///If the path is empty, you \em must call \ref setStartNode() before
197 ///the first use of \ref pushBack().
198 void pushBack(const GraphEdge& e) {}
200 ///Commit the changes to the path.
203 ///Reserve (front) storage for the builder in advance.
205 ///If you know an reasonable upper bound of the number of the edges
206 ///to add to the front of the path,
207 ///using this function you may speed up the building.
208 void reserveFront(size_t r) {}
209 ///Reserve (back) storage for the builder in advance.
211 ///If you know an reasonable upper bound of the number of the edges
212 ///to add to the back of the path,
213 ///using this function you may speed up the building.
214 void reserveBack(size_t r) {}
223 #endif // LEMON_PATH_H