Constructor on @infsupdec: [X, ISEXACT] = infsupdec ()
Constructor on @infsupdec: [X, ISEXACT] = infsupdec (M)
Constructor on @infsupdec: [X, ISEXACT] = infsupdec (M, D)
Constructor on @infsupdec: [X, ISEXACT] = infsupdec (S)
Constructor on @infsupdec: [X, ISEXACT] = infsupdec (L, U)
Constructor on @infsupdec: [X, ISEXACT] = infsupdec (L, U, D)
Constructor on @infsupdec: [X, ISEXACT] = infsupdec (I, D)

Create a decorated interval from boundaries. Convert boundaries to double precision.

The syntax without parameters creates an (exact) empty interval. The syntax with a single parameter infsupdec (M) equals infsupdec (M, M). The syntax infsupdec (M, D) equals infsupdec (M, M, D). The syntax infsupdec (S) parses a possibly decorated interval literal in inf-sup form or as a special value, where infsupdec ("[S1, S2]") is equivalent to infsupdec ("S1", "S2") and, if [S1, S2]_D is a valid interval literal, infsupdec ("[S1, S2]_D") is equivalent to infsupdec ("S1", "S2", "D"). The syntax infsupdec (I, D) overrides an interval I’s decoration with a new decoration D. A second, logical output ISEXACT indicates if X’s boundaries both have been converted without precision loss and without changes to the optional, desired decoration.

If construction fails, the special value NaI, “not an interval,” will be returned and a warning message will be raised. NaI is equivalent to [Empty] together with an ill-formed decoration.

Each boundary can be provided in the following formats: literal constants [+-]inf[inity], e, pi; scalar real numeric data types, i. e., double, single, [u]int[8,16,32,64]; or decimal numbers as strings of the form [+-]d[,.]d[[eE][+-]d]; or hexadecimal numbers as string of the form [+-]0xh[,.]h[[pP][+-]d]; or decimal numbers in rational form [+-]d/d.

Also it is possible, to construct intervals from the uncertain form in the form m?ruE, where m is a decimal mantissa, r is empty (= half ULP) or a decimal integer ULP count or a second ? character for unbounded intervals, u is empty or a direction character (u: up, d: down), and E is an exponential field.

If decimal or hexadecimal numbers are no binary64 floating point numbers, a tight enclosure will be computed. int64 and uint64 numbers of high magnitude (> 2^53) can also be affected from precision loss.

The decoration D must be any of com, dac, def, trv, or ill. Illegal decorations within interval literals will produce NaIs, whereas illegal decorations provided as an additional function parameter will be automatically adjusted.

For the creation of interval arrays, arguments may be provided as (1) cell arrays with arbitrary/mixed types, (2) numeric arrays, or for matrices (3) strings. Scalar values do broadcast.

Non-standard behavior: This class constructor is not described by IEEE Std 1788-2015, however it implements the standard functions setDec, numsToInterval, and textToInterval.

v = infsupdec ()
  ⇒ v = [Empty]_trv
w = infsupdec (1)
  ⇒ w = [1]_com
x = infsupdec (2, 3)
  ⇒ x = [2, 3]_com
y = infsupdec ("0.1")
  ⇒ y ⊂ [0.099999, 0.10001]_com
z = infsupdec ("0.1", "0.2")
  ⇒ z ⊂ [0.099999, 0.20001]_com

See also: exacttointerval, hull, midrad, @infsup/newdec.

Package: interval