Skip to content

Commit 10a710f

Browse files
authored
add adjust_bracket (#442)
1 parent 006fc11 commit 10a710f

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Roots"
22
uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
3-
version = "2.1.7"
3+
version = "2.1.8"
44

55
[deps]
66
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"

src/Bracketing/chandrapatlu.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ end
2424
# a = most recent, b prior
2525
function init_state(::Chandrapatla, F, x₀, x₁, fx₀, fx₁)
2626
a, b, fa, fb = x₁, x₀, fx₁, fx₀
27+
assert_bracket(fa, fb)
2728
c, fc = a, fa
2829
ChandrapatlaState(promote(a, b, c)..., promote(fa, fb, fc)...)
2930
end

test/test_bracketing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ end
313313
@test avg(cnts) <= 3000
314314

315315
## issue 412 check for bracket
316-
f = x -> x - 1
317316
for M in Ms
318-
@test_throws ArgumentError find_zero(f, (-3, 0), M)
317+
@test_throws ArgumentError find_zero(x -> x - 1, (-3, 0), M)
318+
@test_throws ArgumentError find_zero(x -> 1 + x^2, (10, 20), M)
319319
end
320320
end
321321

0 commit comments

Comments
 (0)