Am 22.10.19 um 18:16 schrieb Gerion Entrup:
> Hi,
> 
> 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?

No, that's not possible, because the internal property maps are not
stored in GraphInterface; they are kept only in the Python side of things.

But you map pass the property map dictionary (e.g. g.edge_properties) to
C++, and lookup from there.

Best,
Tiago


-- 
Tiago de Paula Peixoto <[email protected]>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
graph-tool mailing list
[email protected]
https://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to