@@ -324,18 +324,31 @@ end
324
324
325
325
function representation (X:: IntervalBox{N, T} , format= nothing ) where {N, T}
326
326
327
- isempty (X) && return string (" ∅" , superscriptify (N))
328
-
329
327
if format == nothing
330
328
format = display_params. format # default
331
329
end
332
330
333
- if all (== (first (X)), X)
334
- return string (representation (first (X), format), superscriptify (N))
331
+ n = format == :full ? N : superscriptify (N)
332
+
333
+ if isempty (X)
334
+ format == :full && return string (" IntervalBox(∅, " , n, " )" )
335
+ return string (" ∅" , n)
336
+ end
337
+
338
+ x = first (X)
339
+ if all (== (x), X)
340
+ if format == :full
341
+ return string (" IntervalBox(" , representation (x, format), " , " , n, " )" )
342
+ elseif format == :midpoint
343
+ return string (" (" , representation (x, format), " )" , n)
344
+ else
345
+ return string (representation (x, format), n)
346
+ end
335
347
end
336
348
337
349
if format == :full
338
- return string (" IntervalBox(" , join (X. v, " , " ), " )" )
350
+ full_str = representation .(X. v, :full )
351
+ return string (" IntervalBox(" , join (full_str, " , " ), " )" )
339
352
elseif format == :midpoint
340
353
return string (" (" , join (X. v, " ) × (" ), " )" )
341
354
else
0 commit comments