scalaz

BKTree

sealed trait BKTree[A] extends AnyRef

Burkhard-Keller trees provide an implementation of sets which apart from the ordinary operations also has an approximate member search, allowing you to search for elements that are of a distance n from the element you are searching for. The distance is determined using a metric on the type of elements. Therefore all elements must implement the scalaz.MetricSpace type class, rather than the more usual scalaz.Ordering.

The worst case complexity of many of these operations is quite bad, but the expected behavior varies greatly with the metric. For example, the discrete metric (distance x y | y == x = 0 | otherwise = 1) makes BK-trees behave abysmally. The metrics mentioned above should give good performance characteristics.

This implementation is a port of Haskell's Data.Set.BKTree

Annotations
@deprecated
Deprecated

(Since version 7.0.1) This class depends on MetricSpace which is deprecated, too.

Source
BKTree.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. BKTree
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

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 +(a: A)(implicit A: MetricSpace[A]): BKTree[A]

  5. def ++(t: BKTree[A])(implicit m: MetricSpace[A]): BKTree[A]

  6. def -(a: A)(implicit A: MetricSpace[A]): BKTree[A]

  7. def --(t: BKTree[A])(implicit m: MetricSpace[A]): BKTree[A]

  8. final def -?-(a: A)(implicit A: MetricSpace[A]): Boolean

    An alias for contains

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

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

    Definition Classes
    Any
  11. def =?=(a: A, n: Int)(implicit A: MetricSpace[A]): Boolean

    An alias for containsApproximate

  12. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  13. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. final def contains(a: A)(implicit A: MetricSpace[A]): Boolean

    Returns true of this set contains a.

    Returns true of this set contains a.

    Annotations
    @tailrec()
  15. def containsApproximate(a: A, n: Int)(implicit A: MetricSpace[A]): Boolean

    Returns true if this set contains an element which has a distance from a that is less than or equal to n

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

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

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

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

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

    Definition Classes
    AnyRef → Any
  21. def isEmpty: Boolean

  22. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  23. def map[B](f: (A) ⇒ B): BKTree[B]

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

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

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

    Definition Classes
    AnyRef
  27. def size: Int

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

    Definition Classes
    AnyRef
  29. def toString(): String

    Definition Classes
    AnyRef → Any
  30. def values: List[A]

  31. def valuesApproximate(a: A, n: Int)(implicit A: MetricSpace[A]): List[A]

    Returns the elements which have an distance from a that is less than or equal to n.

  32. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. def |=|(a: A, n: Int)(implicit A: MetricSpace[A]): List[A]

    An alias for valuesApproximate

Inherited from AnyRef

Inherited from Any

Ungrouped