tsp_tour_len_visitor.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <HTML>
  2. <!--
  3. Copyright (c) Matyas Egyhazy 2008
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. -->
  8. <Head>
  9. <Title>Boost Graph Library: tsp_tour_len_visitor</Title>
  10. <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
  11. ALINK="#ff0000">
  12. <IMG SRC="../../../boost.png"
  13. ALT="C++ Boost" width="277" height="86">
  14. <BR Clear>
  15. <H1>
  16. <pre>
  17. tsp_tour_len_visitor&lt;Graph, WeightMap, OutputIterator, Length&gt;
  18. </pre>
  19. </H1>
  20. This type is a TSP tour visitor. It supplies the OutputIterator with the vertices of the tour and
  21. records the total length of the tour.
  22. <h3>Example</h3>
  23. <pre>
  24. double d(0.0);
  25. std::vector&lt;Vertex&gt; c;
  26. boost::metric_tsp_approx
  27. (g, get(edge_weight, g),
  28. make_tsp_tour_len_visitor(g, std::back_inserter(c), d, get(edge_weight, g)));
  29. </pre>
  30. <h3>Model of</h3>
  31. <a href="./TSPTourVisitor.html">TSP Tour Visitor</a>
  32. <H3>Template Parameters</H3>
  33. <P>
  34. <TABLE border>
  35. <TR>
  36. <th>Parameter</th><th>Description</th><th>Default</th>
  37. </tr>
  38. <TR><TD><TT>Graph</TT></TD>
  39. <TD>
  40. The graph type
  41. </TD>
  42. <TD>None</TD>
  43. </TR>
  44. <TR><TD><TT>WeightMap</TT></TD>
  45. <TD>
  46. The weight of each edge in the graph.
  47. The type <tt>WeightMap</tt> must be a model of
  48. <a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map</a>.
  49. The edge descriptor type of the graph needs to be usable as the key type for the weight map.
  50. </TD>
  51. <TD>None</TD>
  52. </TR>
  53. <TR><TD><TT>OutputIterator</TT></TD>
  54. <TD>
  55. An OutputIterator
  56. </TD>
  57. <TD>None</TD>
  58. </TR>
  59. <TR><TD><TT>Length</TT></TD>
  60. <TD>
  61. A suitable container for the length of the tour. It must implement additive operators.
  62. </TD>
  63. <TD>None</TD>
  64. </TR>
  65. </table>
  66. <H3>Where Defined</H3>
  67. <P>
  68. <a href="../../../boost/graph/metric_tsp_approx.hpp">
  69. <TT>boost/graph/metric_tsp_approx.hpp</TT></a>
  70. <h3>Member Functions</h3>
  71. This class implements all of the member functions required by <a
  72. href="./TSPTourVisitor.html">TSPTourVisitor</a>.
  73. <h3>Non-Member Functions</h3>
  74. <table border>
  75. <tr>
  76. <th>Function</th><th>Description</th>
  77. </tr>
  78. <tr><td><tt>
  79. template &lt;typename Graph, typename WeightMap, typename OutputIterator, typename Length&gt;<br>
  80. tsp_tour_len_visitor&lt;OutputIterator&gt;<br>
  81. make_tsp_tour_len_visitor(Graph const& g, OutIter iter, Length& l, WeightMap map)
  82. </tt></td><td>
  83. Returns a tour_len_visitor that records the TSP tour in the OutputIterator parameter and the length of the tour in the Length parameter.
  84. </td></tr>
  85. </table>
  86. <h3>See Also</h3>
  87. None
  88. <br>
  89. <HR>
  90. <TABLE>
  91. <TR valign=top>
  92. <TD nowrap>Copyright &copy; 2008</TD><TD>
  93. Matyas Egyhazy
  94. </TD></TR></TABLE>
  95. </BODY>
  96. </HTML>