giotto-ai/giotto-ph

Consistency in index dtypes

ulupo opened this issue · 1 comments

ulupo commented

Here:

np.asarray(row, dtype=np.int32, order="C"),
np.asarray(col, dtype=np.int32, order="C"),

we convert indices to 32-bit ints. In the C++ code, is every index a 64-bit integer? It seems to me that the case of sparse matrices is one in which indices can be very large, so 64-bit ints might make sense. For dense matrices, there is no way int32 is not enough!

You are right.

In the C++ backend and the bindings, we use int64_t as index vertice type.
But as you point out, not in the Python interface. This is a legacy from ripser.py where they cast to int32 for their bindings.