diff options
author | Gael Guennebaud <g.gael@free.fr> | 2013-11-04 23:58:18 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2013-11-04 23:58:18 +0100 |
commit | a236e15048014290b02472c18e8fb21d2a6ed99c (patch) | |
tree | ee720e3b82818bf4dd06d35656288ecf3230afea | |
parent | ad1dc50b5779f4e6f87eb9e5865ce6fcfcc5a828 (diff) |
JacobiSVD: fix a 0/0 issue for complexes
-rw-r--r-- | Eigen/src/SVD/JacobiSVD.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Eigen/src/SVD/JacobiSVD.h b/Eigen/src/SVD/JacobiSVD.h index 98a3ba22a..747a4f958 100644 --- a/Eigen/src/SVD/JacobiSVD.h +++ b/Eigen/src/SVD/JacobiSVD.h @@ -380,7 +380,10 @@ struct svd_precondition_2x2_block_to_be_real<MatrixType, QRPreconditioner, true> z = abs(work_matrix.coeff(p,q)) / work_matrix.coeff(p,q); work_matrix.row(p) *= z; if(svd.computeU()) svd.m_matrixU.col(p) *= conj(z); - z = abs(work_matrix.coeff(q,q)) / work_matrix.coeff(q,q); + if(work_matrix.coeff(q,q)!=Scalar(0)) + z = abs(work_matrix.coeff(q,q)) / work_matrix.coeff(q,q); + else + z = Scalar(0); work_matrix.row(q) *= z; if(svd.computeU()) svd.m_matrixU.col(q) *= conj(z); } |