Skip to content

Commit 73f7d1f

Browse files
Fix generic fallbacks for L2Norm
Fixes #524
1 parent 2409838 commit 73f7d1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/NonlinearSolveBase/src/common_defaults.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ function NAN_CHECK(x::Union{AbstractVectorOfArray, ArrayPartition})
1515
end
1616

1717
L2_NORM(u::Union{AbstractFloat, Complex}) = @fastmath abs(u)
18-
L2_NORM(u::AbstractArray) = @fastmath sqrt(UNITLESS_ABS2(u))
19-
function L2_NORM(u::AbstractArray{<:Union{AbstractFloat, Complex}})
18+
L2_NORM(u::Number) = @fastmath sqrt(UNITLESS_ABS2(u))
19+
function L2_NORM(u::Array{<:Union{AbstractFloat, Complex}})
2020
if Utils.fast_scalar_indexing(u)
2121
x = zero(eltype(u))
2222
@simd for i in eachindex(u)

0 commit comments

Comments
 (0)