Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit caf295c

Browse files
committed
Handle Klement
1 parent 009dc15 commit caf295c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/nlsolve/klement.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SimpleKlement, args...;
2525
@bb δx² = similar(x)
2626

2727
for _ in 1:maxiters
28-
any(iszero, J) && (J = __init_identity_jacobian!!(J))
28+
any(any(iszero, J)) && (J = __init_identity_jacobian!!(J))
2929

3030
@bb @. δx = fprev / J
3131

src/utils.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ __max_tdir(a, b, x0, x1) = ifelse(x1 > x0, max(a, b), min(a, b))
2222
__standard_tag(::Nothing, f::F, x::AbstractArray{T}) where {F, T} = ForwardDiff.Tag(f, T)
2323
__standard_tag(tag::ForwardDiff.Tag, f::F, x::AbstractArray{T}) where {F, T} = tag
2424
__standard_tag(tag, f::F, x::AbstractArray{T}) where {F, T} = ForwardDiff.Tag(tag, T)
25+
__standard_tag(::Nothing, f::F, x::T) where {F, T <: Number} = ForwardDiff.Tag(f, T)
26+
__standard_tag(tag::ForwardDiff.Tag, f::F, x::T) where {F, T <: Number} = tag
27+
__standard_tag(tag, f::F, x::T) where {F, T <: Number} = ForwardDiff.Tag(tag, T)
2528

2629
__pick_forwarddiff_chunk(x) = ForwardDiff.Chunk(length(x))
2730
function __pick_forwarddiff_chunk(x::StaticArray)

0 commit comments

Comments
 (0)