From 32f95ec2670a287234d7f614a20062e7d8499906 Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Tue, 1 Sep 2009 10:50:54 +0100 Subject: [PATCH] Bug fix in MatrixExponential.h Initialize matrices for intermediate results to correct dimension --- unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h index 7d8777de7..bf5b79955 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h @@ -292,7 +292,10 @@ namespace MatrixExponentialInternal { template void compute(const MatrixType &M, MatrixType* result) { - MatrixType num, den, U, V; + MatrixType num(M.rows(), M.cols()); + MatrixType den(M.rows(), M.cols()); + MatrixType U(M.rows(), M.cols()); + MatrixType V(M.rows(), M.cols()); MatrixType Id = MatrixType::Identity(M.rows(), M.cols()); float l1norm = static_cast(M.cwise().abs().colwise().sum().maxCoeff()); int squarings;