From c06e6fd115d747c42a2b2ea029c53bbdf41276d6 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 10 Sep 2019 23:29:52 +0200 Subject: bug #1741: fix SelfAdjointView::rankUpdate and product to triangular part for destination with non-trivial inner stride --- test/product_syrk.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/product_syrk.cpp') diff --git a/test/product_syrk.cpp b/test/product_syrk.cpp index 23406fe4b..8becd37fc 100644 --- a/test/product_syrk.cpp +++ b/test/product_syrk.cpp @@ -115,6 +115,17 @@ template void syrk(const MatrixType& m) m2.setZero(); VERIFY_IS_APPROX((m2.template selfadjointView().rankUpdate(m1.row(c).adjoint(),s1)._expression()), ((s1 * m1.row(c).adjoint() * m1.row(c).adjoint().adjoint()).eval().template triangularView().toDenseMatrix())); + + // destination with a non-default inner-stride + // see bug 1741 + { + typedef Matrix MatrixX; + MatrixX buffer(2*rows,2*cols); + Map > map1(buffer.data(),rows,cols,Stride(2*rows,2)); + buffer.setZero(); + VERIFY_IS_APPROX((map1.template selfadjointView().rankUpdate(rhs2,s1)._expression()), + ((s1 * rhs2 * rhs2.adjoint()).eval().template triangularView().toDenseMatrix())); + } } EIGEN_DECLARE_TEST(product_syrk) -- cgit v1.2.3