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