From 031f17117d93d38d7078ef02892afdba549a265c Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 11 Sep 2019 15:04:25 +0200 Subject: bug #1741: fix self-adjoint*matrix, triangular*matrix, and triangular^1*matrix with a destination having a non-trivial inner-stride --- test/product_trmm.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test/product_trmm.cpp') diff --git a/test/product_trmm.cpp b/test/product_trmm.cpp index c7594e512..2bb4b9e47 100644 --- a/test/product_trmm.cpp +++ b/test/product_trmm.cpp @@ -76,8 +76,18 @@ void trmm(int rows=get_random_size(), VERIFY_IS_APPROX( ge_xs = (s1*mat).adjoint().template triangularView() * ge_left.adjoint(), numext::conj(s1) * triTr.conjugate() * ge_left.adjoint()); VERIFY_IS_APPROX( ge_xs = (s1*mat).transpose().template triangularView() * ge_left.adjoint(), s1triTr * ge_left.adjoint()); - // TODO check with sub-matrix expressions ? + + // destination with a non-default inner-stride + // see bug 1741 + { + VERIFY_IS_APPROX( ge_xs.noalias() = mat.template triangularView() * ge_right, tri * ge_right); + typedef Matrix MatrixX; + MatrixX buffer(2*ge_xs.rows(),2*ge_xs.cols()); + Map > map1(buffer.data(),ge_xs.rows(),ge_xs.cols(),Stride(2*ge_xs.outerStride(),2)); + buffer.setZero(); + VERIFY_IS_APPROX( map1.noalias() = mat.template triangularView() * ge_right, tri * ge_right); + } } template -- cgit v1.2.3