fix stuff after the PermutationMatrix changes.

I still have JacobiSVD errors when cols>rows
This commit is contained in:
Benoit Jacob
2009-11-18 12:41:24 -05:00
parent 94c706d04f
commit 8860203e6a
4 changed files with 13 additions and 10 deletions

View File

@@ -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;