sealed abstract
class
Interval[A] extends AnyRef
Instance Constructors
-
new
Interval()(implicit order: Order[A])
Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
-
def
*(rhs: A)(implicit ev: Semiring[A]): Interval[A]
-
-
-
-
-
-
-
-
final
def
==(arg0: Any): Boolean
-
-
final
def
asInstanceOf[T0]: T0
-
def
bottom(min: A, epsilon: A)(implicit r: AdditiveGroup[A]): Option[A]
-
def
clone(): AnyRef
-
def
combine(rhs: Interval[A])(f: (A, A) ⇒ A): Interval[A]
-
def
contains(t: A): Boolean
-
def
crosses(t: A): Boolean
-
def
crossesZero(implicit ev: AdditiveMonoid[A]): Boolean
-
def
dist(min: A, max: A, epsilon: A)(implicit u: Uniform[A], r: AdditiveGroup[A]): Dist[A]
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
def
fold[B](f: (Bound[A], Bound[A]) ⇒ B): B
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
-
def
intersects(rhs: Interval[A])(implicit r: AdditiveMonoid[A]): Boolean
-
def
isAbove(t: A): Boolean
-
def
isAt(t: A): Boolean
-
def
isAtOrAbove(t: A): Boolean
-
def
isAtOrBelow(t: A): Boolean
-
def
isBelow(t: A): Boolean
-
def
isEmpty: Boolean
-
final
def
isInstanceOf[T0]: Boolean
-
def
isPoint: Boolean
-
def
isProperSubsetOf(rhs: Interval[A]): Boolean
-
def
isProperSupersetOf(rhs: Interval[A]): Boolean
-
def
isSubsetOf(rhs: Interval[A]): Boolean
-
def
isSupersetOf(rhs: Interval[A]): Boolean
-
def
lowerBound: Bound[A]
-
def
mapAroundZero[B](f: (Interval[A]) ⇒ B)(implicit ev: AdditiveMonoid[A]): (B, B)
-
def
mapBounds[B](f: (A) ⇒ B)(implicit arg0: Order[B], arg1: AdditiveMonoid[B]): Interval[B]
-
-
-
final
def
ne(arg0: AnyRef): Boolean
-
def
nonEmpty: Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
nroot(k: Int)(implicit r: Ring[A], n: NRoot[A]): Interval[A]
-
def
pow(k: Int)(implicit r: Ring[A]): Interval[A]
-
def
reciprocal(implicit ev: Field[A]): Interval[A]
-
-
-
def
sqrt(implicit r: Ring[A], n: NRoot[A]): Interval[A]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
def
top(epsilon: A)(implicit r: AdditiveGroup[A]): Option[A]
-
-
-
-
-
def
upperBound: Bound[A]
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
-
Inherited from AnyRef
Inherited from 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.