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)
(transplanted from e75b1eb883
)
This commit is contained in:
@@ -193,6 +193,12 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re
|
||||
// sparse cwise* dense
|
||||
VERIFY_IS_APPROX(m3.cwiseProduct(refM4), refM3.cwiseProduct(refM4));
|
||||
// VERIFY_IS_APPROX(m3.cwise()/refM4, refM3.cwise()/refM4);
|
||||
|
||||
// test aliasing
|
||||
VERIFY_IS_APPROX((m1 = -m1), (refM1 = -refM1));
|
||||
VERIFY_IS_APPROX((m1 = m1.transpose()), (refM1 = refM1.transpose().eval()));
|
||||
VERIFY_IS_APPROX((m1 = -m1.transpose()), (refM1 = -refM1.transpose().eval()));
|
||||
VERIFY_IS_APPROX((m1 += -m1), (refM1 += -refM1));
|
||||
}
|
||||
|
||||
// test transpose
|
||||
|
||||
Reference in New Issue
Block a user