Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Improve the upper bound of TMs with range bounders #88

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/bounds.jl
Expand Up @@ -156,7 +156,7 @@ the bound of `fT` gets tighter than `ϵ` or the number of steps reachs `max_iter
The returned bound corresponds to the improved polynomial bound with the remainder
of the `TaylorModel1` included.
"""
function linear_dominated_bounder(fT::TaylorModel1{T, S}; ϵ=1e-3, max_iter=5) where {T, S}
function linear_dominated_bounder(fT::TaylorModel1{T, S}; ϵ::Float64=1e-3, max_iter::Int=5) where {T, S}
d = 1.
Dn = fT.dom
Dm = fT.x0
Expand Down Expand Up @@ -195,6 +195,24 @@ function linear_dominated_bounder(fT::TaylorModel1{T, S}; ϵ=1e-3, max_iter=5) w
return interval(bound.lo, hi) + fT.rem
end

function linear_dominated_bounder(fT::TaylorModel1{T, S}, bound::Symbol=:lower, max_iter::Int=5, tol::Float64=1e-5) where {T, S}
if bound == :upper
bound = -linear_dominated_bounder(-fT, ϵ=tol, max_iter=max_iter)
elseif bound == :lower
bound = linear_dominated_bounder(fT, ϵ=tol, max_iter=max_iter)
elseif bound == :both
ldb_bounds = Array{Interval{T}}(undef, 2)
aux = [-1, 1]
Threads.@threads for i in eachindex(aux)
@inbounds ldb_bounds[i] = aux[i] * linear_dominated_bounder(aux[i] * fT, ϵ=tol, max_iter=max_iter)
end
bound = ldb_bounds[1] ∩ ldb_bounds[2]
end

return bound
end


"""
linear_dominated_bounder(fT::TaylorModelN, ϵ=1e-3::Float64, max_iter=5::Int)

Expand Down