Method on @infsup: [STATE, BITMASK] = overlap(A, B)

Extensively compare the positions of intervals A and B on the real number line.

Return the STATE as a string and the BITMASK of the state as an uint16 number, which represents one of the 16 possible states by taking a value 2^i (i = 0 … 15).

Evaluated on interval arrays, this functions is applied element-wise.

bothEmpty, 2^0

Both intervals are empty

firstEmpty, 2^1

Interval A is empty and B is not

secondEmpty, 2^2

Interval A is not empty, but B is

before, 2^3

[- - - A - - -]   [- - - B - - -]

meets, 2^4

[- - - A - - -][- - - B - - -]
Interval A’s upper boundary equals interval B’s lower boundary and neither consists of a single point only.

overlaps, 2^5

[- - - A - - - [= = =] - - - B - - -]

starts, 2^6

[[= = = A = = =] - - - B - - -]

containedBy, 2^7

[- - - B - - - [= = = A = = =] - - -]

finishes, 2^8

[- - - B - - - [= = = A = = =]]

equals, 2^9

Both intervals are equal (and not empty)

finishedBy, 2^10

[- - - A - - - [= = = B = = =]]

contains, 2^11

[- - - A - - - [= = = B = = =] - - -]

startedBy, 2^12

[[= = = B = = =] - - - A - - -]

overlappedBy, 2^13

[- - - B - - - [= = =] - - - A - - -]

metBy, 2^14

[- - - B - - -][- - - A - - -]
Interval A’s lower boundary equals interval B’s upper boundary and neither consists of a single point only.

after, 2^15

[- - - B - - -]   [- - - A - - -]

See also: @infsup/eq, @infsup/subset, @infsup/interior, @infsup/disjoint.

Package: interval