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

Use a mutable struct instead of Dict for Safe termination #61

Merged
merged 1 commit into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Manifest.toml

.vscode
wip
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SimpleBatchedNonlinearSolveExt = "NNlib"

[compat]
ArrayInterface = "6, 7"
DiffEqBase = "6.119"
DiffEqBase = "6.123.0"
FiniteDiff = "2"
ForwardDiff = "0.10.3"
NNlib = "0.8"
Expand Down
3 changes: 2 additions & 1 deletion ext/SimpleBatchedNonlinearSolveExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::Broyden{true}, args...;
error("Broyden currently doesn't support SAFE_BEST termination modes")
end

storage = mode ∈ DiffEqBase.SAFE_TERMINATION_MODES ? Dict() : nothing
storage = mode ∈ DiffEqBase.SAFE_TERMINATION_MODES ? NLSolveSafeTerminationResult() :
nothing
termination_condition = tc(storage)

xₙ = x
Expand Down
3 changes: 2 additions & 1 deletion src/broyden.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::Broyden{false}, args...;
error("Broyden currently doesn't support SAFE_BEST termination modes")
end

storage = mode ∈ DiffEqBase.SAFE_TERMINATION_MODES ? Dict() : nothing
storage = mode ∈ DiffEqBase.SAFE_TERMINATION_MODES ? NLSolveSafeTerminationResult() :
nothing
termination_condition = tc(storage)

xₙ = x
Expand Down
3 changes: 2 additions & 1 deletion src/lbroyden.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ end
error("LBroyden currently doesn't support SAFE_BEST termination modes")
end

storage = mode ∈ DiffEqBase.SAFE_TERMINATION_MODES ? Dict() : nothing
storage = mode ∈ DiffEqBase.SAFE_TERMINATION_MODES ? NLSolveSafeTerminationResult() :
nothing
termination_condition = tc(storage)

xₙ = x
Expand Down