- class Point p where
- compareDistance :: Point p => p -> p -> p -> Ordering
- data Point3d = Point3d {}
- data KdTree point
- fromList :: Point p => [p] -> KdTree p
- fromListWithDepth :: Point p => [p] -> Int -> KdTree p
- axisFromDepth :: Point p => p -> Int -> Int
- toList :: KdTree p -> [p]
- subtrees :: KdTree p -> [KdTree p]
- nearestNeighbor :: Point p => KdTree p -> p -> Maybe p
- invariant :: Point p => KdTree p -> Bool
- invariant' :: Point p => KdTree p -> Bool
Documentation
compareDistance :: Point p => p -> p -> p -> OrderingSource
compareDistance p a b compares the distances of a and b to p.
fromListWithDepth :: Point p => [p] -> Int -> KdTree pSource
axisFromDepth :: Point p => p -> Int -> IntSource
nearestNeighbor :: Point p => KdTree p -> p -> Maybe pSource
invariant :: Point p => KdTree p -> BoolSource
invariant tells whether the KD tree property holds for a given tree and all its subtrees. Specifically, it tests that all points in the left subtree lie to the left of the plane, p is on the plane, and all points in the right subtree lie to the right.
invariant' :: Point p => KdTree p -> BoolSource