File tree Expand file tree Collapse file tree 10 files changed +2119
-58
lines changed Expand file tree Collapse file tree 10 files changed +2119
-58
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ if (HDF5_FOUND)
14
14
include_directories (${HDF5_INCLUDE_DIR} )
15
15
16
16
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 )
18
18
if (HDF5_IS_PARALLEL )
19
19
target_link_libraries (flann_example_cpp ${MPI_LIBRARIES} )
20
20
endif ()
Original file line number Diff line number Diff line change 1
- #include_directories(${CMAKE_SOURCE_DIR}/include algorithms util nn .)
1
+ #include_directories(${CMAKE_SOURCE_DIR}/include algorithms ext util nn .)
2
2
3
3
add_definitions (-D_FLANN_VERSION=${FLANN_VERSION} )
4
4
5
5
configure_file (${CMAKE_CURRENT_SOURCE_DIR} /flann/config.h.in ${CMAKE_CURRENT_SOURCE_DIR} /flann/config.h )
6
6
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 )
9
9
file (GLOB_RECURSE CU_SOURCES *.cu )
10
10
11
11
add_library (flann_cpp_s STATIC ${CPP_SOURCES} )
Original file line number Diff line number Diff line change @@ -228,22 +228,26 @@ class NNIndex : public IndexBase
228
228
IndexHeader header;
229
229
230
230
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_;
235
235
}
236
236
ar & header;
237
237
238
238
// sanity checks
239
239
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 ) {
241
243
throw FLANNException (" Invalid index file, wrong signature" );
242
244
}
243
- if (header.data_type != flann_datatype_value<ElementType>::value) {
245
+
246
+ if (header.h .data_type != flann_datatype_value<ElementType>::value) {
244
247
throw FLANNException (" Datatype of saved index is different than of the one to be created." );
245
248
}
246
- if (header.index_type != getType ()) {
249
+
250
+ if (header.h .index_type != getType ()) {
247
251
throw FLANNException (" Saved index type is different then the current index type." );
248
252
}
249
253
// TODO: check for distance type
You can’t perform that action at this time.
0 commit comments