Skip to content

Commit

Permalink
Copying original change from PR pybind#3343, with extra line breaks t…
Browse files Browse the repository at this point in the history
…o not run past 99 columns (our desired but currently not enforced limit).
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Oct 11, 2021
1 parent 1b72808 commit f86c9dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/pybind11/eigen.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,9 @@ struct type_caster<Type, enable_if_t<is_eigen_sparse<Type>::value>> {
if (!values || !innerIndices || !outerIndices)
return false;

value = Eigen::MappedSparseMatrix<Scalar, Type::Flags, StorageIndex>(
value = Eigen::MappedSparseMatrix<Scalar,
Type::Flags & (Eigen::RowMajor | Eigen::ColMajor),
StorageIndex>(
shape[0].cast<Index>(), shape[1].cast<Index>(), nnz,
outerIndices.mutable_data(), innerIndices.mutable_data(), values.mutable_data());

Expand Down

0 comments on commit f86c9dc

Please sign in to comment.