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,7 +225,6 @@ template<typename Derived> class SparseMatrixBase : public EigenBase<Derived>
|
|||||||
for (typename OtherDerived::InnerIterator it(other, j); it; ++it)
|
for (typename OtherDerived::InnerIterator it(other, j); it; ++it)
|
||||||
{
|
{
|
||||||
Scalar v = it.value();
|
Scalar v = it.value();
|
||||||
if (v!=Scalar(0))
|
|
||||||
derived().insertBackByOuterInner(j,it.index()) = v;
|
derived().insertBackByOuterInner(j,it.index()) = v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,7 +259,6 @@ template<typename Derived> class SparseMatrixBase : public EigenBase<Derived>
|
|||||||
for (typename OtherDerived::InnerIterator it(other.derived(), j); it; ++it)
|
for (typename OtherDerived::InnerIterator it(other.derived(), j); it; ++it)
|
||||||
{
|
{
|
||||||
Scalar v = it.value();
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user