Skip to content

Commit e1d4baa

Browse files
author
Marius Muja
committed
Merge branch 'seth_old' of https://github.com/seth-planet/flann
2 parents bc99fa6 + 9dfde48 commit e1d4baa

File tree

10 files changed

+2119
-58
lines changed

10 files changed

+2119
-58
lines changed

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (HDF5_FOUND)
1414
include_directories(${HDF5_INCLUDE_DIR})
1515

1616
add_executable(flann_example_cpp flann_example.cpp)
17-
target_link_libraries(flann_example_cpp ${HDF5_LIBRARIES})
17+
target_link_libraries(flann_example_cpp ${HDF5_LIBRARIES} flann_cpp)
1818
if (HDF5_IS_PARALLEL)
1919
target_link_libraries(flann_example_cpp ${MPI_LIBRARIES})
2020
endif()

src/cpp/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#include_directories(${CMAKE_SOURCE_DIR}/include algorithms util nn .)
1+
#include_directories(${CMAKE_SOURCE_DIR}/include algorithms ext util nn .)
22

33
add_definitions(-D_FLANN_VERSION=${FLANN_VERSION})
44

55
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/flann/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/flann/config.h)
66

7-
file(GLOB_RECURSE C_SOURCES flann.cpp)
8-
file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp)
7+
file(GLOB_RECURSE C_SOURCES flann.cpp lz4.c lz4hc.c)
8+
file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp lz4.c lz4hc.c)
99
file(GLOB_RECURSE CU_SOURCES *.cu)
1010

1111
add_library(flann_cpp_s STATIC ${CPP_SOURCES})

src/cpp/flann/algorithms/nn_index.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,22 +228,26 @@ class NNIndex : public IndexBase
228228
IndexHeader header;
229229

230230
if (Archive::is_saving::value) {
231-
header.data_type = flann_datatype_value<ElementType>::value;
232-
header.index_type = getType();
233-
header.rows = size_;
234-
header.cols = veclen_;
231+
header.h.data_type = flann_datatype_value<ElementType>::value;
232+
header.h.index_type = getType();
233+
header.h.rows = size_;
234+
header.h.cols = veclen_;
235235
}
236236
ar & header;
237237

238238
// sanity checks
239239
if (Archive::is_loading::value) {
240-
if (strcmp(header.signature,FLANN_SIGNATURE_)!=0) {
240+
if (strncmp(header.h.signature,
241+
FLANN_SIGNATURE_,
242+
strlen(FLANN_SIGNATURE_)) != 0) {
241243
throw FLANNException("Invalid index file, wrong signature");
242244
}
243-
if (header.data_type != flann_datatype_value<ElementType>::value) {
245+
246+
if (header.h.data_type != flann_datatype_value<ElementType>::value) {
244247
throw FLANNException("Datatype of saved index is different than of the one to be created.");
245248
}
246-
if (header.index_type != getType()) {
249+
250+
if (header.h.index_type != getType()) {
247251
throw FLANNException("Saved index type is different then the current index type.");
248252
}
249253
// TODO: check for distance type

0 commit comments

Comments
 (0)