26 Sep
2016
26 Sep
'16
12:06 p.m.
On 26.09.2016 13:02, Tiago de Paula Peixoto wrote:
And is there a O(1) operation to invert masks?
Of course not, that would be magic. Both logical_lot() and invert() are O(N). They are faster than imap because the loops are performed in C, not python.
Just to briefly contradict myself, in fact there _is_ a O(1) way to invert a mask in graph-tool, you simply set the "inverted" parameter in set_vertex_filter(): g.set_vertex_filter(mask, inverted=True) Since this does not touch the contents of 'mask', it is O(1). -- Tiago de Paula Peixoto <tiago@skewed.de>