Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PointCloud
Flann
提交
f5fa05cc
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,发现更多精彩内容 >>
提交
f5fa05cc
编写于
1月 20, 2011
作者:
M
Marius Muja
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of ubc:lci/fann
Conflicts: src/cpp/flann/algorithms/kdtree_index.h
上级
972b3be4
d581b488
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
30 addition
and
26 deletion
+30
-26
CMakeLists.txt
CMakeLists.txt
+1
-1
Makefile.dist
Makefile.dist
+1
-1
examples/flann_example.c
examples/flann_example.c
+1
-1
src/cpp/CMakeLists.txt
src/cpp/CMakeLists.txt
+2
-0
src/cpp/flann/algorithms/autotuned_index.h
src/cpp/flann/algorithms/autotuned_index.h
+3
-1
src/cpp/flann/algorithms/composite_index.h
src/cpp/flann/algorithms/composite_index.h
+1
-1
src/cpp/flann/algorithms/kdtree_index.h
src/cpp/flann/algorithms/kdtree_index.h
+2
-2
src/cpp/flann/algorithms/kdtree_single_index.h
src/cpp/flann/algorithms/kdtree_single_index.h
+1
-1
src/cpp/flann/algorithms/kmeans_index.h
src/cpp/flann/algorithms/kmeans_index.h
+1
-1
src/cpp/flann/algorithms/linear_index.h
src/cpp/flann/algorithms/linear_index.h
+1
-1
src/cpp/flann/flann.cpp
src/cpp/flann/flann.cpp
+2
-3
src/cpp/flann/general.h
src/cpp/flann/general.h
+5
-5
src/cpp/flann/nn/ground_truth.h
src/cpp/flann/nn/ground_truth.h
+3
-2
src/cpp/flann/util/logger.cpp
src/cpp/flann/util/logger.cpp
+4
-4
src/cpp/flann/util/logger.h
src/cpp/flann/util/logger.h
+1
-1
test/flann_simple_test.cpp
test/flann_simple_test.cpp
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
f5fa05cc
...
...
@@ -8,7 +8,7 @@ project(flann)
string
(
TOLOWER
${
PROJECT_NAME
}
PROJECT_NAME_LOWER
)
include
(
${
PROJECT_SOURCE_DIR
}
/cmake/flann_utils.cmake
)
set
(
FLANN_VERSION 1.6.
6
)
set
(
FLANN_VERSION 1.6.
7
)
DISSECT_VERSION
()
GET_OS_INFO
()
...
...
Makefile.dist
浏览文件 @
f5fa05cc
VER
=
1.6.
6
VER
=
1.6.
7
dist-src
:
...
...
examples/flann_example.c
浏览文件 @
f5fa05cc
...
...
@@ -91,7 +91,7 @@ int main(int argc, char** argv)
p
=
DEFAULT_FLANN_PARAMETERS
;
p
.
algorithm
=
KDTREE
;
p
.
trees
=
8
;
p
.
log_level
=
LOG_INFO
;
p
.
log_level
=
FLANN_
LOG_INFO
;
p
.
checks
=
64
;
printf
(
"Computing index.
\n
"
);
...
...
src/cpp/CMakeLists.txt
浏览文件 @
f5fa05cc
...
...
@@ -16,6 +16,7 @@ set_target_properties(flann_cpp_s PROPERTIES COMPILE_FLAGS -fPIC)
if
(
CMAKE_SYSTEM_NAME STREQUAL
"Linux"
AND CMAKE_COMPILER_IS_GNUCC
)
add_library
(
flann_cpp SHARED
""
)
set_target_properties
(
flann_cpp PROPERTIES LINKER_LANGUAGE CXX
)
target_link_libraries
(
flann_cpp -Wl,-whole-archive flann_cpp_s -Wl,-no-whole-archive
)
else
()
add_library
(
flann_cpp SHARED
${
CPP_SOURCES
}
)
...
...
@@ -32,6 +33,7 @@ if (BUILD_C_BINDINGS)
if
(
CMAKE_SYSTEM_NAME STREQUAL
"Linux"
AND CMAKE_COMPILER_IS_GNUCC
)
add_library
(
flann SHARED
""
)
set_target_properties
(
flann PROPERTIES LINKER_LANGUAGE CXX
)
target_link_libraries
(
flann -Wl,-whole-archive flann_s -Wl,-no-whole-archive
)
else
()
add_library
(
flann SHARED
${
C_SOURCES
}
)
...
...
src/cpp/flann/algorithms/autotuned_index.h
浏览文件 @
f5fa05cc
...
...
@@ -144,7 +144,7 @@ class AutotunedIndex : public NNIndex<Distance>
/**
* Index parameters
*/
const
AutotunedIndexParams
&
index_params
;
const
AutotunedIndexParams
index_params
;
Distance
distance
;
public:
...
...
@@ -161,9 +161,11 @@ public:
{
if
(
bestIndex
!=
NULL
)
{
delete
bestIndex
;
bestIndex
=
NULL
;
}
if
(
bestParams
!=
NULL
)
{
delete
bestParams
;
bestParams
=
NULL
;
}
};
...
...
src/cpp/flann/algorithms/composite_index.h
浏览文件 @
f5fa05cc
...
...
@@ -102,7 +102,7 @@ class CompositeIndex : public NNIndex<Distance>
const
Matrix
<
ElementType
>
dataset
;
const
IndexParams
&
index_params
;
const
CompositeIndexParams
index_params
;
Distance
distance
;
...
...
src/cpp/flann/algorithms/kdtree_index.h
浏览文件 @
f5fa05cc
...
...
@@ -123,7 +123,7 @@ class KDTreeIndex : public NNIndex<Distance>
*/
const
Matrix
<
ElementType
>
dataset
;
const
IndexParams
&
index_params
;
const
KDTreeIndexParams
index_params
;
size_t
size_
;
size_t
veclen_
;
...
...
@@ -421,7 +421,7 @@ private:
/* If either list is empty, it means that all remaining features
* are identical. Split in the middle to maintain a balanced tree.
*/
if
(
lim1
==
cnt
||
lim2
==
0
)
index
=
count
/
2
;
if
(
lim1
==
c
ou
nt
||
lim2
==
0
)
index
=
count
/
2
;
}
...
...
src/cpp/flann/algorithms/kdtree_single_index.h
浏览文件 @
f5fa05cc
...
...
@@ -102,7 +102,7 @@ class KDTreeSingleIndex : public NNIndex<Distance>
*/
const
Matrix
<
ElementType
>
dataset
;
const
IndexParams
&
index_params
;
const
KDTreeSingleIndexParams
index_params
;
size_t
size_
;
size_t
veclen_
;
...
...
src/cpp/flann/algorithms/kmeans_index.h
浏览文件 @
f5fa05cc
...
...
@@ -134,7 +134,7 @@ class KMeansIndex : public NNIndex<Distance>
*/
const
Matrix
<
ElementType
>
dataset
;
const
IndexParams
&
index_params
;
const
KMeansIndexParams
index_params
;
/**
* Number of features in the dataset.
...
...
src/cpp/flann/algorithms/linear_index.h
浏览文件 @
f5fa05cc
...
...
@@ -66,7 +66,7 @@ class LinearIndex
typedef
typename
Distance
::
ResultType
DistanceType
;
const
Matrix
<
ElementType
>
dataset
;
const
LinearIndexParams
&
index_params
;
const
LinearIndexParams
index_params
;
Distance
distance
;
...
...
src/cpp/flann/flann.cpp
浏览文件 @
f5fa05cc
...
...
@@ -44,7 +44,7 @@ EXPORTED struct FLANNParameters DEFAULT_FLANN_PARAMETERS = {
4
,
4
,
32
,
11
,
CENTERS_RANDOM
,
0.9
,
0.01
,
0
,
0.1
,
LOG_NONE
,
0
FLANN_
LOG_NONE
,
0
};
...
...
@@ -100,6 +100,7 @@ flann_index_t __flann_build_index(typename Distance::ElementType* dataset, int r
*
speedup
=
autotuned_index
->
getSpeedup
();
}
delete
params
;
return
index
;
}
catch
(
std
::
runtime_error
&
e
)
{
...
...
@@ -620,9 +621,7 @@ int __flann_free_index(flann_index_t index_ptr, FLANNParameters* flann_params)
throw
FLANNException
(
"Invalid index"
);
}
Index
<
Distance
>*
index
=
(
Index
<
Distance
>*
)
index_ptr
;
const
IndexParams
*
index_params
=
index
->
getIndexParameters
();
delete
index
;
delete
index_params
;
return
0
;
}
...
...
src/cpp/flann/general.h
浏览文件 @
f5fa05cc
...
...
@@ -53,11 +53,11 @@ enum flann_centers_init_t {
};
enum
flann_log_level_t
{
LOG_NONE
=
0
,
LOG_FATAL
=
1
,
LOG_ERROR
=
2
,
LOG_WARN
=
3
,
LOG_INFO
=
4
FLANN_
LOG_NONE
=
0
,
FLANN_
LOG_FATAL
=
1
,
FLANN_
LOG_ERROR
=
2
,
FLANN_
LOG_WARN
=
3
,
FLANN_
LOG_INFO
=
4
};
enum
flann_distance_t
{
...
...
src/cpp/flann/nn/ground_truth.h
浏览文件 @
f5fa05cc
...
...
@@ -43,17 +43,18 @@ void find_nearest(const Matrix<typename Distance::ElementType>& dataset, typenam
int
skip
=
0
,
Distance
distance
=
Distance
())
{
typedef
typename
Distance
::
ElementType
ElementType
;
typedef
typename
Distance
::
ResultType
DistanceType
;
int
n
=
nn
+
skip
;
int
*
match
=
new
int
[
n
];
ElementType
*
dists
=
new
Element
Type
[
n
];
DistanceType
*
dists
=
new
Distance
Type
[
n
];
dists
[
0
]
=
distance
(
dataset
[
0
],
query
,
dataset
.
cols
);
match
[
0
]
=
0
;
int
dcnt
=
1
;
for
(
size_t
i
=
1
;
i
<
dataset
.
rows
;
++
i
)
{
Element
Type
tmp
=
distance
(
dataset
[
i
],
query
,
dataset
.
cols
);
Distance
Type
tmp
=
distance
(
dataset
[
i
],
query
,
dataset
.
cols
);
if
(
dcnt
<
n
)
{
match
[
dcnt
]
=
i
;
...
...
src/cpp/flann/util/logger.cpp
浏览文件 @
f5fa05cc
...
...
@@ -76,9 +76,9 @@ int Logger::log(int level, const char* fmt, va_list arglist)
}
LOG_METHOD
(
fatal
,
LOG_FATAL
)
LOG_METHOD
(
error
,
LOG_ERROR
)
LOG_METHOD
(
warn
,
LOG_WARN
)
LOG_METHOD
(
info
,
LOG_INFO
)
LOG_METHOD
(
fatal
,
FLANN_
LOG_FATAL
)
LOG_METHOD
(
error
,
FLANN_
LOG_ERROR
)
LOG_METHOD
(
warn
,
FLANN_
LOG_WARN
)
LOG_METHOD
(
info
,
FLANN_
LOG_INFO
)
}
src/cpp/flann/util/logger.h
浏览文件 @
f5fa05cc
...
...
@@ -45,7 +45,7 @@ class Logger
public:
Logger
()
:
stream
(
stdout
),
logLevel
(
LOG_WARN
)
{};
Logger
()
:
stream
(
stdout
),
logLevel
(
FLANN_
LOG_WARN
)
{};
~
Logger
()
{
...
...
test/flann_simple_test.cpp
浏览文件 @
f5fa05cc
...
...
@@ -309,7 +309,7 @@ TEST_F(Flann_SIFT100K_Test, KMeansTreeTest)
TEST_F
(
Flann_SIFT100K_Test
,
AutotunedTest
)
{
flann
::
log_verbosity
(
LOG_INFO
);
flann
::
log_verbosity
(
FLANN_
LOG_INFO
);
Index
<
L2
<
float
>
>
index
(
data
,
flann
::
AutotunedIndexParams
(
0.8
,
0.01
,
0
,
0.1
));
// 80% precision
start_timer
(
"Building autotuned index..."
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录