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

Fix issue for sparse matrix conversions #538

Merged
merged 5 commits into from
Apr 5, 2025

Conversation

jcarpent
Copy link
Contributor

Very nice fix @ManifoldFR ;)

@@ -156,6 +156,10 @@ void eigen_sparse_matrix_from_py_construct(
}
MapMatOrRefType sparse_map(m, n, nnz, indptr.data(), indices_ptr, data_ptr);

#if EIGEN_VERSION_AT_LEAST(3, 4, 90)
sparse_map.sortInnerIndices();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably at some point we would like to add a check (and throw an exception) if the indices are unsorted and the Eigen version is below 3.4.90 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sure.

@ManifoldFR
Copy link
Member

I will open a PR on nanobind to address this issue ahead of our transition to it.

@jcarpent jcarpent merged commit a921e23 into stack-of-tasks:devel Apr 5, 2025
31 checks passed
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 this pull request may close these issues.

2 participants