aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/product.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2019-09-10 16:25:24 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2019-09-10 16:25:24 +0200
commitea0d5dc956c1268dd91ce636d8fd5e07225acb06 (patch)
tree624180571f205e23b72d4a8c87455ccfad30ebf5 /test/product.h
parent17226100c5e56d1c6064560390a4a6e16677bb45 (diff)
bug #1741: fix C.noalias() = A*C; with C.innerStride()!=1
Diffstat (limited to 'test/product.h')
-rw-r--r--test/product.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/product.h b/test/product.h
index d26e8063d..c6c78fbd8 100644
--- a/test/product.h
+++ b/test/product.h
@@ -241,4 +241,19 @@ template<typename MatrixType> void product(const MatrixType& m)
VERIFY_IS_APPROX(square * (square*square).conjugate(), square * square.conjugate() * square.conjugate());
}
+ // destination with a non-default inner-stride
+ // see bug 1741
+ if(!MatrixType::IsRowMajor)
+ {
+ typedef Matrix<Scalar,Dynamic,Dynamic> MatrixX;
+ MatrixX buffer(2*rows,2*rows);
+ Map<RowSquareMatrixType,0,Stride<Dynamic,2> > map1(buffer.data(),rows,rows,Stride<Dynamic,2>(2*rows,2));
+ buffer.setZero();
+ VERIFY_IS_APPROX(map1 = m1 * m2.transpose(), (m1 * m2.transpose()).eval());
+ buffer.setZero();
+ VERIFY_IS_APPROX(map1.noalias() = m1 * m2.transpose(), (m1 * m2.transpose()).eval());
+ buffer.setZero();
+ VERIFY_IS_APPROX(map1.noalias() += m1 * m2.transpose(), (m1 * m2.transpose()).eval());
+ }
+
}