diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2015-03-03 17:08:28 +0100 |
---|---|---|
committer | Marc Glisse <marc.glisse@inria.fr> | 2015-03-03 17:08:28 +0100 |
commit | 37a93c4263324011242941cff87d444e9c465422 (patch) | |
tree | c5ce1473b666a568d5d102389f6d2427bb708dd4 /Eigen/src/QR | |
parent | ccc1277a42f254b184b750292a7cd672a58bbc63 (diff) |
New scoring functor to select the pivot.
This is can be useful for non-floating point scalars, where choosing the biggest element is generally not the best choice.
Diffstat (limited to 'Eigen/src/QR')
-rw-r--r-- | Eigen/src/QR/FullPivHouseholderQR.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Eigen/src/QR/FullPivHouseholderQR.h b/Eigen/src/QR/FullPivHouseholderQR.h index 7d5e58d2f..4952fbb46 100644 --- a/Eigen/src/QR/FullPivHouseholderQR.h +++ b/Eigen/src/QR/FullPivHouseholderQR.h @@ -443,13 +443,15 @@ FullPivHouseholderQR<MatrixType>& FullPivHouseholderQR<MatrixType>::compute(cons for (Index k = 0; k < size; ++k) { Index row_of_biggest_in_corner, col_of_biggest_in_corner; - RealScalar biggest_in_corner; + typedef internal::scalar_score_coeff_op<Scalar> Scoring; + typedef typename Scoring::result_type Score; - biggest_in_corner = m_qr.bottomRightCorner(rows-k, cols-k) - .cwiseAbs() - .maxCoeff(&row_of_biggest_in_corner, &col_of_biggest_in_corner); + Score score = m_qr.bottomRightCorner(rows-k, cols-k) + .unaryExpr(Scoring()) + .maxCoeff(&row_of_biggest_in_corner, &col_of_biggest_in_corner); row_of_biggest_in_corner += k; col_of_biggest_in_corner += k; + RealScalar biggest_in_corner = internal::abs_knowing_score<Scalar>()(m_qr(row_of_biggest_in_corner, col_of_biggest_in_corner), score); if(k==0) biggest = biggest_in_corner; // if the corner is negligible, then we have less than full rank, and we can finish early |