spire.math

Interval

sealed abstract class Interval[A] extends AnyRef

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.

Self Type
Interval[A]
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Interval
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Interval()(implicit order: Order[A])

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def &(rhs: Interval[A])(implicit r: AdditiveMonoid[A]): Interval[A]

  5. def *(rhs: A)(implicit ev: Semiring[A]): Interval[A]

  6. def *(rhs: Interval[A])(implicit ev: Semiring[A]): Interval[A]

  7. def +(rhs: A)(implicit ev: AdditiveSemigroup[A]): Interval[A]

  8. def +(rhs: Interval[A])(implicit ev: AdditiveSemigroup[A]): Interval[A]

  9. def -(rhs: A)(implicit ev: AdditiveGroup[A]): Interval[A]

  10. def -(rhs: Interval[A])(implicit ev: AdditiveGroup[A]): Interval[A]

  11. def --(rhs: Interval[A])(implicit r: AdditiveMonoid[A]): List[Interval[A]]

  12. def /(rhs: Interval[A])(implicit ev: Field[A]): Interval[A]

  13. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  15. def abs(implicit m: AdditiveGroup[A]): Interval[A]

  16. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  17. def bottom(min: A, epsilon: A)(implicit r: AdditiveGroup[A]): Option[A]

  18. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. def combine(rhs: Interval[A])(f: (A, A) ⇒ A): Interval[A]

  20. def contains(t: A): Boolean

  21. def crosses(t: A): Boolean

  22. def crossesZero(implicit ev: AdditiveMonoid[A]): Boolean

  23. def dist(min: A, max: A, epsilon: A)(implicit u: Uniform[A], r: AdditiveGroup[A]): Dist[A]

  24. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  26. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  27. def fold[B](f: (Bound[A], Bound[A]) ⇒ B): B

  28. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  29. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  30. def intersect(rhs: Interval[A])(implicit r: AdditiveMonoid[A]): Interval[A]

  31. def intersects(rhs: Interval[A])(implicit r: AdditiveMonoid[A]): Boolean

  32. def isAbove(t: A): Boolean

  33. def isAt(t: A): Boolean

  34. def isAtOrAbove(t: A): Boolean

  35. def isAtOrBelow(t: A): Boolean

  36. def isBelow(t: A): Boolean

  37. def isEmpty: Boolean

  38. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  39. def isPoint: Boolean

  40. def isProperSubsetOf(rhs: Interval[A]): Boolean

  41. def isProperSupersetOf(rhs: Interval[A]): Boolean

  42. def isSubsetOf(rhs: Interval[A]): Boolean

  43. def isSupersetOf(rhs: Interval[A]): Boolean

  44. def lowerBound: Bound[A]

  45. def mapAroundZero[B](f: (Interval[A]) ⇒ B)(implicit ev: AdditiveMonoid[A]): (B, B)

  46. def mapBounds[B](f: (A) ⇒ B)(implicit arg0: Order[B], arg1: AdditiveMonoid[B]): Interval[B]

  47. def max(rhs: Interval[A])(implicit m: AdditiveMonoid[A]): Interval[A]

  48. def min(rhs: Interval[A])(implicit m: AdditiveMonoid[A]): Interval[A]

  49. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  50. def nonEmpty: Boolean

  51. final def notify(): Unit

    Definition Classes
    AnyRef
  52. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  53. def nroot(k: Int)(implicit r: Ring[A], n: NRoot[A]): Interval[A]

  54. def pow(k: Int)(implicit r: Ring[A]): Interval[A]

  55. def reciprocal(implicit ev: Field[A]): Interval[A]

  56. def split(t: A)(implicit r: AdditiveMonoid[A]): (Interval[A], Interval[A])

  57. def splitAtZero(implicit ev: AdditiveMonoid[A]): (Interval[A], Interval[A])

  58. def sqrt(implicit r: Ring[A], n: NRoot[A]): Interval[A]

  59. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  60. def toString(): String

    Definition Classes
    Interval → AnyRef → Any
  61. def top(epsilon: A)(implicit r: AdditiveGroup[A]): Option[A]

  62. def translate(p: Polynomial[A])(implicit ev: Field[A]): Interval[A]

  63. def unary_-()(implicit ev: AdditiveGroup[A]): Interval[A]

  64. def unary_~(implicit r: AdditiveMonoid[A]): List[Interval[A]]

  65. def union(rhs: Interval[A])(implicit r: AdditiveMonoid[A]): Interval[A]

  66. def upperBound: Bound[A]

  67. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  68. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  69. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  70. def |(rhs: Interval[A])(implicit r: AdditiveMonoid[A]): Interval[A]

Inherited from AnyRef

Inherited from Any

Ungrouped