[BUG]: Sparse Eigen type caster assumes that the index and value arrays are mutable #5431
Open
3 tasks done
Labels
triage
New bug, unverified
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
2.13.6
Problem description
The type caster for sparse matrices assumes that the arrays inside of the
csc_matrix
class are mutable. This is not necessarily the case (for example, they could be initialized byEigen::Ref<const Eigen::VectorXi>
casted to a NumPy array).pybind11/include/pybind11/eigen/matrix.h
Lines 680 to 687 in 75e48c5
Reproducible example code
Is this a regression? Put the last known working version here if it is.
Not a regression
The text was updated successfully, but these errors were encountered: