boost::transitive_closure() and “error: no matching function for call to ‘vertices(const std::vector<std::vector<long unsigned int>…”
Hi, I posted a question regarding an error I've received with boost::transitive_closure() to stackoverflow (http://stackoverflow.com/questions/8976812/boosttransitive-closure-and-error...). Since I didn't receive any comments I'm now trying this mailing list. In short I'm getting an error about a missing function when I'm trying to compute the transitive closure. The code in question is ... ------------- 1: #include <boost/graph/vector_as_graph.hpp> 2: #include <boost/graph/adjacency_list.hpp> 3: #include <boost/graph/transitive_closure.hpp> 10: boost::adjacency_list<boost::setS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_name_t, ContainerStruct *> > gTC, g = create_CSgraph(); 11: boost::transitive_closure(g, gTC); ------------- ... where "ContainerStruct" is a structure for holding various data and create_CSgraph() is a function for initializing a graph object. The error I'm getting is... ------------- /home/lidman/boost_1_48_0/BUILD/include/boost/graph/depth_first_search.hpp: In function ‘void boost::depth_first_search(const VertexListGraph&, const boost::bgl_named_params<P, T, R>&) [with VertexListGraph = std::vector<std::vector<long unsigned int, std::allocator<long unsigned int> >, std::allocator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >, P = boost::topo_sort_visitor<std::back_insert_iterator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >, T = boost::graph_visitor_t, R = boost::bgl_named_params<boost::typed_identity_property_map<long unsigned int>, boost::vertex_index_t, boost::no_property>]’: /home/lidman/boost_1_48_0/BUILD/include/boost/graph/topological_sort.hpp:65: instantiated from ‘void boost::topological_sort(VertexListGraph&, OutputIterator, const boost::bgl_named_params<P, T, R>&) [with VertexListGraph = std::vector<std::vector<long unsigned int, std::allocator<long unsigned int> >, std::allocator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >, OutputIterator = std::back_insert_iterator<std::vector<long unsigned int, std::allocator<long unsigned int> > >, P = boost::typed_identity_property_map<long unsigned int>, T = boost::vertex_index_t, R = boost::no_property]’ /home/lidman/boost_1_48_0/BUILD/include/boost/graph/transitive_closure.hpp:120: instantiated from ‘void boost::transitive_closure(const Graph&, GraphTC&, G_to_TC_VertexMap, VertexIndexMap) [with Graph = boost::adjacency_list<boost::listS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_name_t, ContainerStruct*, boost::no_property>, boost::no_property, boost::no_property, boost::listS>, GraphTC = boost::adjacency_list<boost::listS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_name_t, ContainerStruct*, boost::no_property>, boost::no_property, boost::no_property, boost::listS>, G_to_TC_VertexMap = boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::property<boost::vertex_name_t, ContainerStruct*, boost::no_property>, long unsigned int>, long unsigned int, long unsigned int&>, VertexIndexMap = boost::vec_adj_list_vertex_id_map<boost::property<boost::vertex_name_t, ContainerStruct*, boost::no_property>, long unsigned int>]’ /home/lidman/boost_1_48_0/BUILD/include/boost/graph/transitive_closure.hpp:263: instantiated from ‘void boost::transitive_closure(const Graph&, GraphTC&) [with Graph = CFG, GraphTC = CFG]’ test.C:11: instantiated from here /home/lidman/boost_1_48_0/BUILD/include/boost/graph/depth_first_search.hpp:291: error: no matching function for call to ‘vertices(const std::vector<std::vector<long unsigned int, std::allocator<long unsigned int> >, std::allocator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >&)’ /home/lidman/boost_1_48_0/BUILD/include/boost/graph/topological_sort.hpp:65: instantiated from ‘void boost::topological_sort(VertexListGraph&, OutputIterator, const boost::bgl_named_params<P, T, R>&) [with VertexListGraph = std::vector<std::vector<long unsigned int, std::allocator<long unsigned int> >, std::allocator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >, OutputIterator = std::back_insert_iterator<std::vector<long unsigned int, std::allocator<long unsigned int> > >, P = boost::typed_identity_property_map<long unsigned int>, T = boost::vertex_index_t, R = boost::no_property]’ /home/lidman/boost_1_48_0/BUILD/include/boost/graph/transitive_closure.hpp:120: instantiated from ‘void boost::transitive_closure(const Graph&, GraphTC&, G_to_TC_VertexMap, VertexIndexMap) [with Graph = boost::adjacency_list<boost::listS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_name_t, ContainerStruct*, boost::no_property>, boost::no_property, boost::no_property, boost::listS>, GraphTC = boost::adjacency_list<boost::listS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_name_t, ContainerStruct*, boost::no_property>, boost::no_property, boost::no_property, boost::listS>, G_to_TC_VertexMap = boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::property<boost::vertex_name_t, ContainerStruct*, boost::no_property>, long unsigned int>, long unsigned int, long unsigned int&>, VertexIndexMap = boost::vec_adj_list_vertex_id_map<boost::property<boost::vertex_name_t, ContainerStruct*, boost::no_property>, long unsigned int>]’ /home/lidman/boost_1_48_0/BUILD/include/boost/graph/transitive_closure.hpp:263: instantiated from ‘void boost::transitive_closure(const Graph&, GraphTC&) [with Graph = CFG, GraphTC = CFG]’ test.C:11: instantiated from here /home/lidman/boost_1_48_0/BUILD/include/boost/graph/depth_first_search.hpp:297: error: no matching function for call to ‘vertices(const std::vector<std::vector<long unsigned int, std::allocator<long unsigned int> >, std::allocator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >&)’ /home/lidman/boost_1_48_0/BUILD/include/boost/graph/named_function_params.hpp: In static member function ‘static boost::shared_array_property_map<Value, typename boost::remove_const<typename boost::detail::override_const_property_t<typename boost::parameter::value_type<ArgPack, boost::graph::keywords::tag::vertex_index_map, int>::type, boost::vertex_index_t, Graph, boost::detail::parameter_exists<ArgPack,boost::graph::keywords::tag::vertex_index_map>::value>::result_type>::type> boost::detail::map_maker_helper<false, Graph, ArgPack, Value, PM>::make_map(const Graph&, Value, const PM&, const ArgPack&) [with Graph = std::vector<std::vector<long unsigned int, std::allocator<long unsigned int> >, std::allocator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >, ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::back_insert_iterator<std::vector<long unsigned int, std::allocator<long unsigned int> > > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >, Value = boost::default_color_type, PM = int]’: /home/lidman/boost_1_48_0/BUILD/include/boost/graph/named_function_params.hpp:520: instantiated from ‘static typename boost::detail::map_maker_helper<boost::detail::map_maker<Graph, ArgPack, MapTag, ValueType>::has_map, Graph, ArgPack, ValueType, typename boost::remove_const<typename boost::parameter::value_type<ArgPack, MapTag, int>::type>::type>::map_type boost::detail::map_maker<Graph, ArgPack, MapTag, ValueType>::make_map(const Graph&, const ArgPack&, ValueType) [with Graph = std::vector<std::vector<long unsigned int, std::allocator<long unsigned int> >, std::allocator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >, ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::back_insert_iterator<std::vector<long unsigned int, std::allocator<long unsigned int> > > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >, MapTag = boost::graph::keywords::tag::color_map, ValueType = boost::default_color_type]’ /home/lidman/boost_1_48_0/BUILD/include/boost/graph/named_function_params.hpp:535: instantiated from ‘typename boost::detail::map_maker<Graph, ArgPack, MapTag, ValueType>::map_type boost::detail::make_property_map_from_arg_pack_gen<MapTag, ValueType>::operator()(const Graph&, const ArgPack&) const [with Graph = std::vector<std::vector<long unsigned int, std::allocator<long unsigned int> >, std::allocator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >, ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::back_insert_iterator<std::vector<long unsigned int, std::allocator<long unsigned int> > > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >, MapTag = boost::graph::keywords::tag::color_map, ValueType = boost::default_color_type]’ /home/lidman/boost_1_48_0/BUILD/include/boost/graph/depth_first_search.hpp:297: instantiated from ‘void boost::depth_first_search(const VertexListGraph&, const boost::bgl_named_params<P, T, R>&) [with VertexListGraph = std::vector<std::vector<long unsigned int, std::allocator<long unsigned int> >, std::allocator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >, P = boost::topo_sort_visitor<std::back_insert_iterator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >, T = boost::graph_visitor_t, R = boost::bgl_named_params<boost::typed_identity_property_map<long unsigned int>, boost::vertex_index_t, boost::no_property>]’ /home/lidman/boost_1_48_0/BUILD/include/boost/graph/topological_sort.hpp:65: instantiated from ‘void boost::topological_sort(VertexListGraph&, OutputIterator, const boost::bgl_named_params<P, T, R>&) [with VertexListGraph = std::vector<std::vector<long unsigned int, std::allocator<long unsigned int> >, std::allocator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >, OutputIterator = std::back_insert_iterator<std::vector<long unsigned int, std::allocator<long unsigned int> > >, P = boost::typed_identity_property_map<long unsigned int>, T = boost::vertex_index_t, R = boost::no_property]’ /home/lidman/boost_1_48_0/BUILD/include/boost/graph/transitive_closure.hpp:120: instantiated from ‘void boost::transitive_closure(const Graph&, GraphTC&, G_to_TC_VertexMap, VertexIndexMap) [with Graph = boost::adjacency_list<boost::listS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_name_t, ContainerStruct*, boost::no_property>, boost::no_property, boost::no_property, boost::listS>, GraphTC = boost::adjacency_list<boost::listS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_name_t, ContainerStruct*, boost::no_property>, boost::no_property, boost::no_property, boost::listS>, G_to_TC_VertexMap = boost::iterator_property_map<long unsigned int*, boost::vec_adj_list_vertex_id_map<boost::property<boost::vertex_name_t, ContainerStruct*, boost::no_property>, long unsigned int>, long unsigned int, long unsigned int&>, VertexIndexMap = boost::vec_adj_list_vertex_id_map<boost::property<boost::vertex_name_t, ContainerStruct*, boost::no_property>, long unsigned int>]’ /home/lidman/boost_1_48_0/BUILD/include/boost/graph/transitive_closure.hpp:263: instantiated from ‘void boost::transitive_closure(const Graph&, GraphTC&) [with Graph = CFG, GraphTC = CFG]’ test.C:11: instantiated from here /home/lidman/boost_1_48_0/BUILD/include/boost/graph/named_function_params.hpp:499: error: no matching function for call to ‘num_vertices(const std::vector<std::vector<long unsigned int, std::allocator<long unsigned int> >, std::allocator<std::vector<long unsigned int, std::allocator<long unsigned int> > > >&)’ ------------- From this page (http://boost.2283326.n4.nabble.com/Problem-in-using-Transitive-closure-on-Li...), I learned that including "boost/graph/vector_as_graph.hpp" before "boost/graph/transitive_closure.hpp" might do the trick. Unfortunately that doesn't seem to help me. For completeness I'm using GCC 4.1.2 20080704 (Red Hat 4.1.2-51) and Boost 1.48.0 on a x86_64 linux machine. GCC 4.5.0 seems to give me the same error message. Is there a newer workaround for this problem? Best regards, Jacob Lidman
On Fri, 3 Feb 2012, Jacob Lidman wrote:
Hi,
I posted a question regarding an error I've received with boost::transitive_closure() to stackoverflow (http://stackoverflow.com/questions/8976812/boosttransitive-closure-and-error...). Since I didn't receive any comments I'm now trying this mailing list.
In short I'm getting an error about a missing function when I'm trying to compute the transitive closure. The code in question is ...
------------- 1: #include <boost/graph/vector_as_graph.hpp> 2: #include <boost/graph/adjacency_list.hpp> 3: #include <boost/graph/transitive_closure.hpp>
10: boost::adjacency_list<boost::setS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_name_t, ContainerStruct *> > gTC, g = create_CSgraph(); 11: boost::transitive_closure(g, gTC); -------------
... where "ContainerStruct" is a structure for holding various data and create_CSgraph() is a function for initializing a graph object. The error I'm getting is...
Please see if r76868 in the trunk fixes this problem; you can just download https://svn.boost.org/svn/boost/trunk/boost/graph/vector_as_graph.hpp and put it into your tree. -- Jeremiah Willcock
participants (2)
-
Jacob Lidman
-
Jeremiah Willcock