Accessing the integer attribute in Vertex/Edge object directly/faster
Hi, Given a `graph_tool.Edge` instance, is it possible to directly access the integer value (or its index value) of the source vertex and target vertex? My current solution is ``` s = int(e.source()) t = int(e.target()) ``` I have some function that calls the above routine many times and it is not fast enough. I am wondering if I can do it faster. Similarly, can I access the index/integer value of a Vertex object directly? -- Best Han
On 21.09.2017 14:53, 肖晗 wrote:
Hi,
Given a `graph_tool.Edge` instance, is it possible to directly access the integer value (or its index value) of the source vertex and target vertex?
My current solution is
``` s = int(e.source()) t = int(e.target()) ```
I have some function that calls the above routine many times and it is not fast enough. I am wondering if I can do it faster.
How could it be even more direct than the above?
Similarly, can I access the index/integer value of a Vertex object directly?
Just do: int(v) where is a Vertex instance. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
Tiago de Paula Peixoto -
肖晗