Revert "Remove random retry loops in tests (batch 2: indices and integer types)"

This reverts merge request !2261
This commit is contained in:
Rasmus Munk Larsen
2026-03-09 20:01:53 -07:00
parent 54458cb39d
commit 42b6c43cfe
6 changed files with 95 additions and 66 deletions

View File

@@ -27,8 +27,10 @@ void determinant(const MatrixType& m) {
VERIFY_IS_APPROX((m1 * m2).eval().determinant(), m1.determinant() * m2.determinant());
if (size == 1) return;
Index i = internal::random<Index>(0, size - 1);
Index j = internal::random<Index>(0, size - 2);
if (j >= i) ++j;
Index j;
do {
j = internal::random<Index>(0, size - 1);
} while (j == i);
m2 = m1;
m2.row(i).swap(m2.row(j));
VERIFY_IS_APPROX(m2.determinant(), -m1.determinant());