From 3ecb343dc3f0be6c60654cec581d0f3145553238 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 26 Oct 2016 22:50:41 +0200 Subject: Fix regression in X = (X*X.transpose())/s with X rectangular by deferring resizing of the destination after the creation of the evaluator of the source expression. --- Eigen/src/Core/DiagonalMatrix.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Eigen/src/Core/DiagonalMatrix.h') diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h index c682c6d7f..ecfdce8ef 100644 --- a/Eigen/src/Core/DiagonalMatrix.h +++ b/Eigen/src/Core/DiagonalMatrix.h @@ -320,6 +320,11 @@ struct Assignment { static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &/*func*/) { + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) + dst.resize(dstRows, dstCols); + dst.setZero(); dst.diagonal() = src.diagonal(); } -- cgit v1.2.3