3
3
# flavor in Section 10.5.9
4
4
# Some other (non required) related functions are also present, as well as some
5
5
# 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.
6
8
7
9
# used internally, equivalent to `<` but with `(Inf < Inf) == true`
8
10
_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)
12
14
13
15
Test whether `x` and `y` are identical.
14
16
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).
16
19
"""
17
20
isequal_interval (x:: BareInterval , y:: BareInterval ) = (inf (x) == inf (y)) & (sup (x) == sup (y))
18
21
@@ -49,7 +52,8 @@ const issetequal_interval = isequal_interval
49
52
50
53
Test whether `x` is contained in `y`.
51
54
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).
53
57
54
58
See also: [`isstrictsubset`](@ref) and [`isinterior`](@ref).
55
59
"""
@@ -100,7 +104,8 @@ isstrictsubset(x) = Base.Fix2(isstrictsubset, x)
100
104
101
105
Test whether `x` is in the interior of `y`.
102
106
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).
104
109
105
110
See also: [`issubset_interval`](@ref) and [`isstrictsubset`](@ref).
106
111
"""
@@ -129,7 +134,8 @@ isinterior(x, y, z, w...) = isinterior(x, y) & isinterior(y, z, w...)
129
134
130
135
Test whether the given intervals have no common elements.
131
136
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).
133
139
"""
134
140
isdisjoint_interval (x:: BareInterval , y:: BareInterval ) =
135
141
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_
161
167
Test whether `inf(x) ≤ inf(y)` and `sup(x) ≤ sup(y)`, where `<` is replaced by
162
168
`≤` for infinite values.
163
169
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).
165
172
"""
166
173
isweakless (x:: BareInterval , y:: BareInterval ) = (inf (x) ≤ inf (y)) & (sup (x) ≤ sup (y))
167
174
176
183
Test whether `inf(x) < inf(y)` and `sup(x) < sup(y)`, where `<` is replaced by
177
184
`≤` for infinite values.
178
185
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).
180
188
"""
181
189
isstrictless (x:: BareInterval , y:: BareInterval ) = # this may be flavor dependent? Should _strictlessprime be < for cset flavor?
182
190
_strictlessprime (inf (x), inf (y)) & _strictlessprime (sup (x), sup (y))
191
199
192
200
Test whether any element of `x` is lesser or equal to every elements of `y`.
193
201
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).
195
204
"""
196
205
precedes (x:: BareInterval , y:: BareInterval ) = sup (x) ≤ inf (y)
197
206
205
214
206
215
Test whether any element of `x` is strictly lesser than every elements of `y`.
207
216
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).
209
219
"""
210
220
strictprecedes (x:: BareInterval , y:: BareInterval ) = isempty_interval (x) | isempty_interval (y) | (sup (x) < inf (y))
211
221
219
229
220
230
Test whether `x` is an element of `y`.
221
231
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).
223
234
"""
224
235
function in_interval (x:: Number , y:: BareInterval )
225
236
isinf (x) && return contains_infinity (y)
@@ -246,7 +257,8 @@ in_interval(x) = Base.Fix2(in_interval, x)
246
257
247
258
Test whether `x` contains no elements.
248
259
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).
250
262
"""
251
263
isempty_interval (x:: BareInterval{T} ) where {T<: NumTypes } = (inf (x) == typemax (T)) & (sup (x) == typemin (T))
252
264
@@ -263,7 +275,8 @@ isempty_interval(x::AbstractVector) = any(isempty_interval, x)
263
275
264
276
Test whether `x` is the entire real line.
265
277
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).
267
280
"""
268
281
isentire_interval (x:: BareInterval{T} ) where {T<: NumTypes } = (inf (x) == typemin (T)) & (sup (x) == typemax (T))
269
282
@@ -277,6 +290,8 @@ isentire_interval(x::Complex{<:Interval}) = isentire_interval(real(x)) & isentir
277
290
isnai(x)
278
291
279
292
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).
280
295
"""
281
296
isnai (:: BareInterval ) = false
282
297
@@ -314,6 +329,9 @@ isunbounded(x::Complex{<:Interval}) = isunbounded(real(x)) | isunbounded(imag(x)
314
329
315
330
Test whether `x` is not empty and bounded.
316
331
332
+ Implement the `isCommonInterval` function of the IEEE Standard 1788-2015
333
+ (Sections 10.6.3 and 12.13.3).
334
+
317
335
!!! note
318
336
This is does not take into consideration the decoration of the interval.
319
337
"""
@@ -346,7 +364,8 @@ isatomic(x::Complex{<:Interval}) = isatomic(real(x)) & isatomic(imag(x))
346
364
347
365
Test whether `x` contains only a real.
348
366
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).
350
369
"""
351
370
isthin (x:: BareInterval ) = inf (x) == sup (x)
352
371
0 commit comments