From abb2a1bb1568bf0ab1b49c20ead8548bbb2b186e Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Wed, 18 Nov 2009 17:44:20 -0500 Subject: [PATCH] simplification --- Eigen/src/SVD/JacobiSVD.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Eigen/src/SVD/JacobiSVD.h b/Eigen/src/SVD/JacobiSVD.h index 2f7ebb160..5792c5767 100644 --- a/Eigen/src/SVD/JacobiSVD.h +++ b/Eigen/src/SVD/JacobiSVD.h @@ -294,8 +294,6 @@ JacobiSVD& JacobiSVD::compute(const Ma int rows = matrix.rows(); int cols = matrix.cols(); int diagSize = std::min(rows, cols); - if(ComputeU) m_matrixU = MatrixUType::Zero(rows,rows); - if(ComputeV) m_matrixV = MatrixVType::Zero(cols,cols); m_singularValues.resize(diagSize); const RealScalar precision = 2 * epsilon(); @@ -303,8 +301,8 @@ JacobiSVD& JacobiSVD::compute(const Ma && !ei_svd_precondition_if_more_cols_than_rows::run(matrix, work_matrix, *this)) { work_matrix = matrix.block(0,0,diagSize,diagSize); - if(ComputeU) m_matrixU.diagonal().setOnes(); - if(ComputeV) m_matrixV.diagonal().setOnes(); + if(ComputeU) m_matrixU.setIdentity(rows,rows); + if(ComputeV) m_matrixV.setIdentity(cols,cols); } bool finished = false;