-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Implementation of the PKTree spatial index data structure -- -- This project aims to implement the great spatial index data structure, -- the PK tree, in Haskell. The data structure is covered in the -- following papers, but the code is much easier to read than they are: -- -- http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.21.411 -- http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.21.883 -- http://www.cs.umd.edu/~hjs/pubs/TR-4523.pdf @package pktree @version 0.1 -- | Implementation of the PKTree spatial index data structure -- -- The reccomended way to import this module is: -- --
-- import qualified Data.PKTree as PKTree -- pkInsert = insert K [rx,ry,..] --module Data.PKTree -- | An n-dimensional point type Point = [Float] -- | An n-dimensional hyperrectangle type Rectangle = (Point, Point) -- | A PKTree type PKTree a = Tree (Node a) -- | Inner nodes have rectangles, leaves are points and data data Node a Inner :: Rectangle -> Node a Leaf :: Point -> a -> Node a -- | Contruct a tree with no children cell :: Rectangle -> PKTree a -- | Construct a leaf node representing a point pointCell :: Point -> a -> PKTree a -- | Extract the rectangle from a node rect :: PKTree a -> Rectangle -- | Insert a point into a PKTree insert :: Eq a => Int -> [Int] -> PKTree a -> Point -> a -> PKTree a -- | Search for points in some hypercircle radiusSearch :: Point -> Float -> PKTree a -> [(Point, a)] instance Eq a => Eq (Node a) instance Show a => Show (Node a) instance Read a => Read (Node a)