From e567151ce3fcb0c596a80e57f4255c49c4fedea5 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Wed, 25 Feb 2026 19:03:01 -0800 Subject: [PATCH] Fix ambiguous static_cast in JacobiSVD blocking threshold computation The L2 cache size threshold computation used numext::sqrt with a static_cast, 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) --- Eigen/src/SVD/JacobiSVD.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eigen/src/SVD/JacobiSVD.h b/Eigen/src/SVD/JacobiSVD.h index e9c0f0df2..77ef3bed8 100644 --- a/Eigen/src/SVD/JacobiSVD.h +++ b/Eigen/src/SVD/JacobiSVD.h @@ -774,7 +774,7 @@ JacobiSVD& JacobiSVD::compute_impl(con const Index blockingThreshold = EIGEN_JACOBI_SVD_BLOCKING_THRESHOLD; #else const Index blockingThreshold = - static_cast(numext::sqrt(static_cast(l2CacheSize() / sizeof(float)))); + static_cast(std::sqrt(static_cast(l2CacheSize() / sizeof(float)))); #endif if (n >= blockingThreshold) {