namosim.algorithms.kd_tree module
- class namosim.algorithms.kd_tree.KDNode(object: T, point: List[float], axis: int)
Bases:
Generic
[T
]
- class namosim.algorithms.kd_tree.KDTree(dimensions: int, point_getter: ~typing.Callable[[~namosim.algorithms.kd_tree.T], ~typing.Iterable[float]], distance_func: ~typing.Callable[[~typing.Iterable[float], ~typing.Iterable[float]], float] = <function default_distance_func>)
Bases:
Generic
[T
]- add(object: T) None
Add an object to the KDTree.
- query(point: Iterable[float], k: int = 1) List[T]
Find k nearest neighbor objects to the query point.
- query_radius(point: Iterable[float], radius: float) List[T]
Renvoie tous les objets dont la distance euclidienne au ‘point’ est ≤ radius.
- namosim.algorithms.kd_tree.default_distance_func(A: Iterable[float], B: Iterable[float])