mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
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:
committed by
Charles Schlosser
parent
be56fff1ff
commit
9234883914
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user