Skip to content

Commit

Permalink
Cleaninh up
Browse files Browse the repository at this point in the history
  • Loading branch information
lbenet committed Aug 15, 2024
1 parent 74321f5 commit 2277969
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 34 deletions.
24 changes: 9 additions & 15 deletions src/bounds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,19 @@ Joldes PhD thesis (pp 52).
"""
function bound_remainder(::Type{TaylorModel1}, f::Function, polf::Taylor1, polfI::Taylor1, x0, I::Interval)

_order = get_order(polf) + 1
fTIend = polfI[_order]
bb = sup(fTIend) < 0 || inf(fTIend) > 0
return _monot_bound_remainder(TaylorModel1, Val(bb), f, polf, polfI, x0, I)
end
function bound_remainder(::Type{TaylorModel1}, f::Function, polf::Taylor1{TaylorN{T}}, polfI::Taylor1, x0, I::Interval) where {T}
# The domain of the TaylorN part is assumed to be
# the normalized symmetric box
_order = get_order(polf) + 1
fTIend = polfI[_order]
bb = sup(fTIend) < 0 || inf(fTIend) > 0
return _monot_bound_remainder(TaylorModel1, Val(bb), f, polf, polfI, x0, I)
end
# function bound_remainder(::Type{TaylorModel1}, f::Function, polf::Taylor1{TaylorN{T}}, polfI::Taylor1, x0, I::Interval) where {T}
# # The domain of the TaylorN part is assumed to be
# # the normalized symmetric box
# _order = get_order(polf) + 1
# fTIend = polfI[_order]
# bb = sup(fTIend) < 0 || inf(fTIend) > 0
# return _monot_bound_remainder(TaylorModel1, Val(bb), f, polf, polfI, x0, I)
# end


"""
Expand All @@ -45,7 +44,6 @@ remainder. This corresponds to Prop 2.3.7 in Mioara Joldes' PhD thesis (pp 67).
"""
function bound_remainder(::Type{RTaylorModel1}, f::Function, polf::Taylor1, polfI::Taylor1, x0, I::Interval)

_order = get_order(polf) + 1
fTIend = polfI[_order+1]
a = Interval(inf(I))
Expand Down Expand Up @@ -85,6 +83,7 @@ end
Δx0 = (f(x0) - polf[0])(symIbox)
return hull(Δlo, Δx0, Δhi)
end

"""
_monot_bound_remainder(::Type{TaylorModel1}, ::Val{false}, f::Function, polf::Taylor1, polfI::Taylor1, x0, I::Interval)
Expand All @@ -105,7 +104,6 @@ Computes the remainder exploiting monotonicity; see Prop 2.3.7 in Mioara Joldes'
"""
@inline function _monot_bound_remainder(::Type{RTaylorModel1}, ::Val{true}, f::Function,
polf::Taylor1, polfI::Taylor1, x0, I::Interval)

_order = get_order(polf) + 1
a = Interval(inf(I))
b = Interval(sup(I))
Expand All @@ -122,7 +120,6 @@ Computes the remainder exploiting monotonicity; see Prop 2.3.7 in Mioara Joldes'
end
@inline function _monot_bound_remainder(::Type{RTaylorModel1}, ::Val{true}, f::Function,
polf::Taylor1{TaylorN{T}}, polfI::Taylor1, x0, I::Interval) where {T}

_order = get_order(polf) + 1
a = Interval(inf(I))
b = Interval(sup(I))
Expand Down Expand Up @@ -157,7 +154,6 @@ tighter bound.
"""
function bound_taylor1(fT::Taylor1, I::Interval)

# Check if the fT is monotonous (the derivative has a given sign)
fTd = TaylorSeries.derivative(fT)
range_deriv = fTd(I)
Expand Down Expand Up @@ -189,7 +185,6 @@ a definite sign.
"""
function bound_taylor1(fT::Taylor1{T}, fTd::Taylor1{T}, I::Interval{T}) where {T}
#
I_lo = inf(I)
I_hi = sup(I)
if inf(fTd(I)) 0
Expand All @@ -201,7 +196,6 @@ function bound_taylor1(fT::Taylor1{T}, fTd::Taylor1{T}, I::Interval{T}) where {T
end
function bound_taylor1(fT::Taylor1{Interval{T}}, fTd::Taylor1{Interval{T}},
I::Interval{S}) where {T,S}
#
I_lo = inf(I)
I_hi = sup(I)
if inf(fTd(I)) 0
Expand Down
1 change: 0 additions & 1 deletion src/promotion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# # Promotion
function promote(a::TaylorModelN{N,T,S}, b::R) where {N, T<:Real, S<:Real, R<:Real}
orderTMN = get_order(a[0])
apol, bb = promote(a.pol, b)
a_rem = remainder(a)
return (TaylorModelN(apol, a_rem, expansion_point(a), domain(a)),
Expand Down
18 changes: 0 additions & 18 deletions src/valid_integ/validated_integ.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@ function _validated_integ!(f!, t0::T, tmax::T, x, dx, xI, dxI,
xTM1v[:, 1] = TaylorModel1(deepcopy(x), zI, zI, zI)
end

# # parse_eqs == false
# # Internals: jet transport integration
# xaux = Array{Taylor1{TaylorN{T}}}(undef, dof)
# # Internals: Taylor1{Interval{T}} integration
# xauxI = Array{Taylor1{Interval{T}}}(undef, dof)

# Direction of the integration
sign_tstep = copysign(1, tmax-t0)

Expand All @@ -177,18 +171,6 @@ function _validated_integ!(f!, t0::T, tmax::T, x, dx, xI, dxI,
orderT, red_abstol, params,
adaptive, minabstol, absorb, check_property)
δtI = sign_tstep * Interval(zt, sign_tstep*δt)
# # parse_eqs == false
# (_success, δt, red_abstol) = validated_step!(f!, t, x, dx, xaux, tI, xI, dxI, xauxI,
# t0, tmax, sign_tstep, xTMN, rem, zB, S,
# orderT, red_abstol, params,
# adaptive, minabstol, absorb, check_property)
# δtI = sign_tstep * Interval(zt, sign_tstep*δt)
# # parse_eqs == true
# (_success, δt, red_abstol) = validated_step!(f!, t, x, dx, rv, tI, xI, dxI, rvI,
# t0, tmax, sign_tstep, xTMN, rem, zB, S,
# orderT, red_abstol, params,
# adaptive, minabstol, absorb, check_property)
# δtI = sign_tstep * Interval(zt, sign_tstep*δt)

# New initial conditions and time, and output vectors
nsteps += 1
Expand Down

0 comments on commit 2277969

Please sign in to comment.