1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/stdcpp/tsrc/Boost_test/graph/src/bfs_cc.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,54 @@
1.4 +//=======================================================================
1.5 +// Copyright 2002 Indiana University.
1.6 +// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
1.7 +//
1.8 +// Distributed under the Boost Software License, Version 1.0. (See
1.9 +// accompanying file LICENSE_1_0.txt or copy at
1.10 +// http://www.boost.org/LICENSE_1_0.txt)
1.11 +//=======================================================================
1.12 +
1.13 +#include <boost/concept_archetype.hpp>
1.14 +#include <boost/graph/breadth_first_search.hpp>
1.15 +#include <boost/graph/graph_archetypes.hpp>
1.16 +
1.17 +int main()
1.18 +{
1.19 + using namespace boost;
1.20 + typedef default_constructible_archetype<
1.21 + sgi_assignable_archetype<
1.22 + equality_comparable_archetype<> > > vertex_t;
1.23 + {
1.24 + typedef incidence_graph_archetype<vertex_t, directed_tag,
1.25 + allow_parallel_edge_tag> IncidenceGraph;
1.26 + typedef vertex_list_graph_archetype<vertex_t, directed_tag,
1.27 + allow_parallel_edge_tag, IncidenceGraph> graph_t;
1.28 + graph_t& g = static_object<graph_t>::get();
1.29 + vertex_t s;
1.30 + read_write_property_map_archetype<vertex_t, color_value_archetype> color;
1.31 + breadth_first_search(g, s, color_map(color));
1.32 + }
1.33 + {
1.34 + typedef incidence_graph_archetype<vertex_t, directed_tag,
1.35 + allow_parallel_edge_tag> IncidenceGraph;
1.36 + typedef vertex_list_graph_archetype<vertex_t, directed_tag,
1.37 + allow_parallel_edge_tag, IncidenceGraph> graph_t;
1.38 + graph_t& g = static_object<graph_t>::get();
1.39 + vertex_t s;
1.40 + readable_property_map_archetype<vertex_t, std::size_t> v_index;
1.41 + breadth_first_search(g, s, vertex_index_map(v_index));
1.42 + }
1.43 + {
1.44 + typedef incidence_graph_archetype<vertex_t, undirected_tag,
1.45 + allow_parallel_edge_tag> IncidenceGraph;
1.46 + typedef vertex_list_graph_archetype<vertex_t, undirected_tag,
1.47 + allow_parallel_edge_tag, IncidenceGraph> Graph;
1.48 + typedef property_graph_archetype<Graph, vertex_index_t, std::size_t>
1.49 + graph_t;
1.50 + graph_t& g = static_object<graph_t>::get();
1.51 + vertex_t s;
1.52 + bfs_visitor<> v;
1.53 + buffer_archetype<vertex_t> b;
1.54 + breadth_first_search(g, s, visitor(v).buffer(b));
1.55 + }
1.56 + return 0;
1.57 +}