Skip to content

Commit 3fd55b7

Browse files
authored
Merge branch 'master' into release-1.0
2 parents d05d451 + 9f76820 commit 3fd55b7

File tree

6 files changed

+13
-7
lines changed

6 files changed

+13
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "IntervalArithmetic"
22
uuid = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
33
repo = "https://github.com/JuliaIntervals/IntervalArithmetic.jl.git"
4-
version = "0.22.23"
4+
version = "0.22.25"
55

66
[deps]
77
CRlibm = "96374032-68de-5a5b-8d9e-752f78720389"

docs/src/manual/construction.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,12 @@ interval(1) # considered "guaranteed" as the user explicitly constructed the int
145145

146146
In contrast, a [`BareInterval`](@ref) can only be constructed via [`bareinterval`](@ref), it is not a subtype of `Real`, and there are no allowed conversion with `Number`. Thus, this interval type is always guaranteed.
147147

148-
149148
!!! danger
150-
A user interested in validated numerics should **always** have a resulting interval for which [`isguaranteed`](@ref) is `true`.
149+
A user interested in validated numerics should **always** track down the source of an "NG" label.
151150

152151

153152

154-
## More constructors
153+
### More constructors
155154

156155
The submodule `IntervalArithmetic.Symbols` exports the infix operator `..` and `±` as an alias for `interval`; this submodule must be explicitly imported.
157156

docs/src/manual/usage.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@ One can refer to the following:
123123
- `setdiff`: cannot be used with intervals. See instead [`interiordiff`](@ref).
124124

125125

126+
126127
## Piecewise functions
127128

128-
Since intervals don't play well with `if .. else .. end` statement,
129+
Since intervals don't play well with `if ... else ... end` statement,
129130
we provide a utility to define function by pieces:
130131

131132
```@repl usage
@@ -141,6 +142,7 @@ The resulting function work with both standard numbers and intervals,
141142
and deal properly with the decorations of intervals.
142143

143144

145+
144146
## Custom interval bounds type
145147

146148
A `BareInterval{T}` or `Interval{T}` have the restriction `T <: Union{Rational,AbstractFloat}` which is the parametric type for the bounds of the interval. Supposing one wishes to use their own numeric type `MyNumType <: Union{Rational,AbstractFloat}`, they must provide their own arithmetic operations (with correct rounding!).

src/intervals/construction.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ of the form ``m \\pm r``.
482482
function _interval_midpoint(::Type{T}, m, r, d::Decoration = com) where {T<:BoundTypes}
483483
x = _interval_infsup(T, m, m, d)
484484
r = _interval_infsup(T, r, r, d)
485-
return _interval_infsup(T, x - r, x + r, d)
485+
precedes(zero(r), r) && return _interval_infsup(T, x - r, x + r, d)
486+
return throw(DomainError(r, "must be positive"))
486487
end
487488

488489
_interval_midpoint(::Type{T}, m::Complex, r, d::Decoration = com) where {T<:BoundTypes} =

src/intervals/exact_literals.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ ExactReal(x::ExactReal) = x
5858

5959
_value(x::ExactReal) = x.value # hook for interval constructor
6060

61+
isguaranteed(::ExactReal) = true
62+
6163
# utilities
6264

6365
Base.to_index(i::ExactReal{<:Integer}) = i.value # allow to index with ExactReal

src/matmul.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function Base.inv(A::Matrix{<:RealOrComplexI})
77
F = A * approx_A⁻¹ - interval(LinearAlgebra.I)
88
Y = LinearAlgebra.opnorm(approx_A⁻¹ * F, Inf)
99
Z₁ = LinearAlgebra.opnorm(F, Inf)
10-
if isbounded(Y) & strictprecedes(Z₁, one(one(Z₁)))
10+
if isbounded(Y) & strictprecedes(Z₁, one(Z₁))
1111
A⁻¹ = interval.(approx_A⁻¹, inf(interval(mag(Y)) / (one(Z₁) - interval(mag(Z₁)))); format = :midpoint)
1212
else
1313
A⁻¹ = fill(nai(eltype(approx_A⁻¹)), size(A))
@@ -383,6 +383,7 @@ _2mat(A) = A
383383
function _call_gem_openblas_upward!(C, A_::AbstractMatrix{Float64}, B_::AbstractMatrix{Float64})
384384
A = _2mat(A_)
385385
B = _2mat(B_)
386+
386387
m, k = size(A)
387388
n = size(B, 2)
388389

@@ -414,6 +415,7 @@ end
414415
function _call_gem_openblas_upward!(C, A_::AbstractMatrix{Float64}, B_::AbstractVector{Float64})
415416
A = _2mat(A_)
416417
B = _2mat(B_)
418+
417419
m, k = size(A)
418420

419421
α = 1.0

0 commit comments

Comments
 (0)