The KdTree package

[Tags: bsd3, library, program]

This is a simple library for k-d trees in Haskell. It enables efficient searching through collections of points in O(log N) time on average, using the nearestNeighbor function.


[Skip to ReadMe]

Properties

Versions0.1, 0.2, 0.2.1
Change logNone available
Dependenciesbase (<5), QuickCheck [details]
LicenseBSD3
CopyrightCopyright 2011, Issac Trotts
AuthorIssac Trotts
Maintainerissac.trotts@gmail.com
CategoryGraphics
Home pagehttps://github.com/ijt/kdtree
Source repositoryhead: git clone git@github.com:ijt/kdtree.git
ExecutablesKdTreeTest
UploadedMon Jun 27 08:31:39 UTC 2011 by IssacTrotts
DistributionsNixOS:0.2.1
Downloads1150 total (40 in last 30 days)
Votes
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for KdTree-0.2

This is a simple library for k-d trees in Haskell, based on the algorithms
at http://en.wikipedia.org/wiki/K-d_tree.

It enables efficient searching through collections of points in O(log N) time
for randomly distributed points, using the nearestNeighbor function.

Here is an example of an interactive session using this module:

[ ~/haskell/KdTree ] ghci
GHCi, version 7.0.3: http://www.haskell.org/ghc/  :? for help
...
Prelude> :m Data.Trees.KdTree 
Prelude Data.Trees.KdTree> import Test.QuickCheck
Prelude Data.Trees.KdTree Test.QuickCheck> points <- sample' arbitrary :: IO [Point3d]
...
Prelude Data.Trees.KdTree Test.QuickCheck> let tree = fromList points
Prelude Data.Trees.KdTree Test.QuickCheck> nearestNeighbor tree (head points)
Just (Point3d {p3x = 0.0, p3y = 0.0, p3z = 0.0})
Prelude Data.Trees.KdTree Test.QuickCheck> head points
Point3d {p3x = 0.0, p3y = 0.0, p3z = 0.0}