Skip to content

Commit f75cee5

Browse files
committed
Incorporate Muller into test suite
Add `left` and `right` fields to solution
1 parent c638323 commit f75cee5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/BracketingNonlinearSolve/src/BracketingNonlinearSolve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ end
4545

4646
@reexport using SciMLBase, NonlinearSolveBase
4747

48-
export Alefeld, Bisection, Brent, Falsi, Muller, ITP, Ridder
48+
export Alefeld, Bisection, Brent, Falsi, ITP, Muller, Ridder
4949

5050
end

lib/BracketingNonlinearSolve/src/muller.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ function CommonSolve.solve(prob::IntervalNonlinearProblem, alg::Muller, args...;
4343
# Termination Check
4444
if abstol abs(fxᵢ₊₁)
4545
return SciMLBase.build_solution(prob, alg, xᵢ₊₁, fxᵢ₊₁;
46-
retcode = ReturnCode.Success)
46+
retcode = ReturnCode.Success,
47+
left = xᵢ₊₁, right = xᵢ₊₁)
4748
end
4849

4950
xᵢ₋₂, xᵢ₋₁, xᵢ = xᵢ₋₁, xᵢ, xᵢ₊₁
5051
fxᵢ₋₂, fxᵢ₋₁, fxᵢ = fxᵢ₋₁, fxᵢ, fxᵢ₊₁
5152
end
5253

5354
return SciMLBase.build_solution(prob, alg, xᵢ₊₁, fxᵢ₊₁;
54-
retcode = ReturnCode.MaxIters)
55+
retcode = ReturnCode.MaxIters,
56+
left = xᵢ₊₁, right = xᵢ₊₁)
5557
end

lib/BracketingNonlinearSolve/test/rootfind_tests.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ end
77
@testitem "Interval Nonlinear Problems" setup=[RootfindingTestSnippet] tags=[:core] begin
88
using ForwardDiff
99

10-
@testset for alg in (
11-
Alefeld(), Bisection(), Brent(), Falsi(), ITP(), Muller(), Ridder(), nothing)
10+
@testset for alg in (Alefeld(), Bisection(), Brent(), Falsi(), ITP(), Muller(), Ridder(), nothing)
1211
tspan = (1.0, 20.0)
1312

1413
function g(p)
@@ -77,8 +76,7 @@ end
7776
end
7877

7978
@testitem "Flipped Signs and Reversed Tspan" setup=[RootfindingTestSnippet] tags=[:core] begin
80-
@testset for alg in (
81-
Alefeld(), Bisection(), Brent(), Falsi(), ITP(), Muller(), Ridder(), nothing)
79+
@testset for alg in (Alefeld(), Bisection(), Brent(), Falsi(), ITP(), Muller(), Ridder(), nothing)
8280
f1(u, p) = u * u - p
8381
f2(u, p) = p - u * u
8482

0 commit comments

Comments
 (0)