fix: accept read-only sparse Eigen inputs (#6185)

* fix: accept read-only sparse Eigen inputs

* fix: only cast away const for Eigen < 3.3 sparse maps

Eigen 3.3+ supports Map<const SparseMatrix>, so const pointers can be used directly.

Assisted-by: ClaudeCode:claude-opus-5-5

---------

Co-authored-by: Henry Schreiner <henryfs@princeton.edu>
2 files changed