Given a matrix, I want to obtain a 0/1-matrix with 1 if and only if the corresponding entry was 0.
What is the fastest way of doing this? This is how I currently do it: R = ZZ zero = R(0) one = R(1) def is_zero(x): if x: return zero else: return one incidence_matrix = slack_matrix.apply_map(is_zero, R=R) Strangely, this takes up a lot of time. With https://trac.sagemath.org/ticket/29837 this appears to be the bottle neck of computing the incidence matrix for polyhedra, which would be strange. Can somebody help? Thank you. Jonathan -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/bdf6b005-fb90-4fc1-80e1-82218c562e3fo%40googlegroups.com.