DistanceMeasure

trait DistanceMeasure[M, P, H]

A DistanceMeasure is used in nearest neighbour search, in order to allow different ways points and children are favoured or filtered during the search.

For simplicity and performance, the measures, although they could be generalized as Ordered, are given as Long values. Only comparisons are performed with the results, therefore some optimizations may be made, for example the euclidean measure omits taking the square root of the distances, while still preserving the ordering between the possible results.

Companion
object
class Object
trait Matchable
class Any
trait Ops[M, P, H]
trait Impl[M]
trait LongImpl
trait SqrImpl

Value members

Abstract methods

def compareMeasure(a: M, b: M): Int
def distance(a: P, b: P): M

Calculates the distance between two points.

Calculates the distance between two points.

Value Params
a

the input query point

b

a point in the octree

def isMeasureGreater(a: M, b: M): Boolean
def isMeasureZero(m: M): Boolean
def maxDistance(a: P, b: H): M

Calculates the maximum distance between a point and any possible point of a given hyper-cube. In the euclidean case, this is the distance to the hyper-cube b's corner that is furthest to the point a, no matter whether a is contained in b or not.

Calculates the maximum distance between a point and any possible point of a given hyper-cube. In the euclidean case, this is the distance to the hyper-cube b's corner that is furthest to the point a, no matter whether a is contained in b or not.

def maxValue: M

A value which will never be exceeded by the measure.

A value which will never be exceeded by the measure.

def minDistance(a: P, b: H): M

Calculates the minimum distance between a point and any possible point of a given hyper-cube. In the euclidean case, this is the distance to the hyper-cube b's corner that is closest to the point a, if a lies outside of b, or zero, if a lies within b.

Calculates the minimum distance between a point and any possible point of a given hyper-cube. In the euclidean case, this is the distance to the hyper-cube b's corner that is closest to the point a, if a lies outside of b, or zero, if a lies within b.

def newArray(size: Int): Array[M]