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 <[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