OpenClosed [class]

The class splinekit.interval.OpenClosed is the concrete class that handles the bounded intervals that are left-open and right-closed.

This concrete class honors Interval and Bounded; it handles open-closed intervals between a pair of finite real numbers.


class splinekit.interval.open_closed.OpenClosed(bounds: Tuple[float, float])

Bases: Interval, Bounded

The bounded interval \(\{x\in{\mathbb{R}}|x_{0}<x\leq x_{1}\}=(x_{0},x_{1}].\)


property infimum: float

Left endpoint.


property supremum: float

Right endpoint.


property isleftopen: bool

True


property isrightopen: bool

False


property isopen: bool

False


property ishalfopen: bool

True


property isclosed: bool

False


property isleftbounded: bool

True


property isrightbounded: bool

True


property ishalfbounded: bool

False


property isbounded: bool

True


property isdegenerate: bool

False


property isproper: bool

True


property interior: Self

Open((self.infimum, self.supremum))


property closure: Self

Closed((self.infimum, self.supremum))


property diameter: float

self.supremum - self.infimum


property midpoint: float

0.5 * (self.supremum + self.infimum)


sortorder() float

self.midpoint


__contains__(x: float) bool

self.leftbound < x <= self.rightbound


static __new__(cls, bounds: Tuple[float, float]) Self

Creates the bounded open-closed interval \(\{x\in{\mathbb{R}}|x_{0}<x\leq x_{1}\}=(x_{0},x_{1}]\) that contains all numbers that are larger than \(x_{0}\) and not larger than \(x_{1}.\)

Parameters:

bounds – The tuple (infimum, supremum).

Returns:

An OpenClosed interval if bounds contains two finite numbers, with the first number being smaller than the second; otherwise, an interval from {RR, Empty, Above, NotAbove}.

Return type:

Interval