Composes this distance so that a threshold is applied to point-point distances.
Composes this distance so that a threshold is applied to
point-point distances. If the point-point distance of the
underlying measure returns a value less than or equal the given threshold,
then instead the value 0L
is returned. This allows for
quicker searches so that a nearest neighbour becomes an
approximate nn within the given threshold (the first
arbitrary point encountered with a distance smaller than
the threshold will be returned).
Note that the threshold is directly compared to the result
of distance
, thus if the underlying measure uses a skewed
distance, this must be taken into account. For example, if
euclideanSq
is used, and points within a radius of 4 should
be approximated, a threshold of 4 * 4 = 16
must be chosen!
Applies a filter to this measure by constraining distances
to objects b
which lie within the given IntSquare
.
Applies a filter to this measure by constraining distances
to objects b
which lie within the given IntSquare
. That
is, if for example distance( a, b )
is called, first it
is checked if b
is within hyperCube
. If so, the underlying
measure is calculated, otherwise, Long.MaxValue
is returned.
This behaviour extends to the minDistance
and maxDistance
methods.
Calculates the distance between two points.
Calculates the distance between two points.
the input query point
a point in the octree
Calculates the maximum distance between a point and any possible point of a given hyper-cube.
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.
A value which will never be exceeded by the measure.
A value which will never be exceeded by the measure.
Calculates the minimum distance between a point and any possible point of a given hyper-cube.
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
.