From 747a2cf0007ca2ddca570e478582d70919bc6236 Mon Sep 17 00:00:00 2001 From: OlivierHnt <38465572+OlivierHnt@users.noreply.github.com> Date: Sun, 1 Oct 2023 21:47:15 +0200 Subject: [PATCH] Minor cleanup --- src/IntervalArithmetic.jl | 58 +++++++++++++++++++-------------------- src/intervals/rounding.jl | 10 +++---- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/IntervalArithmetic.jl b/src/IntervalArithmetic.jl index f30f1a9aa..4e81822fa 100644 --- a/src/IntervalArithmetic.jl +++ b/src/IntervalArithmetic.jl @@ -15,7 +15,6 @@ import Base: rad2deg, deg2rad, sin, cos, tan, cot, csc, sec, asin, acos, atan, acot, sinpi, cospi, sincospi, sinh, cosh, tanh, coth, csch, sech, asinh, acosh, atanh, acoth, - convert, float, big, floor, ceil, trunc, sign, round, copysign, flipsign, signbit, expm1, log1p, @@ -27,50 +26,51 @@ import Base: import Base.MPFR: MPFRRoundingMode import Base.MPFR: MPFRRoundUp, MPFRRoundDown, MPFRRoundNearest, MPFRRoundToZero, MPFRRoundFromZero -export - Interval, interval, ±, @I_str, - diam, radius, mid, midradius, scaled_mid, mag, mig, hull, - emptyinterval, isemptyinterval, - ismember, intersectinterval, isweakinterior, isstrictinterior, - isdisjointinterval, setdiffinterval, - weakprecedes, strictprecedes, contains_zero, isthinzero, isweakless, isstrictless, - overlap, Overlap, - isequalinterval, - entireinterval, isentireinterval, nai, isnai, isthin, iscommon, isatomic, - inf, sup, bounds, bisect, mince, - dist, - RoundTiesToEven, RoundTiesToAway, - IntervalRounding, - cancelminus, cancelplus, isbounded, isunbounded, - pow, extended_div, nthroot, - setformat - -## Decorations -export - decoration, DecoratedInterval, - com, dac, def, trv, ill - - - function __init__() setrounding(BigFloat, RoundNearest) end -function Base.setrounding(f::Function, ::Type{Rational{T}}, - rounding_mode::RoundingMode) where T +function Base.setrounding(f::Function, ::Type{Rational{T}}, rounding_mode::RoundingMode) where {T<:Integer} return setrounding(f, float(Rational{T}), rounding_mode) end -## Includes +# include("intervals/intervals.jl") +export Interval, interval, ±, @I_str, + diam, radius, mid, midradius, scaled_mid, mag, mig, hull, + emptyinterval, isemptyinterval, + isequalinterval, + ismember, + isweakinterior, isstrictinterior, + weakprecedes, strictprecedes, + isweakless, isstrictless, + contains_zero, + isthinzero, isthin, + isbounded, isunbounded, + isdisjointinterval, intersectinterval, setdiffinterval, + entireinterval, isentireinterval, nai, isnai, iscommon, isatomic, + inf, sup, bounds, mince, + dist, + RoundTiesToEven, RoundTiesToAway, + IntervalRounding, + cancelminus, cancelplus, + pow, extended_div, nthroot, + overlap, Overlap include("bisect.jl") +export bisect + include("decorations/decorations.jl") +export decoration, DecoratedInterval, com, dac, def, trv, ill include("rand.jl") + include("parsing.jl") + include("display.jl") +export setformat + include("symbols.jl") end diff --git a/src/intervals/rounding.jl b/src/intervals/rounding.jl index a34f3a2eb..234d2d183 100644 --- a/src/intervals/rounding.jl +++ b/src/intervals/rounding.jl @@ -51,10 +51,10 @@ const rounding_types = (:fast, :tight, :accurate, :slow, :none) interval_rounding() = IntervalRounding{:tight}() # BigFloat conversion -convert(::Type{BigFloat}, x, rounding_mode::RoundingMode) = - setrounding(BigFloat, rounding_mode) do - convert(BigFloat, x) - end +# convert(::Type{BigFloat}, x, rounding_mode::RoundingMode) = +# setrounding(BigFloat, rounding_mode) do +# convert(BigFloat, x) +# end # Parsing from string parse(::Type{T}, x::AbstractString, rounding_mode::RoundingMode) where T = setrounding(Float64, rounding_mode) do @@ -230,4 +230,4 @@ for f in (:+, :-, :*, :/, :^, :atan) @eval function $f(::IntervalRounding{:none}, a, b, r::RoundingMode) return $f(a, b) end -end \ No newline at end of file +end