mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix aliasing issue in sparse matrix assignment.
(m=-m; or m=m.transpose(); with m sparse work again)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user