mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-23 23:03:15 +08:00
allow null elements in sparse assignments
This commit is contained in:
parent
fc85f91df0
commit
85b358097d
@ -225,8 +225,7 @@ template<typename Derived> class SparseMatrixBase : public EigenBase<Derived>
|
||||
for (typename OtherDerived::InnerIterator it(other, j); it; ++it)
|
||||
{
|
||||
Scalar v = it.value();
|
||||
if (v!=Scalar(0))
|
||||
derived().insertBackByOuterInner(j,it.index()) = v;
|
||||
derived().insertBackByOuterInner(j,it.index()) = v;
|
||||
}
|
||||
}
|
||||
derived().finalize();
|
||||
@ -260,8 +259,7 @@ template<typename Derived> class SparseMatrixBase : public EigenBase<Derived>
|
||||
for (typename OtherDerived::InnerIterator it(other.derived(), j); it; ++it)
|
||||
{
|
||||
Scalar v = it.value();
|
||||
if (v!=Scalar(0))
|
||||
temp.insertBackByOuterInner(Flip?it.index():j,Flip?j:it.index()) = v;
|
||||
temp.insertBackByOuterInner(Flip?it.index():j,Flip?j:it.index()) = v;
|
||||
}
|
||||
}
|
||||
temp.finalize();
|
||||
|
Loading…
x
Reference in New Issue
Block a user