case classInterval[T](lower: Lower[T], upper: Upper[T])(implicit order: Order[T]) extends Product with Serializable
Interval represents a set of values, usually numbers.
Intervals have upper and lower bounds. Each bound can be one of
three kinds:
* Closed: The boundary value is included in the interval.
* Open: The boundary value is excluded from the interval.
* Unbound: There is no boundary value.
When the underlying type of the interval supports it, intervals may
be used in arithmetic. There are several possible interpretations
of interval arithmetic: the interval can represent uncertainty
about a single value (for instance, a quantity +/- tolerance in
engineering) or it can represent all values in the interval
simultaneously. In this implementation we have chosen to use the
probabillistic interpretation.
One common pitfall with interval arithmetic is that many familiar
algebraic relations do not hold. For instance, given two intervals
a and b:
a == b does not imply a * a == a * b
Consider a = b = [-1, 1]. Since any number times itself is
non-negative, a * a = [0, 1]. However, a * b = [-1, 1], since we
may actually have a=1 and b=-1.
These situations will result in loss of precision (in the form of
wider intervals). The result is not wrong per se, but less
acccurate than it could be.
Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Interval represents a set of values, usually numbers.
Intervals have upper and lower bounds. Each bound can be one of three kinds:
* Closed: The boundary value is included in the interval. * Open: The boundary value is excluded from the interval. * Unbound: There is no boundary value.
When the underlying type of the interval supports it, intervals may be used in arithmetic. There are several possible interpretations of interval arithmetic: the interval can represent uncertainty about a single value (for instance, a quantity +/- tolerance in engineering) or it can represent all values in the interval simultaneously. In this implementation we have chosen to use the probabillistic interpretation.
One common pitfall with interval arithmetic is that many familiar algebraic relations do not hold. For instance, given two intervals a and b:
a == b does not imply a * a == a * b
Consider a = b = [-1, 1]. Since any number times itself is non-negative, a * a = [0, 1]. However, a * b = [-1, 1], since we may actually have a=1 and b=-1.
These situations will result in loss of precision (in the form of wider intervals). The result is not wrong per se, but less acccurate than it could be.