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

Commit 9ca77fc

Browse files
Use DiffEqBase high level handling
1 parent 9aab971 commit 9ca77fc

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ version = "0.1.5"
55

66
[deps]
77
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
8+
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
89
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
910
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
1011
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -15,6 +16,7 @@ StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
1516

1617
[compat]
1718
ArrayInterfaceCore = "0.1.1"
19+
DiffEqBase = "6.115"
1820
FiniteDiff = "2"
1921
ForwardDiff = "0.10.3"
2022
Reexport = "0.2, 1"

src/SimpleNonlinearSolve.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ using ForwardDiff: Dual
66
using StaticArraysCore
77
using LinearAlgebra
88
import ArrayInterfaceCore
9+
using DiffEqBase
910

1011
@reexport using SciMLBase
1112

@@ -28,11 +29,11 @@ import SnoopPrecompile
2829
SnoopPrecompile.@precompile_all_calls begin for T in (Float32, Float64)
2930
prob_no_brack = NonlinearProblem{false}((u, p) -> u .* u .- p, T(0.1), T(2))
3031
for alg in (SimpleNewtonRaphson, Broyden, Klement)
31-
solve(prob_no_brack, alg(), tol = T(1e-2))
32+
solve(prob_no_brack, alg(), abstol = T(1e-2))
3233
end
3334

3435
for alg in (TrustRegion(10.0),)
35-
solve(prob_no_brack, alg, tol = T(1e-2))
36+
solve(prob_no_brack, alg, abstol = T(1e-2))
3637
end
3738

3839
#=
@@ -47,7 +48,7 @@ SnoopPrecompile.@precompile_all_calls begin for T in (Float32, Float64)
4748

4849
prob_brack = IntervalNonlinearProblem{false}((u, p) -> u * u - p, T.((0.0, 2.0)), T(2))
4950
for alg in (Bisection, Falsi)
50-
solve(prob_brack, alg(), tol = T(1e-2))
51+
solve(prob_brack, alg(), abstol = T(1e-2))
5152
end
5253
end end
5354

src/broyden.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ and static array problems.
88
"""
99
struct Broyden <: AbstractSimpleNonlinearSolveAlgorithm end
1010

11-
function SciMLBase.solve(prob::NonlinearProblem,
11+
function SciMLBase.__solve(prob::NonlinearProblem,
1212
alg::Broyden, args...; abstol = nothing,
1313
reltol = nothing,
1414
maxiters = 1000, kwargs...)

src/klement.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This method is non-allocating on scalar problems.
88
"""
99
struct Klement <: AbstractSimpleNonlinearSolveAlgorithm end
1010

11-
function SciMLBase.solve(prob::NonlinearProblem,
11+
function SciMLBase.__solve(prob::NonlinearProblem,
1212
alg::Klement, args...; abstol = nothing,
1313
reltol = nothing,
1414
maxiters = 1000, kwargs...)

src/raphson.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct SimpleNewtonRaphson{CS, AD, FDT} <: AbstractNewtonAlgorithm{CS, AD, FDT}
3636
end
3737
end
3838

39-
function SciMLBase.solve(prob::NonlinearProblem,
39+
function SciMLBase.__solve(prob::NonlinearProblem,
4040
alg::SimpleNewtonRaphson, args...; abstol = nothing,
4141
reltol = nothing,
4242
maxiters = 1000, kwargs...)

src/trustRegion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct TrustRegion{CS, AD, FDT} <: AbstractNewtonAlgorithm{CS, AD, FDT}
7777
end
7878
end
7979

80-
function SciMLBase.solve(prob::NonlinearProblem,
80+
function SciMLBase.__solve(prob::NonlinearProblem,
8181
alg::TrustRegion, args...; abstol = nothing,
8282
reltol = nothing,
8383
maxiters = 1000, kwargs...)

0 commit comments

Comments
 (0)