Ordering of edges returned by EdgePropertyMap.getArray()
Hi, I am trying to set a property (my_prop) for all the edges of a graph, where the property values for all edges are stored in an array A. My plan is to use my_prop.get_array()[:] = A. Now, in what order do the values need to be in A to make sure each value goes to the correct edge? In other words, in what order are the properties of edges returned by get_array() ? I initially thought the order would be the same as the one returned by calling g.get_edges(), but that does not set them correctly. When I tried with g.edge_index, it seems to work. Can I rely on setting the value of an edge E in A at position A[g.edge_index[E]] ? Thanks a lot, Ioana -- Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
Beautiful! Thanks! On Thu 7. May 2020 at 15:59, Tiago de Paula Peixoto <tiago@skewed.de> wrote:
Am 07.05.20 um 11:33 schrieb Ioana K-Hulpus:
Can I rely on setting the value of an edge E in A at position A[g.edge_index[E]] ?
Yes.
-- Tiago de Paula Peixoto <tiago@skewed.de>
_______________________________________________ graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
participants (3)
-
Ioana Hulpus -
Ioana K-Hulpus -
Tiago de Paula Peixoto