An interval is a support that is a finite union of intervals.

Public fields

lower

A numeric vector of lower bounds.

upper

A numeric vector of upper bounds.

lower_closed

A logical vector indicating whether the lower bound is closed.

upper_closed

A logical vector indicating whether the upper bound is closed.

Methods


Method new()

Initialize an interval.

Usage

interval$new(
  lower = -Inf,
  upper = Inf,
  lower_closed = FALSE,
  upper_closed = FALSE
)

Arguments

lower

A numeric vector of lower bounds.

upper

A numeric vector of upper bounds.

lower_closed

A logical vector indicating whether the lower bound is closed.

upper_closed

A logical vector indicating whether the upper bound is closed.


Method is_empty()

Determine if the interval is empty

Usage

interval$is_empty()

Returns

A logical vector indicating whether the interval is empty.


Method has()

Determine if a value is contained in the interval.

Usage

interval$has(x)

Arguments

x

A numeric vector of values.

Returns

A logical vector indicating whether each value is contained


Method infimum()

Get the infimum of the interval.

Usage

interval$infimum()

Returns

A numeric vector of infimums.


Method supremum()

Get the supremum of the interval.

Usage

interval$supremum()

Returns

A numeric vector of supremums.


Method dim()

Get the dimension of the interval.

Usage

interval$dim()

Returns

The dimension of the interval.


Method clone()

The objects of this class are cloneable with this method.

Usage

interval$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.