aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2013-03-06 11:58:22 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2013-03-06 11:58:22 +0100
commit98ce4455ddad01ef028b65f96e232d4b750647f0 (patch)
tree248f3d88d1e65f8fe2cdbb18215f05982764560b /Eigen
parent69bd334d2be5890cd7a8b5f4d7e62f5db1b02b18 (diff)
fix sparse vector assignment from a sparse matrix
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/SparseCore/SparseVector.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Eigen/src/SparseCore/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h
index 5bfd041ed..cd1e76070 100644
--- a/Eigen/src/SparseCore/SparseVector.h
+++ b/Eigen/src/SparseCore/SparseVector.h
@@ -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);