sealed abstract
class
Interval[A] extends AnyRef
Instance Constructors
-
new
Interval()(implicit order: Order[A])
Abstract Value Members
-
abstract
def
lowerBound: Bound[A]
-
abstract
def
upperBound: Bound[A]
Concrete Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
-
def
*(rhs: A)(implicit ev: Semiring[A]): Interval[A]
-
-
-
-
-
-
-
def
/(rhs: A)(implicit ev: Field[A]): Interval[A]
-
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
-
-
final
def
asInstanceOf[T0]: T0
-
def
bottom(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]
-
def
doesNotContain(t: A): Boolean
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
def
fold[B](f: (Bound[A], Bound[A]) ⇒ B): B
-
def
foldOver[B](init: B, step: A)(f: (B, A) ⇒ B)(implicit ev: AdditiveMonoid[A], nt: NumberTag[A]): B
-
final
def
getClass(): Class[_]
-
def
hasAbove(t: A): Boolean
-
def
hasAtOrAbove(t: A): Boolean
-
def
hasAtOrBelow(t: A): Boolean
-
def
hasBelow(t: A): Boolean
-
def
hashCode(): Int
-
-
def
intersects(rhs: Interval[A]): Boolean
-
def
isAt(t: A): Boolean
-
def
isBounded: Boolean
-
final
def
isClosed(flags: Int): Boolean
-
final
def
isClosedLower(flags: Int): Boolean
-
final
def
isClosedUpper(flags: Int): Boolean
-
def
isEmpty: Boolean
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
isOpen(flags: Int): Boolean
-
final
def
isOpenLower(flags: Int): Boolean
-
final
def
isOpenUpper(flags: Int): 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
iterator(step: A)(implicit ev: AdditiveMonoid[A], nt: NumberTag[A]): Iterator[A]
-
def
loop(step: A)(f: (A) ⇒ Unit)(implicit ev: AdditiveMonoid[A], nt: NumberTag[A]): Unit
-
final
def
lowerFlag(flags: Int): Int
-
final
def
lowerFlagToUpper(flags: Int): Int
-
def
lowerPairBelow(lower1: A, flags1: Int, lower2: A, flags2: Int): Boolean
-
def
mapAroundZero[B](f: (Interval[A]) ⇒ B)(implicit ev: AdditiveMonoid[A]): (B, B)
-
def
mapBounds[B](f: (A) ⇒ B)(implicit arg0: Order[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]
-
final
def
reverseFlags(flags: Int): Int
-
final
def
reverseLowerFlag(flags: Int): Int
-
final
def
reverseUpperFlag(flags: Int): Int
-
-
-
def
sqrt(implicit r: Ring[A], n: NRoot[A]): Interval[A]
-
final
def
swapFlags(flags: Int): Int
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
def
top(epsilon: A)(implicit r: AdditiveGroup[A]): Option[A]
-
-
-
def
unary_~(): List[Interval[A]]
-
-
final
def
upperFlag(flags: Int): Int
-
final
def
upperFlagToLower(flags: Int): Int
-
def
upperPairAbove(upper1: A, flags1: Int, upper2: A, flags2: Int): Boolean
-
-
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
-
-
def
∈:(a: A): Boolean
-
def
∉:(a: A): Boolean
-
def
∋(rhs: A): Boolean
-
def
∌(rhs: A): Boolean
-
-
-
def
⊂(rhs: Interval[A]): Boolean
-
def
⊃(rhs: Interval[A]): Boolean
-
def
⊆(rhs: Interval[A]): Boolean
-
def
⊇(rhs: Interval[A]): Boolean
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 four 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. * Empty: The interval itself is empty.
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.