使用Google的C KD树库

编程入门 行业动态 更新时间:2024-10-28 06:23:11
本文介绍了使用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不是很复杂,应该是一个很好的练习。您可以按照 ldots/kdtree/ 进行。

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

更多推荐

使用Google的C KD树库

本文发布于:2023-07-28 00:18:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1225615.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Google   KD   树库

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!