add auto transposition for vectors

This commit is contained in:
Gael Guennebaud 2009-04-30 12:09:45 +00:00
parent 7029ed6b88
commit facee57b8d

View File

@ -239,6 +239,9 @@ class SparseVector
template<typename OtherDerived>
inline SparseVector& operator=(const SparseMatrixBase<OtherDerived>& other)
{
if (int(RowsAtCompileTime)!=int(OtherDerived::RowsAtCompileTime))
return Base::operator=(other.transpose());
else
return Base::operator=(other);
}