tweak warn message

This commit is contained in:
Gaspard Jankowiak 2025-02-11 13:41:56 +01:00
commit cba0d34f99

View file

@ -44,7 +44,7 @@ function check(f, Jf, x, constant_components::Vector{Int}=Int[]; f_kwargs...)
error_array = [norm(vec(f(x + ε * direction; f_kwargs...) - f_x) - ε * Jf_x * direction) for ε in ε_array] error_array = [norm(vec(f(x + ε * direction; f_kwargs...) - f_x) - ε * Jf_x * direction) for ε in ε_array]
else else
@tensor begin @tensor begin
Jf_x_direction[i,j] := Jf_x[i,j,k] * direction[k] Jf_x_direction[i, j] := Jf_x[i, j, k] * direction[k]
end end
error_array = [norm(f(x + ε * direction; f_kwargs...) - f_x - ε * Jf_x_direction) for ε in ε_array] error_array = [norm(f(x + ε * direction; f_kwargs...) - f_x - ε * Jf_x_direction) for ε in ε_array]
@ -52,7 +52,7 @@ function check(f, Jf, x, constant_components::Vector{Int}=Int[]; f_kwargs...)
m = maximum(error_array) m = maximum(error_array)
if m < 1e-8 if m < 1e-8
@warn "f looks linear!" @warn "f looks constant or linear!"
return true return true
end end