Skip to content

Commit 3dcec42

Browse files
committed
Correct and complete reference to the standard for boolean operations
1 parent 544c000 commit 3dcec42

File tree

1 file changed

+31
-12
lines changed

1 file changed

+31
-12
lines changed

src/intervals/interval_operations/boolean.jl

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# flavor in Section 10.5.9
44
# Some other (non required) related functions are also present, as well as some
55
# of the "Recommended operations" (Section 10.6.3)
6+
# The requirement for decorated intervals are described in Chapter 12,
7+
# mostly sections 12.12.9 and 12.13.3.
68

79
# used internally, equivalent to `<` but with `(Inf < Inf) == true`
810
_strictlessprime(x::Real, y::Real) = (x < y) | ((isinf(x) | isinf(y)) & (x == y))
@@ -12,7 +14,8 @@ _strictlessprime(x::Real, y::Real) = (x < y) | ((isinf(x) | isinf(y)) & (x == y)
1214
1315
Test whether `x` and `y` are identical.
1416
15-
Implement the `equal` function of the IEEE Standard 1788-2015 (Table 9.3).
17+
Implement the `equal` function of the IEEE Standard 1788-2015
18+
(Tables 9.3 and 10.3, and Sections 9.5, 10.5.10 and 12.12.9).
1619
"""
1720
isequal_interval(x::BareInterval, y::BareInterval) = (inf(x) == inf(y)) & (sup(x) == sup(y))
1821

@@ -49,7 +52,8 @@ const issetequal_interval = isequal_interval
4952
5053
Test whether `x` is contained in `y`.
5154
52-
Implement the `subset` function of the IEEE Standard 1788-2015 (Table 9.3).
55+
Implement the `subset` function of the IEEE Standard 1788-2015
56+
(Tables 9.3 and 10.3, and Sections 9.5, 10.5.10 and 12.12.9).
5357
5458
See also: [`isstrictsubset`](@ref) and [`isinterior`](@ref).
5559
"""
@@ -100,7 +104,8 @@ isstrictsubset(x) = Base.Fix2(isstrictsubset, x)
100104
101105
Test whether `x` is in the interior of `y`.
102106
103-
Implement the `interior` function of the IEEE Standard 1788-2015 (Table 9.3).
107+
Implement the `interior` function of the IEEE Standard 1788-2015
108+
(Tables 9.3 and 10.3, and Sections 9.5, 10.5.10 and 12.12.9).
104109
105110
See also: [`issubset_interval`](@ref) and [`isstrictsubset`](@ref).
106111
"""
@@ -129,7 +134,8 @@ isinterior(x, y, z, w...) = isinterior(x, y) & isinterior(y, z, w...)
129134
130135
Test whether the given intervals have no common elements.
131136
132-
Implement the `disjoint` function of the IEEE Standard 1788-2015 (Table 9.3).
137+
Implement the `disjoint` function of the IEEE Standard 1788-2015.
138+
(Tables 9.3 and 10.3, and Sections 9.5, 10.5.10 and 12.12.9).
133139
"""
134140
isdisjoint_interval(x::BareInterval, y::BareInterval) =
135141
isempty_interval(x) | isempty_interval(y) | _strictlessprime(sup(y), inf(x)) | _strictlessprime(sup(x), inf(y))
@@ -161,7 +167,8 @@ _isdisjoint_interval(x, y, z, w...) = _isdisjoint_interval(x, y) && _isdisjoint_
161167
Test whether `inf(x) ≤ inf(y)` and `sup(x) ≤ sup(y)`, where `<` is replaced by
162168
`≤` for infinite values.
163169
164-
Implement the `less` function of the IEEE Standard 1788-2015 (Table 10.3).
170+
Implement the `less` function of the IEEE Standard 1788-2015
171+
(Table 10.3, and Sections 10.5.10 and 12.12.9).
165172
"""
166173
isweakless(x::BareInterval, y::BareInterval) = (inf(x) inf(y)) & (sup(x) sup(y))
167174

@@ -176,7 +183,8 @@ end
176183
Test whether `inf(x) < inf(y)` and `sup(x) < sup(y)`, where `<` is replaced by
177184
`≤` for infinite values.
178185
179-
Implement the `strictLess` function of the IEEE Standard 1788-2015 (Table 10.3).
186+
Implement the `strictLess` function of the IEEE Standard 1788-2015
187+
(Table 10.3, and Sections 10.5.10 and 12.12.9).
180188
"""
181189
isstrictless(x::BareInterval, y::BareInterval) = # this may be flavor dependent? Should _strictlessprime be < for cset flavor?
182190
_strictlessprime(inf(x), inf(y)) & _strictlessprime(sup(x), sup(y))
@@ -191,7 +199,8 @@ end
191199
192200
Test whether any element of `x` is lesser or equal to every elements of `y`.
193201
194-
Implement the `precedes` function of the IEEE Standard 1788-2015 (Table 10.3).
202+
Implement the `precedes` function of the IEEE Standard 1788-2015
203+
(Table 10.3, and Sections 10.5.10 and 12.12.9).
195204
"""
196205
precedes(x::BareInterval, y::BareInterval) = sup(x) inf(y)
197206

@@ -205,7 +214,8 @@ end
205214
206215
Test whether any element of `x` is strictly lesser than every elements of `y`.
207216
208-
Implement the `strictPrecedes` function of the IEEE Standard 1788-2015 (Table 10.3).
217+
Implement the `strictPrecedes` function of the IEEE Standard 1788-2015
218+
(Table 10.3, and Sections 10.5.10 and 12.12.9).
209219
"""
210220
strictprecedes(x::BareInterval, y::BareInterval) = isempty_interval(x) | isempty_interval(y) | (sup(x) < inf(y))
211221

@@ -219,7 +229,8 @@ end
219229
220230
Test whether `x` is an element of `y`.
221231
222-
Implement the `isMember` function of the IEEE Standard 1788-2015 (Section 10.6.3).
232+
Implement the `isMember` function of the IEEE Standard 1788-2015
233+
(Sections 10.6.3 and 12.13.3).
223234
"""
224235
function in_interval(x::Number, y::BareInterval)
225236
isinf(x) && return contains_infinity(y)
@@ -246,7 +257,8 @@ in_interval(x) = Base.Fix2(in_interval, x)
246257
247258
Test whether `x` contains no elements.
248259
249-
Implement the `isEmpty` function of the IEEE Standard 1788-2015 (Section 10.6.3).
260+
Implement the `isEmpty` function of the IEEE Standard 1788-2015
261+
(Sections 10.5.10 and 12.12.9).
250262
"""
251263
isempty_interval(x::BareInterval{T}) where {T<:NumTypes} = (inf(x) == typemax(T)) & (sup(x) == typemin(T))
252264

@@ -263,7 +275,8 @@ isempty_interval(x::AbstractVector) = any(isempty_interval, x)
263275
264276
Test whether `x` is the entire real line.
265277
266-
Implement the `isEntire` function of the IEEE Standard 1788-2015 (Section 10.6.3).
278+
Implement the `isEntire` function of the IEEE Standard 1788-2015
279+
(Sections 10.5.10 and 12.12.9).
267280
"""
268281
isentire_interval(x::BareInterval{T}) where {T<:NumTypes} = (inf(x) == typemin(T)) & (sup(x) == typemax(T))
269282

@@ -277,6 +290,8 @@ isentire_interval(x::Complex{<:Interval}) = isentire_interval(real(x)) & isentir
277290
isnai(x)
278291
279292
Test whether `x` is an NaI (Not an Interval).
293+
294+
Implement the `isNaI` function of the IEEE Standard 1788-2015 (Section 12.12.9).
280295
"""
281296
isnai(::BareInterval) = false
282297

@@ -314,6 +329,9 @@ isunbounded(x::Complex{<:Interval}) = isunbounded(real(x)) | isunbounded(imag(x)
314329
315330
Test whether `x` is not empty and bounded.
316331
332+
Implement the `isCommonInterval` function of the IEEE Standard 1788-2015
333+
(Sections 10.6.3 and 12.13.3).
334+
317335
!!! note
318336
This is does not take into consideration the decoration of the interval.
319337
"""
@@ -346,7 +364,8 @@ isatomic(x::Complex{<:Interval}) = isatomic(real(x)) & isatomic(imag(x))
346364
347365
Test whether `x` contains only a real.
348366
349-
Implement the `isSingleton` function of the IEEE Standard 1788-2015 (Table 9.3).
367+
Implement the `isSingleton` function of the IEEE Standard 1788-2015
368+
(Sections 10.6.3 and 12.13.3).
350369
"""
351370
isthin(x::BareInterval) = inf(x) == sup(x)
352371

0 commit comments

Comments
 (0)