Fix aliasing issue in sparse matrix assignment.
(m=-m; or m=m.transpose(); with m sparse work again)
diff --git a/test/sparse_vector.cpp b/test/sparse_vector.cpp
index 7201afe..9d559f5 100644
--- a/test/sparse_vector.cpp
+++ b/test/sparse_vector.cpp
@@ -78,6 +78,11 @@
VERIFY_IS_APPROX(v1.squaredNorm(), refV1.squaredNorm());
+ // test aliasing
+ VERIFY_IS_APPROX((v1 = -v1), (refV1 = -refV1));
+ VERIFY_IS_APPROX((v1 = v1.transpose()), (refV1 = refV1.transpose().eval()));
+ VERIFY_IS_APPROX((v1 += -v1), (refV1 += -refV1));
+
}
void test_sparse_vector()