@@ -119,7 +119,8 @@ IntervalLike{T} = Union{Interval{T}, IntervalBox{T}}
119
119
NewtonLike = Union{Type{Newton}, Type{Krawczyk}}
120
120
121
121
"""
122
- roots(f, X, contractor, tol=1e-3 ; deriv=nothing)
122
+ roots(f, X, contractor, tol=1e-3)
123
+ roots(f, deriv, X, contractor, tol=1e-3)
123
124
124
125
Uses a generic branch and prune routine to find in principle all isolated roots of a function
125
126
`f:R^n → R^n` in a box `X`, or a vector of boxes.
@@ -134,15 +135,15 @@ Inputs:
134
135
135
136
"""
136
137
# Contractor specific `roots` functions
137
- function roots (f, X:: IntervalLike{T} , :: Type{Bisection} , tol:: Float64 = 1e-3 ; deriv = nothing ) where {T}
138
+ function roots (f, X:: IntervalLike{T} , :: Type{Bisection} , tol:: Float64 = 1e-3 ) where {T}
138
139
branch_and_prune (X, Bisection (f), tol)
139
140
end
140
141
141
142
function roots (f, X:: Interval{T} , C:: NewtonLike , tol:: Float64 = 1e-3 ) where {T}
142
143
143
144
deriv = x -> ForwardDiff. derivative (f, x)
144
145
145
- branch_and_prune (X, C ( f, deriv) , tol)
146
+ roots ( f, deriv, X, C , tol)
146
147
end
147
148
148
149
function roots (f, deriv, X:: Interval{T} , C:: NewtonLike , tol:: Float64 = 1e-3 ) where {T}
@@ -153,7 +154,7 @@ function roots(f, X::IntervalBox{T}, C::NewtonLike, tol::Float64=1e-3) where {T}
153
154
154
155
deriv = x -> ForwardDiff. jacobian (f, x)
155
156
156
- branch_and_prune (X, C ( f, deriv) , tol)
157
+ roots ( f, deriv, X, C , tol)
157
158
end
158
159
159
160
function roots (f, deriv, X:: IntervalBox{T} , C:: NewtonLike , tol:: Float64 = 1e-3 ) where {T}
0 commit comments