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;