SpatialQuery

org.appliedtopology.tda4j.streams.SpatialQuery
trait SpatialQuery[VertexT]

******* Efficient Spatial Queries *******

Attributes

Experimental
true
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class BruteForce[VertexT]
class JVPTree[VertexT]

Members list

Value members

Abstract methods

def nearestNeighbors(v: VertexT, k: Int): IndexedSeq[VertexT]

The k nearest points to v (by metricSpace.distance), sorted ascending by distance, v itself included when it belongs to the underlying metric space (a real metric always has distance(v,v) = 0, the smallest possible, so v is always its own nearest neighbour) -- this is the convention streams.DistanceToMeasure needs (Chazal-Cohen-Steiner-Merigot 2011's empirical DTM counts a point among its own k neighbours; verified against GUDHI's own DistanceToMeasure/KNearestNeighbors docstring AND a worked numeric example, see .claude/WORKLOG-dtm-filtrations.md). require(1 <= k && k <= metricSpace.size): a k outside that range has no sensible answer (jvptree's own getNearestNeighbors silently clamps to however many points exist, which would silently under-deliver rather than fail loudly).

The k nearest points to v (by metricSpace.distance), sorted ascending by distance, v itself included when it belongs to the underlying metric space (a real metric always has distance(v,v) = 0, the smallest possible, so v is always its own nearest neighbour) -- this is the convention streams.DistanceToMeasure needs (Chazal-Cohen-Steiner-Merigot 2011's empirical DTM counts a point among its own k neighbours; verified against GUDHI's own DistanceToMeasure/KNearestNeighbors docstring AND a worked numeric example, see .claude/WORKLOG-dtm-filtrations.md). require(1 <= k && k <= metricSpace.size): a k outside that range has no sensible answer (jvptree's own getNearestNeighbors silently clamps to however many points exist, which would silently under-deliver rather than fail loudly).

Attributes

def neighbors(v: VertexT, epsilon: Double): Set[VertexT]