Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,6 @@ julia> enclose(x -> -x^3/6 + 5x, 1..4, BranchAndBoundEnclosure(tol=1e-2); df=x->
"""
Base.@kwdef struct BranchAndBoundEnclosure <: AbstractIterativeRangeAlgorithm
maxdepth = 10
tol = 1e-3
atol = 1e-6
rtol = 1e-3
end
2 changes: 1 addition & 1 deletion src/branchandbound.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function _branch_bound(bab::BranchAndBoundEnclosure, f::Function, X::Interval_or

fX = f(X) # TODO: allow user to choose how to evaluate this (mean value, natural enclosure)
# if tolerance or maximum number of iteration is met, return current enclosure
if diam(fX) <= bab.tol || cnt == bab.maxdepth
if diam(fX) <= min(bab.atol, bab.rtol * minimum(fX)) || cnt == bab.maxdepth
Comment thread
schillic marked this conversation as resolved.
Outdated
return hull(fX, initial)
end

Expand Down