Compute the transitive closure of the matrix.

def transitive_closure(self):
        """Compute the transitive closure of the matrix."""
        data = [[1 if j else 0 for j in i] for i in self.data]
        for k in range(self.rows):
            for i in range(self.rows):
                for j in range(self.rows):
                    if data[i][k] and data[k][j]:
                        data[i][j] = 1
        return data