mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
fix sparse vector assignment from a sparse matrix
This commit is contained in:
@@ -230,7 +230,8 @@ class SparseVector
|
||||
template<typename OtherDerived>
|
||||
inline SparseVector& operator=(const SparseMatrixBase<OtherDerived>& other)
|
||||
{
|
||||
if (int(RowsAtCompileTime)!=int(OtherDerived::RowsAtCompileTime))
|
||||
if ( (bool(OtherDerived::IsVectorAtCompileTime) && int(RowsAtCompileTime)!=int(OtherDerived::RowsAtCompileTime))
|
||||
|| ((!bool(OtherDerived::IsVectorAtCompileTime)) && ( bool(IsColVector) ? other.cols()>1 : other.rows()>1 )))
|
||||
return assign(other.transpose());
|
||||
else
|
||||
return assign(other);
|
||||
|
||||
Reference in New Issue
Block a user