Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | Haskell2010 |
Algorithms.Geometry.ClosestPair.Naive
Description
Naive O(n^2)) time algorithm to compute the closest pair of points among n points in Rd.
Documentation
closestPair :: (Ord r, Arity d, Num r) => LSeq 2 (Point d r :+ p) -> Two (Point d r :+ p) Source #
Naive algorithm to compute the closest pair in d dimensions. Runs in O(n2) time (for any constant d). Note that we need at least two elements for there to be a closest pair.