when using graph-tool from C++, you can use one or more PropertyMaps. In
the documentation they are always given as an extra argument. Since
graph-tool has internal PropertyMaps, is it possible to extract internal
PropertyMaps out of the GraphInterface object?
In pseudo code (like in the documentation):
void kcore_bind(GraphInterface& gi)
{
// Vertex property map of type int32_t
typedef typename vprop_map_t<int32_t>::type vprop_t;
vprop_t c = boost::any_cast<vprop_t>(gi.get_internal_vertex_property_map("foo"));
gt_dispatch<>()
([&](auto& g){ kcore_decomposition(g, c.get_unchecked()); },
all_graph_views()) (gi.get_graph_view());
}
Is there a way to simulate the `get_internal_vertex_property_map`
method?
Ok, thank you. I now do exactly that. Here is a minimal example in case
anyone else need it (I have not tested exactly this version, maybe some
errors are present). Maybe you also know a more elegant version.