Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistency in index dtypes #30

Closed
ulupo opened this issue Oct 18, 2021 · 1 comment · Fixed by #34
Closed

Consistency in index dtypes #30

ulupo opened this issue Oct 18, 2021 · 1 comment · Fixed by #34

Comments

@ulupo
Copy link
Collaborator

ulupo commented Oct 18, 2021

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!

@MonkeyBreaker
Copy link
Collaborator

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.

ulupo added a commit to ulupo/giotto-ph that referenced this issue Oct 25, 2021
@ulupo ulupo closed this as completed in #34 Oct 29, 2021
ulupo added a commit that referenced this issue Oct 29, 2021
Fixes #30 by using np.int64 instead of np.int32 when passing row and column data to sparse computer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants