scalaz

BKTree

sealed abstract class BKTree[A] extends Product with Serializable

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
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. BKTree
  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 BKTree()

Abstract Value Members

  1. abstract def canEqual(that: Any): Boolean

    Definition Classes
    Equals
  2. abstract def productArity: Int

    Definition Classes
    Product
  3. abstract def productElement(n: Int): Any

    Definition Classes
    Product

Concrete Value Members

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

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. def +(a: A)(implicit A: MetricSpace[A]): BKTree[A]

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

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

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

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

    An alias for contains

  8. final def ==(arg0: Any): Boolean

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

    An alias for containsApproximate

  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. 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()
  13. 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

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

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

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

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

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

    Definition Classes
    AnyRef → Any
  19. def isEmpty: Boolean

  20. final def isInstanceOf[T0]: Boolean

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

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

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

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

    Definition Classes
    AnyRef
  25. def productIterator: Iterator[Any]

    Definition Classes
    Product
  26. def productPrefix: String

    Definition Classes
    Product
  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 Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped