mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
JacobiSVD: fix a 0/0 issue for complexes
This commit is contained in:
parent
ad1dc50b57
commit
a236e15048
@ -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);
|
z = abs(work_matrix.coeff(p,q)) / work_matrix.coeff(p,q);
|
||||||
work_matrix.row(p) *= z;
|
work_matrix.row(p) *= z;
|
||||||
if(svd.computeU()) svd.m_matrixU.col(p) *= conj(z);
|
if(svd.computeU()) svd.m_matrixU.col(p) *= conj(z);
|
||||||
|
if(work_matrix.coeff(q,q)!=Scalar(0))
|
||||||
z = abs(work_matrix.coeff(q,q)) / work_matrix.coeff(q,q);
|
z = abs(work_matrix.coeff(q,q)) / work_matrix.coeff(q,q);
|
||||||
|
else
|
||||||
|
z = Scalar(0);
|
||||||
work_matrix.row(q) *= z;
|
work_matrix.row(q) *= z;
|
||||||
if(svd.computeU()) svd.m_matrixU.col(q) *= conj(z);
|
if(svd.computeU()) svd.m_matrixU.col(q) *= conj(z);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user