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
Integer overflow for random DSCC matrices with a high dimension. #84
Comments
To catch the overflow, we could use |
How often do you need matrices larger than the integer max? I've been debating what to do here since the size of Java arrays being limited to 31-bits is getting more annoying and the Java development team doesn't seem to want to move quickly on this problem. |
For graphs it can be quite often, that the adjacency matrix has such dimensions. However it occurs less often, that the adjacency matrix actually stores as I also think the method should throw, when |
I could also think of having a different kind of interface for generating sparse random matrices, e.g. This idea is based on https://neo4j.com/docs/graph-data-science/current/alpha-algorithms/graph-generation/. |
It now checks to see if the shape exceeds the maximum size of an integer using the function below:
|
Apologies for the PR I'm linking here. I formatted the code making it extremely difficult to identify the relevant change. I'm trying to clean up the code, but only when I manually inspect a class. I should be doing this in separate commits... I'll probably be regretting this decision when I'm hunting down regressions. |
I like the idea of a more structured random matrix. Always thought the simple approach here was klunky. I think I would need to look at their code to really understand what they are doing. Sounds a bit complex. |
Thank you, I reviewed your PR. Than lets say, that the |
The I would try to add this simple version on the weekend. |
yes let's do that! Let me know when the PR is ready. |
@lessthanoptimal The PR is ready 🙂 |
- Add a random sparse matrix generator based on avg nz entries per column - Drop/Select columns based on density - based on issue #84
When trying to create a random sparse matrix of size 10^6 x 10^6, a bug occurs based on an integer overflow.
Test to validate:
The problematic lines are (in
RandomMatrices_DSCC
):Here
numCols*numRows
produces an Integer overflow.The text was updated successfully, but these errors were encountered: