From 5172247ee18dae949589db5e13de669bc618e321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Gauth=C3=A9?= Date: Wed, 17 Dec 2025 16:49:55 +0100 Subject: [PATCH 1/3] =?UTF-8?q?check=20error=20with=20=E2=89=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/matrixproperties.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/matrixproperties.jl b/src/common/matrixproperties.jl index 5a73176e..25876b90 100644 --- a/src/common/matrixproperties.jl +++ b/src/common/matrixproperties.jl @@ -157,7 +157,7 @@ function strided_ishermitian_approx( for j in 1:blocksize:n jb = min(blocksize, n - j + 1) ϵ² += _ishermitian_approx_diag(view(A, j:(j + jb - 1), j:(j + jb - 1)), anti) - ϵ² < ϵ²max || return false + ϵ² ≤ ϵ²max || return false for i in 1:blocksize:(j - 1) ib = blocksize ϵ² += 2 * _ishermitian_approx_offdiag( @@ -165,7 +165,7 @@ function strided_ishermitian_approx( view(A, j:(j + jb - 1), i:(i + ib - 1)), anti ) - ϵ² < ϵ²max || return false + ϵ² ≤ ϵ²max || return false end end return true From 5891ac0dc33725ef44f715ee6efb295daff7ae25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Gauth=C3=A9?= Date: Wed, 17 Dec 2025 16:57:23 +0100 Subject: [PATCH 2/3] add test --- test/projections.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/projections.jl b/test/projections.jl index 3923528e..9073577f 100644 --- a/test/projections.jl +++ b/test/projections.jl @@ -1,4 +1,5 @@ using MatrixAlgebraKit +using MatrixAlgebraKit: check_hermitian, default_hermitian_tol using Test using TestExtras using StableRNGs @@ -10,6 +11,12 @@ const BLASFloats = (Float32, Float64, ComplexF32, ComplexF64) rng = StableRNG(123) m = 54 noisefactor = eps(real(T))^(3 / 4) + + mat0 = zeros(T, (1,1)) + @test ishermitian(mat0) + @test ishermitian(mat0; atol=default_hermitian_tol(mat0)) + @test isnothing(check_hermitian(mat0)) + for alg in (NativeBlocked(blocksize = 16), NativeBlocked(blocksize = 32), NativeBlocked(blocksize = 64)) for A in (randn(rng, T, m, m), Diagonal(randn(rng, T, m))) Ah = (A + A') / 2 From eb1eef80c0477b0db953dbbb07b3293462e4be3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Gauth=C3=A9?= Date: Wed, 17 Dec 2025 16:58:21 +0100 Subject: [PATCH 3/3] runic --- test/projections.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/projections.jl b/test/projections.jl index 9073577f..9a6644cf 100644 --- a/test/projections.jl +++ b/test/projections.jl @@ -12,9 +12,9 @@ const BLASFloats = (Float32, Float64, ComplexF32, ComplexF64) m = 54 noisefactor = eps(real(T))^(3 / 4) - mat0 = zeros(T, (1,1)) + mat0 = zeros(T, (1, 1)) @test ishermitian(mat0) - @test ishermitian(mat0; atol=default_hermitian_tol(mat0)) + @test ishermitian(mat0; atol = default_hermitian_tol(mat0)) @test isnothing(check_hermitian(mat0)) for alg in (NativeBlocked(blocksize = 16), NativeBlocked(blocksize = 32), NativeBlocked(blocksize = 64))