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

Commit da79200

Browse files
committed
Testing out a vmap implementation
1 parent 32d2f42 commit da79200

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SimpleNonlinearSolve"
22
uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7"
33
authors = ["SciML"]
4-
version = "1.7.0"
4+
version = "1.7.1"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

Diff for: src/nlsolve/dfsane.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SimpleDFSane{M}, args...
110110
fx_norm_new = NONLINEARSOLVE_DEFAULT_NORM(fx)^nexp
111111

112112
while k < maxiters
113-
Bool(fx_norm_new (f_bar + η - γ * α_p^2 * fx_norm)) && break
113+
all(fx_norm_new (f_bar + η - γ * α_p^2 * fx_norm)) && break
114114

115115
α_tp = α_p^2 * fx_norm / (fx_norm_new + (T(2) * α_p - T(1)) * fx_norm)
116116
@bb @. x_cache = x - α_m * d
117117

118118
fx = __eval_f(prob, fx, x_cache)
119119
fx_norm_new = NONLINEARSOLVE_DEFAULT_NORM(fx)^nexp
120120

121-
Bool(fx_norm_new (f_bar + η - γ * α_m^2 * fx_norm)) && break
121+
all(fx_norm_new (f_bar + η - γ * α_m^2 * fx_norm)) && break
122122

123123
α_tm = α_m^2 * fx_norm / (fx_norm_new + (T(2) * α_m - T(1)) * fx_norm)
124124
α_p = clamp(α_tp, τ_min * α_p, τ_max * α_p)

Diff for: src/utils.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -321,19 +321,19 @@ function check_termination(tc_cache, fx, x, xo, prob, alg)
321321
end
322322
function check_termination(tc_cache, fx, x, xo, prob, alg,
323323
::AbstractNonlinearTerminationMode)
324-
tc_cache(fx, x, xo) &&
324+
all(tc_cache(fx, x, xo)) &&
325325
return build_solution(prob, alg, x, fx; retcode = ReturnCode.Success)
326326
return nothing
327327
end
328328
function check_termination(tc_cache, fx, x, xo, prob, alg,
329329
::AbstractSafeNonlinearTerminationMode)
330-
tc_cache(fx, x, xo) &&
330+
all(tc_cache(fx, x, xo)) &&
331331
return build_solution(prob, alg, x, fx; retcode = tc_cache.retcode)
332332
return nothing
333333
end
334334
function check_termination(tc_cache, fx, x, xo, prob, alg,
335335
::AbstractSafeBestNonlinearTerminationMode)
336-
if tc_cache(fx, x, xo)
336+
if all(tc_cache(fx, x, xo))
337337
if isinplace(prob)
338338
prob.f(fx, x, prob.p)
339339
else

0 commit comments

Comments
 (0)