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
- Alphabetic
- By Inheritance
- BKTree
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(a: A)(implicit A: MetricSpace[A]): BKTree[A]
- def ++(t: BKTree[A])(implicit m: MetricSpace[A]): BKTree[A]
- def -(a: A)(implicit A: MetricSpace[A]): BKTree[A]
- def --(t: BKTree[A])(implicit m: MetricSpace[A]): BKTree[A]
-
final
def
-?-(a: A)(implicit A: MetricSpace[A]): Boolean
An alias for
contains
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
=?=(a: A, n: Int)(implicit A: MetricSpace[A]): Boolean
An alias for
containsApproximate
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
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()
-
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 ton
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- def isEmpty: Boolean
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[B](f: (A) ⇒ B): BKTree[B]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
productIterator: Iterator[Any]
- Definition Classes
- Product
-
def
productPrefix: String
- Definition Classes
- Product
- def size: Int
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def values: List[A]
-
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 ton
. -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
|=|(a: A, n: Int)(implicit A: MetricSpace[A]): List[A]
An alias for
valuesApproximate