File tree Expand file tree Collapse file tree 3 files changed +3
-9
lines changed Expand file tree Collapse file tree 3 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -132,9 +132,7 @@ function perform_step!(cache::GaussNewtonCache{false})
132
132
cache. u = @. u - cache. du # `u` might not support mutation
133
133
cache. fu_new = f (cache. u, p)
134
134
135
- (cache. internalnorm (cache. fu_new .- cache. fu1) < cache. abstol ||
136
- cache. internalnorm (cache. fu_new) < cache. abstol) &&
137
- (cache. force_stop = true )
135
+ (cache. internalnorm (cache. fu_new) < cache. abstol) && (cache. force_stop = true )
138
136
cache. fu1 = cache. fu_new
139
137
cache. stats. nf += 1
140
138
cache. stats. njacs += 1
Original file line number Diff line number Diff line change 185
185
186
186
function perform_step! (cache:: LevenbergMarquardtCache{true} )
187
187
@unpack fu1, f, make_new_J = cache
188
- if _iszero (fu1)
188
+ if iszero (fu1)
189
189
cache. force_stop = true
190
190
return nothing
191
191
end
256
256
257
257
function perform_step! (cache:: LevenbergMarquardtCache{false} )
258
258
@unpack fu1, f, make_new_J = cache
259
- if _iszero (fu1)
259
+ if iszero (fu1)
260
260
cache. force_stop = true
261
261
return nothing
262
262
end
Original file line number Diff line number Diff line change 129
129
concrete_jac (_) = nothing
130
130
concrete_jac (:: AbstractNewtonAlgorithm{CJ} ) where {CJ} = CJ
131
131
132
- # Circumventing https://github.com/SciML/RecursiveArrayTools.jl/issues/277
133
- _iszero (x) = iszero (x)
134
- _iszero (x:: ArrayPartition ) = all (_iszero, x. x)
135
-
136
132
_mutable_zero (x) = zero (x)
137
133
_mutable_zero (x:: SArray ) = MArray (x)
138
134
You can’t perform that action at this time.
0 commit comments