Fix SparseVector::insert(Index) assigning int to Scalar

Scalar doesn't necessarily support implicit construction from int or
assignment from int.

Here's the error message I got without this fix:
```
/home/tav/git/Sleipnir/build/_deps/eigen3-src/Eigen/src/SparseCore/SparseVector.h:180:25: error: no match for ‘operator=’ (operand types are ‘Eigen::internal::CompressedStorage<ExplicitDouble, int>::Scalar’ {aka ‘ExplicitDouble’} and ‘int’)
  180 |     m_data.value(p + 1) = 0;
      |     ~~~~~~~~~~~~~~~~~~~~^~~
```

See merge request libeigen/eigen!2046
This commit is contained in:
Tyler Veness
2025-10-27 22:06:59 +00:00
committed by Charles Schlosser
parent be56fff1ff
commit 9234883914

View File

@@ -177,7 +177,7 @@ class SparseVector : public SparseCompressedBase<SparseVector<Scalar_, Options_,
--p;
}
m_data.index(p + 1) = convert_index(i);
m_data.value(p + 1) = 0;
m_data.value(p + 1) = Scalar(0);
return m_data.value(p + 1);
}