mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
add auto transposition for vectors
This commit is contained in:
@@ -239,7 +239,10 @@ class SparseVector
|
|||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
inline SparseVector& operator=(const SparseMatrixBase<OtherDerived>& other)
|
inline SparseVector& operator=(const SparseMatrixBase<OtherDerived>& other)
|
||||||
{
|
{
|
||||||
return Base::operator=(other);
|
if (int(RowsAtCompileTime)!=int(OtherDerived::RowsAtCompileTime))
|
||||||
|
return Base::operator=(other.transpose());
|
||||||
|
else
|
||||||
|
return Base::operator=(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
// const bool needToTranspose = (Flags & RowMajorBit) != (OtherDerived::Flags & RowMajorBit);
|
// const bool needToTranspose = (Flags & RowMajorBit) != (OtherDerived::Flags & RowMajorBit);
|
||||||
|
|||||||
Reference in New Issue
Block a user