Changeset 1205:d3dcc49e6403 in lemon for lemon/greedy_tsp.h
- Timestamp:
- 02/28/13 17:13:14 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/greedy_tsp.h
r1204 r1205 207 207 /// 208 208 /// This function copies the node sequence of the found tour into 209 /// the given standard container. 210 /// 211 /// \pre run() must be called before using this function. 212 template <typename Container> 213 void tourNodes(Container &container) const { 214 container.assign(_path.begin(), _path.end()); 209 /// an STL container through the given output iterator. The 210 /// <tt>value_type</tt> of the container must be <tt>FullGraph::Node</tt>. 211 /// For example, 212 /// \code 213 /// std::vector<FullGraph::Node> nodes(countNodes(graph)); 214 /// tsp.tourNodes(nodes.begin()); 215 /// \endcode 216 /// or 217 /// \code 218 /// std::list<FullGraph::Node> nodes; 219 /// tsp.tourNodes(std::back_inserter(nodes)); 220 /// \endcode 221 /// 222 /// \pre run() must be called before using this function. 223 template <typename Iterator> 224 void tourNodes(Iterator out) const { 225 std::copy(_path.begin(), _path.end(), out); 215 226 } 216 227
Note: See TracChangeset
for help on using the changeset viewer.