]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/graph/example/adj_list_ra_edgelist.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / graph / example / adj_list_ra_edgelist.cpp
CommitLineData
7c673cae
FG
1//=======================================================================
2// Copyright 2001 Indiana University.
3// Author: Jeremy G. Siek
4//
5// Distributed under the Boost Software License, Version 1.0. (See
6// accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//=======================================================================
9
10#include <boost/config.hpp>
11#include <boost/graph/adjacency_list.hpp>
12#include <iostream>
13
14int
15main()
16{
17 using namespace boost;
18 typedef adjacency_list<vecS, vecS, bidirectionalS, no_property,
19 property<int, edge_weight_t>, no_property, vecS> Graph;
20
21 const std::size_t n = 3;
22 typedef std::pair<std::size_t, std::size_t> E;
23 E edge_array[] = { E(0,1), E(0,2), E(0,1) };
24 const std::size_t m = sizeof(edge_array) / sizeof(E);
25 Graph g(edge_array, edge_array + m, n);
26
92f5a8d4 27 graph_traits<Graph>::edge_iterator edge_iterator;
7c673cae
FG
28 for (std::size_t i = 0; i < m; ++i) {
29 const graph_traits<Graph>::edge_iterator e = edges(g).first + i;
30 std::cout << *e << " ";
31 }
32 std::cout << std::endl;
33
34 return 0;
35}