Coder Social home page Coder Social logo

begeekmyfriend / kdtree Goto Github PK

View Code? Open in Web Editor NEW
174.0 13.0 35.0 29 KB

Absolute balanced kdtree for fast kNN search.

License: MIT License

C 82.25% Makefile 0.17% MATLAB 17.58%
kd-tree kdtrees algorithm tree-structure knn-search knn k-nearest-neighbours kmeans k-means kd-trees

kdtree's Introduction

kdtree

This is a (nearly absolute) balanced kdtree for fast kNN search. It does not support dynamic insertion and removal. Actually we adopt quick sort to rebuild the whole tree after changes of nodes. We cache the added or the deleted nodes which will not be actually mapped into the tree until the rebuild method to be invoked. The good thing is we can always keep the tree balanced, and the bad thing is we have to wait some time for the finish of tree rebuild. Moreover, duplicated samples are allowed to be added.

The thought of the implementation is posted here.

kdtree's People

Contributors

begeekmyfriend avatar qabot-zh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kdtree's Issues

kdtree_knn_search only works once

Hi,

It seems that research in the kdtree is only possible once.

see the attached test file below who results to

3 nearest neighbors of sample(-1.00, -5.00):
(1.24, -2.86) Distance:3.097935
(-2.96, -0.50) Distance:4.908319
(-6.88, -5.40) Distance:5.893590
3 nearest neighbors of sample(-8.00, -7.00):
(1.24, -2.86) Distance:3.097935
(-2.96, -0.50) Distance:4.908319
(-6.88, -5.40) Distance:5.893590

Whatever the next values you add in the code for searching, the result is the same.

kdtree_test.c.zip

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.