Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PointCloud
Flann
提交
26fd3a55
F
Flann
项目概览
PointCloud
/
Flann
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flann
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
26fd3a55
编写于
12月 06, 2011
作者:
M
Marius Muja
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Nicer way of controling index instantiation for different distance combinations
上级
a4fa9393
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
6 addition
and
107 deletion
+6
-107
src/cpp/flann/algorithms/all_indices.h
src/cpp/flann/algorithms/all_indices.h
+1
-106
src/cpp/flann/algorithms/composite_index.h
src/cpp/flann/algorithms/composite_index.h
+2
-0
src/cpp/flann/algorithms/kdtree_cuda_3d_index.h
src/cpp/flann/algorithms/kdtree_cuda_3d_index.h
+1
-0
src/cpp/flann/algorithms/kdtree_single_index.h
src/cpp/flann/algorithms/kdtree_single_index.h
+1
-0
test/flann_simple_test.cpp
test/flann_simple_test.cpp
+1
-1
未找到文件。
src/cpp/flann/algorithms/all_indices.h
浏览文件 @
26fd3a55
...
...
@@ -47,111 +47,6 @@
namespace
flann
{
template
<
typename
KDTreeCapability
,
typename
VectorSpace
,
typename
Distance
>
struct
index_creator
{
static
NNIndex
<
Distance
>*
create
(
const
Matrix
<
typename
Distance
::
ElementType
>&
dataset
,
const
IndexParams
&
params
,
const
Distance
&
distance
)
{
flann_algorithm_t
index_type
=
get_param
<
flann_algorithm_t
>
(
params
,
"algorithm"
);
NNIndex
<
Distance
>*
nnIndex
;
switch
(
index_type
)
{
case
FLANN_INDEX_LINEAR
:
nnIndex
=
new
LinearIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
case
FLANN_INDEX_KDTREE_SINGLE
:
nnIndex
=
new
KDTreeSingleIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
case
FLANN_INDEX_KDTREE
:
nnIndex
=
new
KDTreeIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
//! #define this symbol before including flann.h to enable GPU search algorithms. But you have
//! to link libflann_cuda then!
#ifdef FLANN_USE_CUDA
case
FLANN_INDEX_KDTREE_CUDA
:
nnIndex
=
new
KDTreeCuda3dIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
#endif
case
FLANN_INDEX_KMEANS
:
nnIndex
=
new
KMeansIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
case
FLANN_INDEX_COMPOSITE
:
nnIndex
=
new
CompositeIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
case
FLANN_INDEX_AUTOTUNED
:
nnIndex
=
new
AutotunedIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
case
FLANN_INDEX_HIERARCHICAL
:
nnIndex
=
new
HierarchicalClusteringIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
case
FLANN_INDEX_LSH
:
nnIndex
=
new
LshIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
default:
throw
FLANNException
(
"Unknown index type"
);
}
return
nnIndex
;
}
};
template
<
typename
VectorSpace
,
typename
Distance
>
struct
index_creator
<
FalseType
,
VectorSpace
,
Distance
>
{
static
NNIndex
<
Distance
>*
create
(
const
Matrix
<
typename
Distance
::
ElementType
>&
dataset
,
const
IndexParams
&
params
,
const
Distance
&
distance
)
{
flann_algorithm_t
index_type
=
get_param
<
flann_algorithm_t
>
(
params
,
"algorithm"
);
NNIndex
<
Distance
>*
nnIndex
;
switch
(
index_type
)
{
case
FLANN_INDEX_LINEAR
:
nnIndex
=
new
LinearIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
case
FLANN_INDEX_KMEANS
:
nnIndex
=
new
KMeansIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
case
FLANN_INDEX_HIERARCHICAL
:
nnIndex
=
new
HierarchicalClusteringIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
case
FLANN_INDEX_LSH
:
nnIndex
=
new
LshIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
default:
throw
FLANNException
(
"Unknown index type"
);
}
return
nnIndex
;
}
};
template
<
typename
Distance
>
struct
index_creator
<
FalseType
,
FalseType
,
Distance
>
{
static
NNIndex
<
Distance
>*
create
(
const
Matrix
<
typename
Distance
::
ElementType
>&
dataset
,
const
IndexParams
&
params
,
const
Distance
&
distance
)
{
flann_algorithm_t
index_type
=
get_param
<
flann_algorithm_t
>
(
params
,
"algorithm"
);
NNIndex
<
Distance
>*
nnIndex
;
switch
(
index_type
)
{
case
FLANN_INDEX_LINEAR
:
nnIndex
=
new
LinearIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
case
FLANN_INDEX_HIERARCHICAL
:
nnIndex
=
new
HierarchicalClusteringIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
case
FLANN_INDEX_LSH
:
nnIndex
=
new
LshIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
default:
throw
FLANNException
(
"Unknown index type"
);
}
return
nnIndex
;
}
};
/**
* enable_if sfinae helper
...
...
@@ -205,7 +100,7 @@ struct valid_combination
static
const
bool
value
=
same_type
<
ElementType
,
typename
Distance
::
ElementType
>::
value
&&
(
!
needs_kdtree_distance
<
Index
<
Distance
>
>::
value
||
is_kdtree_distance
<
Distance
>::
value
)
&&
(
!
needs_vector_space_distance
<
Index
<
Distance
>
>::
value
||
is_vector_space_distance
<
Distance
>::
value
);
(
!
needs_vector_space_distance
<
Index
<
Distance
>
>::
value
||
is_
kdtree_distance
<
Distance
>::
value
||
is_
vector_space_distance
<
Distance
>::
value
);
};
...
...
src/cpp/flann/algorithms/composite_index.h
浏览文件 @
26fd3a55
...
...
@@ -74,6 +74,8 @@ public:
typedef
typename
Distance
::
ElementType
ElementType
;
typedef
typename
Distance
::
ResultType
DistanceType
;
typedef
bool
needs_kdtree_distance
;
/**
* Index constructor
* @param inputData dataset containing the points to index
...
...
src/cpp/flann/algorithms/kdtree_cuda_3d_index.h
浏览文件 @
26fd3a55
...
...
@@ -76,6 +76,7 @@ public:
int
visited_leafs
;
typedef
bool
needs_kdtree_distance
;
/**
* KDTree constructor
...
...
src/cpp/flann/algorithms/kdtree_single_index.h
浏览文件 @
26fd3a55
...
...
@@ -72,6 +72,7 @@ public:
typedef
typename
Distance
::
ElementType
ElementType
;
typedef
typename
Distance
::
ResultType
DistanceType
;
typedef
bool
needs_kdtree_distance
;
/**
* KDTree constructor
...
...
test/flann_simple_test.cpp
浏览文件 @
26fd3a55
...
...
@@ -620,7 +620,7 @@ TEST_F(Flann_3D, SavedTest2)
class
Flann_Brief100K_Test
:
public
FLANNTestFixture
{
protected:
typedef
flann
::
Hamming
2
<
unsigned
char
>
Distance
;
typedef
flann
::
Hamming
<
unsigned
char
>
Distance
;
typedef
Distance
::
ElementType
ElementType
;
typedef
Distance
::
ResultType
DistanceType
;
flann
::
Matrix
<
unsigned
char
>
data
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录