spire.math

Interval

case class Interval[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
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Interval
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Interval(lower: Lower[T], upper: Upper[T])(implicit order: Order[T])

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: T)(implicit ev: Ring[T]): Interval[T]

  5. def *(rhs: Interval[T])(implicit ev: Ring[T]): Interval[T]

  6. def +(rhs: T)(implicit ev: Ring[T]): Interval[T]

  7. def +(rhs: Interval[T])(implicit ev: Ring[T]): Interval[T]

  8. def -(rhs: T)(implicit ev: Ring[T]): Interval[T]

  9. def -(rhs: Interval[T])(implicit ev: Ring[T]): Interval[T]

  10. def /(rhs: T)(implicit ev: Field[T]): Interval[T]

  11. def /(rhs: Interval[T])(implicit ev: Field[T]): Interval[T]

  12. def /:(lhs: T)(implicit ev: Field[T]): Interval[T]

  13. def /~(rhs: T)(implicit ev: EuclideanRing[T]): Interval[T]

  14. def /~(rhs: Interval[T])(implicit ev: EuclideanRing[T]): Interval[T]

  15. def /~:(lhs: T)(implicit ev: EuclideanRing[T]): Interval[T]

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

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

    Definition Classes
    Any
  18. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  19. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  20. def contains(t: T): Boolean

  21. def crosses(t: T): Boolean

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

    Definition Classes
    AnyRef
  23. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  24. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  25. def isAbove(t: T): Boolean

  26. def isAt(t: T): Boolean

  27. def isAtOrAbove(t: T): Boolean

  28. def isAtOrBelow(t: T): Boolean

  29. def isBelow(t: T): Boolean

  30. def isEmpty: Boolean

  31. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  32. val lower: Lower[T]

  33. def mapAroundZero[A](f: (Interval[T]) ⇒ A)(implicit ev: Ring[T]): (A, A)

  34. def mask(rhs: Interval[T]): Interval[T]

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

    Definition Classes
    AnyRef
  36. final def notify(): Unit

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

    Definition Classes
    AnyRef
  38. def pow(rhs: Int)(implicit ev: Ring[T]): Interval[T]

  39. def split(t: T): (Interval[T], Interval[T])

  40. def splitAtZero(implicit ev: Ring[T]): (Interval[T], Interval[T])

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

    Definition Classes
    AnyRef
  42. def toString(): String

    Definition Classes
    Interval → AnyRef → Any
  43. def unary_-(implicit ev: Ring[T]): Interval[T]

  44. val upper: Upper[T]

  45. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped