Skip to content

Commit 65fed67

Browse files
committed
Merge pull request flann-lib#254 from seth-planet/efficient_compression
Efficient compression
2 parents 21e5ab1 + 50fcb78 commit 65fed67

File tree

8 files changed

+2367
-1268
lines changed

8 files changed

+2367
-1268
lines changed

src/cpp/flann/algorithms/autotuned_index.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,21 @@ class AutotunedIndex : public NNIndex<Distance>
208208

209209
void saveIndex(FILE* stream)
210210
{
211-
serialization::SaveArchive sa(stream);
212-
sa & *this;
211+
{
212+
serialization::SaveArchive sa(stream);
213+
sa & *this;
214+
}
213215

214216
bestIndex_->saveIndex(stream);
215217
}
216218

217219
void loadIndex(FILE* stream)
218220
{
219-
serialization::LoadArchive la(stream);
220-
la & *this;
221-
221+
{
222+
serialization::LoadArchive la(stream);
223+
la & *this;
224+
}
225+
222226
IndexParams params;
223227
flann_algorithm_t index_type = get_param<flann_algorithm_t>(bestParams_,"algorithm");
224228
bestIndex_ = create_index_by_type<Distance>((flann_algorithm_t)index_type, dataset_, params, distance_);

src/cpp/flann/algorithms/nn_index.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class NNIndex : public IndexBase
239239
if (Archive::is_loading::value) {
240240
if (strncmp(header.h.signature,
241241
FLANN_SIGNATURE_,
242-
strlen(FLANN_SIGNATURE_)) != 0) {
242+
strlen(FLANN_SIGNATURE_) - strlen("v0.0")) != 0) {
243243
throw FLANNException("Invalid index file, wrong signature");
244244
}
245245

0 commit comments

Comments
 (0)