mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Remove random retry loop in SVD min-norm test
libeigen/eigen!2263 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
@@ -174,11 +174,11 @@ void svd_min_norm(const MatrixType& m) {
|
||||
typedef Matrix<Scalar, ColsAtCompileTime, RankAtCompileTime2> MatrixType2T;
|
||||
Index rank = RankAtCompileTime2 == Dynamic ? internal::random<Index>(1, cols) : Index(RankAtCompileTime2);
|
||||
MatrixType2 m2(rank, cols);
|
||||
int guard = 0;
|
||||
do {
|
||||
m2.setRandom();
|
||||
} while (SVD_FOR_MIN_NORM(MatrixType2)(m2).setThreshold(test_precision<Scalar>()).rank() != rank && (++guard) < 100);
|
||||
VERIFY(guard < 100);
|
||||
m2.setRandom();
|
||||
if (SVD_FOR_MIN_NORM(MatrixType2)(m2).setThreshold(test_precision<Scalar>()).rank() != rank) {
|
||||
// Ensure full row rank by making the leading square block diagonally dominant.
|
||||
for (Index i = 0; i < rank; ++i) m2(i, i) += Scalar(1);
|
||||
}
|
||||
|
||||
RhsType2 rhs2 = RhsType2::Random(rank);
|
||||
// use QR to find a reference minimal norm solution
|
||||
|
||||
Reference in New Issue
Block a user