diff options
author | Gael Guennebaud <g.gael@free.fr> | 2019-09-10 23:29:52 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2019-09-10 23:29:52 +0200 |
commit | c06e6fd115d747c42a2b2ea029c53bbdf41276d6 (patch) | |
tree | 52ca332b7f5fcdc46c05b7a222719cb431bfe136 /test/product_syrk.cpp | |
parent | ea0d5dc956c1268dd91ce636d8fd5e07225acb06 (diff) |
bug #1741: fix SelfAdjointView::rankUpdate and product to triangular part for destination with non-trivial inner stride
Diffstat (limited to 'test/product_syrk.cpp')
-rw-r--r-- | test/product_syrk.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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<typename MatrixType> void syrk(const MatrixType& m) m2.setZero(); VERIFY_IS_APPROX((m2.template selfadjointView<Upper>().rankUpdate(m1.row(c).adjoint(),s1)._expression()), ((s1 * m1.row(c).adjoint() * m1.row(c).adjoint().adjoint()).eval().template triangularView<Upper>().toDenseMatrix())); + + // destination with a non-default inner-stride + // see bug 1741 + { + typedef Matrix<Scalar,Dynamic,Dynamic> MatrixX; + MatrixX buffer(2*rows,2*cols); + Map<MatrixType,0,Stride<Dynamic,2> > map1(buffer.data(),rows,cols,Stride<Dynamic,2>(2*rows,2)); + buffer.setZero(); + VERIFY_IS_APPROX((map1.template selfadjointView<Lower>().rankUpdate(rhs2,s1)._expression()), + ((s1 * rhs2 * rhs2.adjoint()).eval().template triangularView<Lower>().toDenseMatrix())); + } } EIGEN_DECLARE_TEST(product_syrk) |