Closed [class]

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

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


class splinekit.interval.closed.Closed(bounds: Tuple[float, float])

Bases: Interval, Bounded

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


property infimum: float

Left endpoint.


property supremum: float

Right endpoint.


property isleftopen: bool

False


property isrightopen: bool

False


property isopen: bool

False


property ishalfopen: bool

False


property isclosed: bool

True


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 closed interval \(\{x\in{\mathbb{R}}|x_{0}\leq x\leq x_{1}\}=[x_{0},x_{1}]\) that contains all numbers that are not smaller than \(x_{0}\) and not larger than \(x_{1}.\)

Parameters:

bounds – The tuple (infimum, supremum).

Returns:

A Closed interval if bounds contains two finite numbers, with the first number being smaller than the second; otherwise, an interval from {RR, Empty, Singleton, NotBelow, NotAbove}.

Return type:

Interval