From f46ace61d3986688e343324b5064a805c254e338 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 31 Jan 2011 21:30:27 +0100 Subject: fix dynamic allocation for fixed size objects in matrix-vector product --- test/nomalloc.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/nomalloc.cpp') diff --git a/test/nomalloc.cpp b/test/nomalloc.cpp index c6f24c035..94c1b0533 100644 --- a/test/nomalloc.cpp +++ b/test/nomalloc.cpp @@ -71,6 +71,16 @@ template void nomalloc(const MatrixType& m) VERIFY_IS_APPROX((m1+m2)(r,c), (m1(r,c))+(m2(r,c))); VERIFY_IS_APPROX(m1.cwiseProduct(m1.block(0,0,rows,cols)), (m1.array()*m1.array()).matrix()); VERIFY_IS_APPROX((m1*m1.transpose())*m2, m1*(m1.transpose()*m2)); + + m2.col(0).noalias() = m1 * m1.col(0); + m2.col(0).noalias() -= m1.adjoint() * m1.col(0); + m2.col(0).noalias() -= m1 * m1.row(0).adjoint(); + m2.col(0).noalias() -= m1.adjoint() * m1.row(0).adjoint(); + + m2.row(0).noalias() = m1.row(0) * m1; + m2.row(0).noalias() -= m1.row(0) * m1.adjoint(); + m2.row(0).noalias() -= m1.col(0).adjoint() * m1; + m2.row(0).noalias() -= m1.col(0).adjoint() * m1.adjoint(); } template -- cgit v1.2.3