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

libeigen/eigen!2261

Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
Rasmus Munk Larsen
2026-03-08 11:02:45 -07:00
parent be7538ed65
commit 7c3a344763
6 changed files with 66 additions and 95 deletions

View File

@@ -27,10 +27,8 @@ 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;
do {
j = internal::random<Index>(0, size - 1);
} while (j == i);
Index j = internal::random<Index>(0, size - 2);
if (j >= i) ++j;
m2 = m1;
m2.row(i).swap(m2.row(j));
VERIFY_IS_APPROX(m2.determinant(), -m1.determinant());