mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
fix stuff after the PermutationMatrix changes.
I still have JacobiSVD errors when cols>rows
This commit is contained in:
@@ -236,9 +236,8 @@ struct ei_svd_precondition_if_more_rows_than_cols<MatrixType, Options, true>
|
||||
FullPivHouseholderQR<MatrixType> qr(matrix);
|
||||
work_matrix = qr.matrixQR().block(0,0,diagSize,diagSize).template triangularView<UpperTriangular>();
|
||||
if(ComputeU) svd.m_matrixU = qr.matrixQ();
|
||||
if(ComputeV)
|
||||
for(int i = 0; i < cols; i++)
|
||||
svd.m_matrixV.coeffRef(qr.colsPermutation().coeff(i),i) = Scalar(1);
|
||||
if(ComputeV) svd.m_matrixV = qr.colsPermutation();
|
||||
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
@@ -281,9 +280,7 @@ struct ei_svd_precondition_if_more_cols_than_rows<MatrixType, Options, true>
|
||||
FullPivHouseholderQR<TransposeTypeWithSameStorageOrder> qr(matrix.adjoint());
|
||||
work_matrix = qr.matrixQR().block(0,0,diagSize,diagSize).template triangularView<UpperTriangular>().adjoint();
|
||||
if(ComputeV) svd.m_matrixV = qr.matrixQ();
|
||||
if(ComputeU)
|
||||
for(int i = 0; i < rows; i++)
|
||||
svd.m_matrixU.coeffRef(qr.colsPermutation().coeff(i),i) = Scalar(1);
|
||||
if(ComputeU) svd.m_matrixU = qr.colsPermutation();
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
|
||||
Reference in New Issue
Block a user