aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sparse_vector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/sparse_vector.cpp')
-rw-r--r--test/sparse_vector.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/sparse_vector.cpp b/test/sparse_vector.cpp
index 7201afe5b..9d559f5bf 100644
--- a/test/sparse_vector.cpp
+++ b/test/sparse_vector.cpp
@@ -78,6 +78,11 @@ template<typename Scalar> void sparse_vector(int rows, int cols)
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()