lemon/greedy_tsp.h
changeset 1052 eb2f9d453070
parent 1036 dff32ce3db71
child 1076 97d978243703
equal deleted inserted replaced
3:2175146e96ac 4:e0b3d0ca37ef
   204       }
   204       }
   205 
   205 
   206       /// \brief Gives back the node sequence of the found tour.
   206       /// \brief Gives back the node sequence of the found tour.
   207       ///
   207       ///
   208       /// This function copies the node sequence of the found tour into
   208       /// This function copies the node sequence of the found tour into
   209       /// the given standard container.
   209       /// an STL container through the given output iterator. The
   210       ///
   210       /// <tt>value_type</tt> of the container must be <tt>FullGraph::Node</tt>.
   211       /// \pre run() must be called before using this function.
   211       /// For example,
   212       template <typename Container>
   212       /// \code
   213       void tourNodes(Container &container) const {
   213       /// std::vector<FullGraph::Node> nodes(countNodes(graph));
   214         container.assign(_path.begin(), _path.end());
   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 
   217       /// \brief Gives back the found tour as a path.
   228       /// \brief Gives back the found tour as a path.
   218       ///
   229       ///
   219       /// This function copies the found tour as a list of arcs/edges into
   230       /// This function copies the found tour as a list of arcs/edges into