Skip to content

Commit

Permalink
Remove special iszero handling
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 8, 2023
1 parent af3e026 commit 90cbc1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/levenberg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ end

function perform_step!(cache::LevenbergMarquardtCache{true})
@unpack fu1, f, make_new_J = cache
if _iszero(fu1)
if iszero(fu1)
cache.force_stop = true
return nothing
end
Expand Down Expand Up @@ -256,7 +256,7 @@ end

function perform_step!(cache::LevenbergMarquardtCache{false})
@unpack fu1, f, make_new_J = cache
if _iszero(fu1)
if iszero(fu1)
cache.force_stop = true
return nothing
end
Expand Down
4 changes: 0 additions & 4 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ end
concrete_jac(_) = nothing
concrete_jac(::AbstractNewtonAlgorithm{CJ}) where {CJ} = CJ

# Circumventing https://github.com/SciML/RecursiveArrayTools.jl/issues/277
_iszero(x) = iszero(x)
_iszero(x::ArrayPartition) = all(_iszero, x.x)

_mutable_zero(x) = zero(x)
_mutable_zero(x::SArray) = MArray(x)

Expand Down

0 comments on commit 90cbc1a

Please sign in to comment.