使用Google的C KD树库 [英] Using Google's C KD Tree Library

查看:140
本文介绍了使用Google的C KD树库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google有一个用C写的KD树图书馆: Here

Google has a KD Tree Library written in C: Here

据我所知,使用其中一个函数将注释插入到树中,然后查询最近邻居的树。它返回一个指向一个新数组的指针(据我所知)。

As far as I can tell, you insert notes into the tree using one of it's functions, and then query the tree for nearest neighbors. It returns a pointer to a new array (as far as I can tell).

这是我的目标:

我有一个3D数组,我希望找到一种返回给定点最近邻的索引的方法。我想说:这里有一点:(12,23,14),现在告诉我最接近的点的索引:它是你的数组中的第五个项目。但是,我不知道该怎么做。

I have a 3D array and I am hoping to find a way to return the index of a given point's nearest neighbor. I want to say: Here is a point: (12,23,14), now tell me the index of the point that is closest ex: "it is the 5th item in your array". However, I am not sure how to do this.

我的问题,有没有人:

A)知道一个很好的文件记录的k维最近邻搜索库c,或:

A) Know of a good well documented k dimensional nearest neighbor search library for c, or:

B)知道如何让Google的代码返回数组中最近邻居的位置

B) Know how to get Google's code to return the position of the nearest neighbor in an array.

推荐答案

您链接的库,从我的理解中没有实现n个最近邻居搜索功能。我没有C的任何其他kd-tree库。

The library you linked, from my understanding does not have the n-nearest neighbour search functions implemented. I don't have any other kd-tree library in mind for C.

实现一个简单的kd-tree不是很复杂,应该是一个很好的练习。您可以按照 http://ldots.org/kdtree/ 进行。

Implementing a simple kd-tree is not very complex and it should be a good exercise. You could for example follow http://ldots.org/kdtree/ .

这篇关于使用Google的C KD树库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆