Skip to content
develop
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

ekdtree implements Erlang interface to CGAL k-d tree and k-NN search algorithm.

Usage

ekdtree:new/1 constructs tree from points which are 4-tuples of integer Id, and float XYZ coordinates:

Points = [{0, 10.0, 10.0, 10.0}, {1, 10.0, 10.0, -10.0}, {2, 10.0,-10.0, 10.0}],
{ok, Tree} = ekdtree:new(Points).

ekdtree:size/1 returns a number of points:

3 = ekdtree:size(Tree).

ekdtree:search/3 returns an ordered list of K nearest neighbors along with a transformed (squared) distance(s):

Knn = ekdtree:search(Tree, {5.0, 5.0, 10.0}, 2), 
[{0, 50.0}, {2, 250.0}])] = Knn.

About

Erlang k-d tree

Resources

Packages

No packages published
You can’t perform that action at this time.