The KdTree package

[ Tags: bsd3, graphics, library, program ] [ Propose Tags ]

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

[Skip to Readme]


Versions 0.1, 0.2, 0.2.1
Dependencies base (<5), QuickCheck [details]
License BSD3
Copyright Copyright 2011, Issac Trotts
Author Issac Trotts
Category Graphics
Home page
Source repository head: git clone
Uploaded Mon Jan 16 22:46:48 UTC 2012 by IssacTrotts
Distributions NixOS:0.2.1
Executables KdTreeTest
Downloads 1500 total (18 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for KdTree-0.2.1

[back to package description]
This is a simple library for k-d trees in Haskell, based on the algorithms

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:  :? 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}