Fix ambiguous static_cast in JacobiSVD blocking threshold computation

The L2 cache size threshold computation used numext::sqrt with a
static_cast<RealScalar>, which fails to compile when RealScalar is
AnnoyingScalar (a test-only type with multiple conversion constructors).
Since this is a pure cache-size computation unrelated to the matrix
scalar type, use std::sqrt(double) instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rasmus Munk Larsen
2026-02-25 19:03:01 -08:00
parent a31de4778d
commit e567151ce3

View File

@@ -774,7 +774,7 @@ JacobiSVD<MatrixType, Options>& JacobiSVD<MatrixType, Options>::compute_impl(con
const Index blockingThreshold = EIGEN_JACOBI_SVD_BLOCKING_THRESHOLD;
#else
const Index blockingThreshold =
static_cast<Index>(numext::sqrt(static_cast<RealScalar>(l2CacheSize() / sizeof(float))));
static_cast<Index>(std::sqrt(static_cast<double>(l2CacheSize() / sizeof(float))));
#endif
if (n >= blockingThreshold) {