lemon/insertion_tsp.h
changeset 1041 0b0327c9b3ef
parent 1036 dff32ce3db71
child 1074 97d978243703
equal deleted inserted replaced
3:672d580c328f 4:f1e331f7d4bb
   201       }
   201       }
   202 
   202 
   203       /// \brief Gives back the node sequence of the found tour.
   203       /// \brief Gives back the node sequence of the found tour.
   204       ///
   204       ///
   205       /// This function copies the node sequence of the found tour into
   205       /// This function copies the node sequence of the found tour into
   206       /// the given standard container.
   206       /// an STL container through the given output iterator. The
       
   207       /// <tt>value_type</tt> of the container must be <tt>FullGraph::Node</tt>.
       
   208       /// For example,
       
   209       /// \code
       
   210       /// std::vector<FullGraph::Node> nodes(countNodes(graph));
       
   211       /// tsp.tourNodes(nodes.begin());
       
   212       /// \endcode
       
   213       /// or
       
   214       /// \code
       
   215       /// std::list<FullGraph::Node> nodes;
       
   216       /// tsp.tourNodes(std::back_inserter(nodes));
       
   217       /// \endcode
   207       ///
   218       ///
   208       /// \pre run() must be called before using this function.
   219       /// \pre run() must be called before using this function.
   209       template <typename Container>
   220       template <typename Iterator>
   210       void tourNodes(Container &container) const {
   221       void tourNodes(Iterator out) const {
   211         container.assign(_tour.begin(), _tour.end());
   222         std::copy(_tour.begin(), _tour.end(), out);
   212       }
   223       }
   213 
   224 
   214       /// \brief Gives back the found tour as a path.
   225       /// \brief Gives back the found tour as a path.
   215       ///
   226       ///
   216       /// This function copies the found tour as a list of arcs/edges into
   227       /// This function copies the found tour as a list of arcs/edges into