]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/graph/test/min_degree_empty.cpp
1 //=======================================================================
2 // Copyright 2017 Felix Salfelder
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 //=======================================================================
9 #include <boost/graph/minimum_degree_ordering.hpp>
10 #include <boost/graph/adjacency_list.hpp>
11 #include <boost/property_map/property_map.hpp>
12 #include <boost/test/minimal.hpp>
13 #include <boost/typeof/typeof.hpp>
17 typedef boost::adjacency_list
<boost::vecS
, boost::vecS
, boost::directedS
> G
;
19 int test_main(int argc
, char** argv
)
24 std::vector
<int> inverse_perm(n
, 0);
25 std::vector
<int> supernode_sizes(n
, 1);
26 BOOST_AUTO(id
, boost::get(boost::vertex_index
, g
));
27 std::vector
<int> degree(n
, 0);
31 boost::minimum_degree_ordering(
33 , boost::make_iterator_property_map(degree
.begin(), id
, degree
[0])
34 , boost::make_assoc_property_map(io
)
35 , boost::make_assoc_property_map(o
)
36 , boost::make_iterator_property_map(
37 supernode_sizes
.begin()
45 for (int k
= 0; k
< n
; ++k
)
47 BOOST_CHECK(o
[io
[k
]] == k
);